alpixel / shopbundle
此捆绑包由我们的团队用于构建电子商务网站
v0.3.1
2018-04-13 14:57 UTC
Requires
- php: >=5.5.0
- alpixel/userbundle: ~2.0
- doctrine/doctrine-bundle: ~1.6
- doctrine/orm: ~2.4
- sensio/framework-extra-bundle: ~3.0
- stof/doctrine-extensions-bundle: ^1.2
- symfony/symfony: ~2.8
Suggests
- happyr/google-analytics-bundle: ^4.0
- php-http/httplug: ^1.0
This package is not auto-updated.
Last update: 2024-09-14 19:31:09 UTC
README
😅 事情变得严肃了。
安装
下载捆绑包
从您的项目目录。
$ composer require alpixel/shopbundle
启用捆绑包
然后,您需要在 app/AppKernel.php
文件中添加以下行以启用捆绑包。
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new Alpixel\Bundle\ShopBundle\AlpixelShopBundle(),
new Happyr\GoogleAnalyticsBundle\HappyrGoogleAnalyticsBundle(),
new Http\HttplugBundle\HttplugBundle(),
//If you don't disable the analytics trackings, you will need the bundle above
);
// ...
}
}
配置
alpixel_shop:
customer_class: AppBundle\Entity\CustomEntity # A custom class extend the Alpixel\Bundle\ShopBundle\Entity\Customer class
stock:
strategy: soft #['soft', 'tolerant', 'strict']
update: false # Update stock quantity for products [true, false]
product_inheritance:
- { key: myCustomKey, class: AppBundle\Entity\CustomProduct }
use_google_analytics: true #Allow google analytics trackings with happyr bundle
捆绑包现在可以工作了
配置参考
alpixel_shop:
customer_class: AppBundle\Entity\CustomEntity
您可以通过添加自定义实体扩展 Alpixel\Bundle\ShopBundle\Entity\Customer 来添加您的属性,或者也可以直接使用 Alpixel\Bundle\ShopBundle\Entity\Customer 实体。
alpixel_shop:
stock:
strategy: soft #['soft', 'tolerant', 'strict']
库存策略选项允许您处理不同的库存管理行为。
soft: 允许订单,即使产品库存不足也允许订单 tolerant: 如果产品的当前库存 > 0,则允许订单 strict: 只有当库存有足够的数量时才允许订单