Price Decorator no Effect?
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 28
- Joined: 10 Oct 2024, 12:51
Price Decorator no Effect?
Hello, my Decorator is not working, i dont get output or price change:
typo3conf/ext/myplugin/Resources/Private/Extensions/myextention/src/MShop/Service/Provider/Decorator/Preis.php
24.10.3 aimeos
12.4.25 typo3
typo3conf/ext/myplugin/Resources/Private/Extensions/myextention/src/MShop/Service/Provider/Decorator/Preis.php
Code: Select all
<?php
/**
* @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
* @copyright Metaways Infosystems GmbH, 2013
* @copyright Aimeos (aimeos.org), 2015-2025
* @package MShop
* @subpackage Service
*/
namespace Aimeos\MShop\Service\Provider\Decorator;
/**
* Decorator for service providers adding additional costs.
*
* @package MShop
* @subpackage Service
*/
class Preis
extends \Aimeos\MShop\Service\Provider\Decorator\Base
implements \Aimeos\MShop\Service\Provider\Decorator\Iface
{
/**
* Returns the price when using the provider.
* Usually, this is the lowest price that is available in the service item but can also be a calculated based on
* the basket content, e.g. 2% of the value as transaction cost.
*
* @param \Aimeos\MShop\Order\Item\Iface $basket Basket object
* @param array $options Selected options by customer from frontend
* @return \Aimeos\MShop\Price\Item\Iface Price item containing the price, shipping, rebate
*/
public function calcPrice( \Aimeos\MShop\Order\Item\Iface $basket, array $options = [] ) : \Aimeos\MShop\Price\Item\Iface
{
$price = $this->getProvider()->calcPrice( $basket, $options );
$price->setCosts( 1);
$price->setValue( 1);
// var_dump("fsafsa");exit;
return $price;
}
}
24.10.3 aimeos
12.4.25 typo3
Re: Price Decorator no Effect?
Did you add the decorator in the service panel of the admin backend to the delivery/payment option that is displayed?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

-
- Posts: 28
- Joined: 10 Oct 2024, 12:51
Re: Price Decorator no Effect?
Do the Decorators only work in the payment and delivery context?
I would like to return an individual unit price for a specific product based on my own height/width or m². Both in the frontend and during payment/delivery.
I would like to return an individual unit price for a specific product based on my own height/width or m². Both in the frontend and during payment/delivery.
Re: Price Decorator no Effect?
For modified product prices, create a price rule instead:
https://aimeos.org/docs/latest/providers/rules/
https://aimeos.org/docs/latest/providers/rules/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
