定制 thelia/option-module 二次开发

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

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

thelia/option-module

最新稳定版本:2.0.2

Composer 安装命令:

composer require thelia/option-module

包简介

Option module for Thelia

README 文档

README

This module allows you to manage the addition of paid options to your products.

Installation

Composer

composer require thelia/option-module:~1.0

Usage

Options closely resemble a standard Thelia product, with a price to which you can add tax rules, promotional status, an image, a description, etc.

BackOffice Configuration

From the module menu, you can: :

  • Create, modify, or delete an option
  • Assign an option to a product, category, or template

Assigning an option to a category or template will affect all linked products, making it easy to manage options and their assignment to relevant products.

Customization of Options

An option may require user input (e.g., customizing a knife with text). To achieve this, you can link an option to a Symfony form. This form inherits from the class BaseOptionFrontForm.php. The form describes all the fields necessary for adding the product to the shopping cart (in this case, the knife). The form's name should correspond to the option reference (see: getName()).

class OptionKnifeTextForm extends BaseOptionFrontForm
{
    protected function buildForm(): void
    {
        parent::buildForm();
        [...]
    }

    public static function getName():string
    {
        return 'OPTION_REF';
    }
}

Front-End Application

Two routes are available to manipulate options and products in the shopping cart.

See OpenApi doc :

GET /open_api/doc

List options for a product selling unit (pse):

GET /open_api/option/get/{pseId}

Add one or more options to a cart item :

POST /open_api/option/add/{cartItemId}

Hook

In addition to the hook to attach the menu dedicated to option management in the main backOffice menu, a hook is used to link an order product with the information provided by the option. To customize the display of this information on an invoice, you will need to override the order_product_additional_data.html template order_product_additional_data.html.

Loop

Use generic loop !

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2024-01-22