定制 mw-cms/ecommerce-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mw-cms/ecommerce-bundle

Composer 安装命令:

composer require mw-cms/ecommerce-bundle

包简介

Ecommerce bundle based on sylius

README 文档

README

Installation

AppKernel.php

Please register the bundle before DoctrineBundle. This is important as we use listeners which have to be processed first.

public function registerBundles()
{
    $bundles = [
            new FOS\RestBundle\FOSRestBundle(),
            new JMS\SerializerBundle\JMSSerializerBundle($this),
            new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
            new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
            new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(),
            new Sylius\Bundle\LocaleBundle\SyliusLocaleBundle(),
            new Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(),
            new Sylius\Bundle\ProductBundle\SyliusProductBundle(),
            new Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(),
            new Sylius\Bundle\TaxonomyBundle\SyliusTaxonomyBundle(),
            new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(),
            new AWEcommerceBundle\AWEcommerceBundle(),
            new Misd\PhoneNumberBundle\MisdPhoneNumberBundle()
            new Knp\Bundle\SnappyBundle\KnpSnappyBundle(),

            // Other bundles...
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
    ];
}

Entities

Create this entities and give them a Table name

  • AppBundle\Entity\Ecommerce\Address extends AWEcommerceBundle\Entity\Address
  • AppBundle\Entity\Ecommerce\Customer extends AWEcommerceBundle\Entity\Customer
  • AppBundle\Entity\Ecommerce\CustomerGroup extends AWEcommerceBundle\Entity\CustomerGroup
  • AppBundle\Entity\Ecommerce\Order extends AWEcommerceBundle\Entity\Order
  • AppBundle\Entity\Ecommerce\OrderItem extends AWEcommerceBundle\Entity\OrderItem
  • AppBundle\Entity\Ecommerce\ProductCustom extends AWEcommerceBundle\Entity\Product
  • AppBundle\Entity\Ecommerce\ProductVariantCustom extends AWEcommerceBundle\Entity\ProductVariant
  • AppBundle\Entity\Ecommerce\Promotion extends AWEcommerceBundle\Entity\Promotion
  • AppBundle\Entity\Ecommerce\SponsorPromotion extends AWEcommerceBundle\Entity\SponsorPromotion

SQL

Run this queries to add the elements:

INSERT INTO modules (name, enabled, has_element, position, bundle) VALUES 
('ecommerce', 1, 0, 0, 'AWEcommerceBundle'),
('productList', 1, 1, 30, 'AWEcommerceBundle'),
('ecommerceHeader', 1, 1, 32, 'AWEcommerceBundle')

routing.yml

aw_ec:
    resource: "@AWEcommerceBundle/Controller/Admin"
    type:     annotation
    prefix:   /admin/ecommerce

config.yml

obligatoire:

aw_ec:
    address:

for the shipping methods you have to define a service that uses the interface AWEcommerceBundle\Service\Shipping\ShippingInterface and as key use the same that returns the method "getShippingServiceName"

optionnel:

aw_ec:
    address:
        class: AppBundle\Entity\Ecommerce\Address
        form: AppBundle\Form\Shipping\AddressType
    available_shipping_services:
        sendCloud: 'aw_studio.shipping.connector.send_cloud'
        personalized: AWEcommerceBundle\Service\Shipping\PersonalizedShippingService
    available_payment_methods:
        stripe: 'aw.ec.payment_stripe_manager'

Based on sylius :

  • SyliusProductBundle
  • SyliusTaxationBundle
  • SyliusAttributeBundle

Configuration reference

sylius_product:
    driver: doctrine/orm
    resources:
        product:
            classes:
                model: Sylius\Component\Core\Model\Product
                repository: Sylius\Bundle\CoreBundle\Doctrine\ORM\ProductRepository
                form: Sylius\Bundle\CoreBundle\Form\Type\Product\ProductType
                interface: Sylius\Component\Product\Model\ProductInterface
                controller: Sylius\Bundle\ResourceBundle\Controller\ResourceController
                factory: Sylius\Component\Product\Factory\ProductFactory
            translation:
                classes:
                    model: Sylius\Component\Core\Model\ProductTranslation
                    form: Sylius\Bundle\CoreBundle\Form\Type\Product\ProductTranslationType
                    interface: Sylius\Component\Product\Model\ProductTranslationInterface
                    controller: Sylius\Bundle\ResourceBundle\Controller\ResourceController
                    factory: Sylius\Component\Resource\Factory\Factory
        product_variant:
            classes:
                model: Sylius\Component\Core\Model\ProductVariant
                repository: Sylius\Bundle\ProductBundle\Doctrine\ORM\ProductVariantRepository
                form: Sylius\Bundle\CoreBundle\Form\Type\Product\ProductVariantType
                interface: Sylius\Component\Product\Model\ProductVariantInterface
                controller: Sylius\Bundle\ResourceBundle\Controller\ResourceController
                factory: Sylius\Component\Product\Factory\ProductVariantFactory
        product_option:
            classes:
                repository: Sylius\Bundle\ProductBundle\Doctrine\ORM\ProductOptionRepository
                model: Sylius\Component\Product\Model\ProductOption
                interface: Sylius\Component\Product\Model\ProductOptionInterface
                controller: Sylius\Bundle\ResourceBundle\Controller\ResourceController
                factory: Sylius\Component\Resource\Factory\TranslatableFactory
                form: Sylius\Bundle\ProductBundle\Form\Type\ProductOptionType
            translation:
                classes:
                    model: Sylius\Component\Product\Model\ProductOptionTranslation
                    interface: Sylius\Component\Product\Model\ProductOptionTranslationInterface
                    controller: Sylius\Bundle\ResourceBundle\Controller\ResourceController
                    factory: Sylius\Component\Resource\Factory\Factory
                    form: Sylius\Bundle\ProductBundle\Form\Type\ProductOptionTranslationType
        product_option_value:
            classes:
                model: Sylius\Component\Product\Model\ProductOptionValue
                interface: Sylius\Component\Product\Model\ProductOptionValueInterface
                controller: Sylius\Bundle\ResourceBundle\Controller\ResourceController
                factory: Sylius\Component\Resource\Factory\TranslatableFactory
                form: Sylius\Bundle\ProductBundle\Form\Type\ProductOptionValueType
            translation:
                classes:
                    model: Sylius\Component\Product\Model\ProductOptionValueTranslation
                    interface: Sylius\Component\Product\Model\ProductOptionValueTranslationInterface
                    controller: Sylius\Bundle\ResourceBundle\Controller\ResourceController
                    factory: Sylius\Component\Resource\Factory\Factory
                    form: Sylius\Bundle\ProductBundle\Form\Type\ProductOptionValueTranslationType
        product_association:
            classes:
                model: Sylius\Component\Product\Model\ProductAssociation
                interface: Sylius\Component\Product\Model\ProductAssociationInterface
                controller: Sylius\Bundle\ResourceBundle\Controller\ResourceController
                factory: Sylius\Component\Resource\Factory\Factory
                form: Sylius\Bundle\ProductBundle\Form\Type\ProductAssociationType
        product_association_type:
            classes:
                model: Sylius\Component\Product\Model\ProductAssociationType
                interface: Sylius\Component\Product\Model\ProductAssociationTypeInterface
                controller: Sylius\Bundle\ResourceBundle\Controller\ResourceController
                factory: Sylius\Component\Resource\Factory\Factory
                form: Sylius\Bundle\ProductBundle\Form\Type\ProductAssociationTypeType

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-12