定制 monsieurbiz/sylius-advanced-option-plugin 二次开发

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

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

monsieurbiz/sylius-advanced-option-plugin

Composer 安装命令:

composer require monsieurbiz/sylius-advanced-option-plugin

包简介

This plugins improves the Product Options.

README 文档

README

Banner of Sylius Advanced Option plugin

Advanced Option

Advanced Option Plugin license Tests Status Recipe Status Security Status

This plugins improves the Options in Sylius. It adds the possibility to select a renderer and to add images to the option's values.

Compatibility

Sylius Version PHP Version
1.12 8.1 - 8.2 - 8.3
1.13 8.1 - 8.2 - 8.3
1.14 8.1 - 8.2 - 8.3

Installation

If you want to use our recipes, you can configure your composer.json by running:

composer config --no-plugins --json extra.symfony.endpoint '["https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master","flex://defaults"]'
composer require monsieurbiz/sylius-advanced-option-plugin

Change your config/bundles.php file to add this line for the plugin declaration:

<?php

return [
    //..
    MonsieurBiz\SyliusAdvancedOptionPlugin\MonsieurBizSyliusAdvancedOptionPlugin::class => ['all' => true],
];

Then create the config file in config/packages/monsieurbiz_sylius_advanced_option_plugin.yaml:

imports:
    - { resource: "@MonsieurBizSyliusAdvancedOptionPlugin/Resources/config/config.yaml" }

And create the route file in config/routes/monsieurbiz_sylius_advanced_option_plugin.yaml:

monsieurbiz_advanced_option_admin:
    resource: "@MonsieurBizSyliusAdvancedOptionPlugin/Resources/config/routing/admin.yaml"
    prefix: /%sylius_admin.path_name%

Copy the templates we override:

cp -Rv vendor/monsieurbiz/sylius-advanced-option-plugin/src/Resources/templates/* templates/

Your ProductOption entity needs to implement the RenderedOptionInterface interface and use the MonsieurBiz\SyliusAdvancedOptionPlugin\Entity\ProductOption\RenderedOptionTrait trait. As in our test application: ProductOption.

Your ProductOptionValue entity needs to implement the RenderedOptionValueInterface interface and use the MonsieurBiz\SyliusAdvancedOptionPlugin\Entity\ProductOption\RenderedOptionValueTrait trait. As in our test application: ProductOption.

Migrations

Migrations are taken care of by Doctrine 3.

You should just run them:

bin/console doctrine:migrations:migrate

Template override

If you have already replaced the templates/bundles/SyliusShopBundle/Product/Show/_options.html.twig template in your theme, modify the content to use the twig functions:

  • monsieurbiz_advancedoption_has_renderer
  • monsieurbiz_advancedoption_form_row

Read the default override to get inspiration from its content: _options.html.twig.

Sponsors

  • EasyMonneret

Contributing

You can open an issue or a Pull Request if you want! 😘
Thank you!

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 4
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-12-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固