Exend Delivery Service provider and decorator
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Exend Delivery Service provider and decorator
Aimeos Laravel - 2021.04.3
Thank you for all your supports,
Currently I am trying to extend Delivery service provider and decorator
My use case is Calculating Delivery pricing Base on the Service Attributes user selected from Json api
Could you give me a guide for that?
I have some questions here:
1) How to extend
to get the user selected attributes as the
2) currently, Service proivder will call the function calcPrice before the function setConfigFE
so the code will be null due to no Attributes is add to basket service.
How could I change the order the provider execute to make the provider run setConfigFE before calcPrice
Thank you for your help!
Thank you for all your supports,
Currently I am trying to extend Delivery service provider and decorator
My use case is Calculating Delivery pricing Base on the Service Attributes user selected from Json api
Could you give me a guide for that?
I have some questions here:
1) How to extend
Code: Select all
public function calcPrice( \Aimeos\MShop\Order\Item\Base\Iface $basket ) : \Aimeos\MShop\Price\Item\Iface
to get the user selected attributes as the
Code: Select all
public function setConfigFE( \Aimeos\MShop\Order\Item\Base\Service\Iface $orderServiceItem,
array $attributes ) : \Aimeos\MShop\Order\Item\Base\Service\Iface
so the code
Code: Select all
$service = $this->getBasketService( $basket, $type, $this->getServiceItem()->getCode() );
How could I change the order the provider execute to make the provider run setConfigFE before calcPrice
Thank you for your help!
Re: Exend Delivery Service provider and decorator
my idea is extend the to get attributes as
how could I do that?
Code: Select all
public function calcPrice( \Aimeos\MShop\Order\Item\Base\Iface $basket ) : \Aimeos\MShop\Price\Item\Iface
Code: Select all
public function calcPrice( \Aimeos\MShop\Order\Item\Base\Iface $basket, array $attributes ) : \Aimeos\MShop\Price\Item\Iface
Re: Exend Delivery Service provider and decorator
Extending the signature of the calcPrice() method isn't a good idea but we can try to set the attributes first in the basket service. Do you know where the order needs to be changed?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star