Decorator process method not working correctly
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!
Decorator process method not working correctly
I have a code. Code below line:
not working correctly. For example remove product from cart not working.
Code: Select all
$this->getClient()->process();
Code: Select all
class BasketDecorator extends \Aimeos\Client\Html\Common\Decorator\Base implements \Aimeos\Client\Html\Common\Decorator\Iface
{
public function process()
{
try {
$context = $this->getContext();
if (Request::input('b_action') === 'add') {
\Aimeos\Controller\Frontend::create($context, 'basket')->clear();
}
} catch (\Exception $ex) {
}
$this->getClient()->process();
$cardType = Session::get('card_type');
if (empty($cardType)) {
header('Location: /shop');
die;
}
$count = \Aimeos\Controller\Frontend::create($context, 'basket')->get()->getProducts()->count();
if ($count > 0) {
header('Location: /shop/checkout/onepage');
die;
} else {
header('Location: /shop');
die;
}
}
}
Re: Decorator process method not working correctly
Did you configure your decorator so it will be used? Check if the code is executed at all.
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
Re: Decorator process method not working correctly
Aimeos
I want to execute all base operations of basket and then my code in decorator but not working correctly
I want to execute all base operations of basket and then my code in decorator but not working correctly
Re: Decorator process method not working correctly
You didn't answer any of our questions ...
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
Re: Decorator process method not working correctly
Yes, I configured it. I check this code. The code is executing.
Re: Decorator process method not working correctly
If you want to execute the basket process() method first, you need to call "$this->getClient()->process();" as first statement in the process() method of your decorator.
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
Re: Decorator process method not working correctly
That's exactly what I do but not working correctly.