Feature: #615 - Allow FeVariant to have a price
See Issue 615
Description
The default Fe
implementation cannot have a price. In order to be able
to process own Fe
s with a price, the method arguments should use a
Fe
instead.
The Fe
extends the Fe
with a
get
method.
The price calculation of a product then takes into account whether the
Fe
implements the Fe
to add this price as
well.
To create an own Fe
for a Product
, you have to replace the
Create
EventListener.
Extcode\CartProducts\EventListener\Create\CreateCartFrontendVariants: null
MyVendor\MyExtension\EventListener\Create\CreateCartFrontendVariants:
tags:
- name: event.listener
identifier: 'cart-products--create--create-cart-frontend-variants'
event: Extcode\CartProducts\Event\RetrieveProductsFromRequestEvent
after: 'cart-products--create--load-product'
This is very flexible. You can implement Fe
s as checkboxes and add some
surcharge for some options. Another idea is to calculate the price markup
depending on the number of characters entered.How you can use this is up to you.
However, you should test carefully whether the price calculation for the product
price then fits, especially if you use more than one front-end variant with a
price for a product.
Impact
No Impact.