Search found 5 matches
- 25 Aug 2024, 10:34
- Forum: Help
- Topic: Set a custom price for a product when added to cart
- Replies: 9
- Views: 9348
Re: Set a custom price for a product when added to cart
First product added (14.64 €): Log after second product added (13.21 €): [2024-08-25 10:33:09] local.DEBUG: Aimeos\MShop\Order\Item\Product\Standard Object ( [available:protected] => 1 [modified:protected] => 1 [bprefix:protected] => order.product. [type:protected] => [bdata:protected] => Array ( [o...
- 22 Aug 2024, 09:18
- Forum: Help
- Topic: Set a custom price for a product when added to cart
- Replies: 9
- Views: 9348
Re: Set a custom price for a product when added to cart
Hi, it was the original solution, but it gives me the same result. public function update(\Aimeos\MShop\Order\Item\Iface $p, string $action, $value = null) { if ($value['order.product.prodcode'] == Config::get('shop.adesivi.product_name')) { $price = $value->getPrice(); $price->setValue(12.26); $val...
- 20 Aug 2024, 14:34
- Forum: Help
- Topic: Set a custom price for a product when added to cart
- Replies: 9
- Views: 9348
Re: Set a custom price for a product when added to cart
Thanks for the advice not to mix the code, I will fix it later. The problem is that the price I calculate is applied to ALL the products of the same type that are in the cart. I am trying to apply it only to the last insert, but it does not work: public function update(\Aimeos\MShop\Order\Item\Iface...
- 20 Aug 2024, 10:32
- Forum: Help
- Topic: Set a custom price for a product when added to cart
- Replies: 9
- Views: 9348
Re: Set a custom price for a product when added to cart
The thing is that the price depends on a calculation made by the software based on the area of the sticker (which in turn depends on the font and the length of the written text). https://www.emanuelefantin.it/assets/tmp/img-3.jpg So I don't have a parameter that determines the price based on somet...
- 20 Aug 2024, 09:58
- Forum: Help
- Topic: Set a custom price for a product when added to cart
- Replies: 9
- Views: 9348
Set a custom price for a product when added to cart
Hi, I created a "custom sticker" product that has several attributes (color, font, size) that contribute to the price calculation. So for example a 20x50 cm product costs €10 a 30x70 product costs €12. I then created a plugin that is called at the addProduct.before event, here is the simpl...