alpixel/shopbundle

此捆绑包由我们的团队用于构建电子商务网站

安装数量: 1,026

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 3

分支: 0

开放问题: 0

类型:symfony-bundle

v0.3.1 2018-04-13 14:57 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: 只有当库存有足够的数量时才允许订单