"setLocale.after" event not working for my plugin
Posted: 21 Sep 2022, 13:07
Aimeos 2021.x, php7.4
Hello. I'm create new plugin for basket. It changes the amount according to the client's logic.
The plugin fires in all necessary events. But if I change the language or currency, the cart amount is not recalculated. Can you help me figure it out?
Hello. I'm create new plugin for basket. It changes the amount according to the client's logic.
Code: Select all
class TenthFree
extends \Aimeos\MShop\Plugin\Provider\Factory\Base
implements \Aimeos\MShop\Plugin\Provider\Iface, \Aimeos\MShop\Plugin\Provider\Factory\Iface
{
public function register( \Aimeos\MW\Observer\Publisher\Iface $p ) : \Aimeos\MW\Observer\Listener\Iface
{
$plugin = $this->getObject();
$p->attach( $plugin, 'addProduct.after' );
$p->attach( $plugin, 'deleteProduct.after' );
$p->attach( $plugin, 'setProducts.after' );
$p->attach( $plugin, 'addCoupon.after' );
$p->attach( $plugin, 'deleteCoupon.after' );
$p->attach( $plugin, 'setOrder.before' );
$p->attach( $plugin, 'setLocale.before' );
$p->attach( $plugin, 'setLocale.after' );
return $this;
}
......
}