Adding payment option to cart
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Re: Adding payment option to cart
Just use the Aimeos namespace. Then, you don't need your workaround:
Place the class in your Aimeos extension in ./src/MShop/Service/Provider/Delivery/InfoForwarder.php
Code: Select all
namespace Aimeos\MShop\Service\Provider\Delivery
class InfoForwarder
{
}
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
Re: Adding payment option to cart
This is the thing that I wanted to avoid. And it halfway worked. The payment method became listed under the menu, but when doing the checkout itself, then it started demanding the class to be inside Aimeos namespace.aimeos wrote: ↑25 Jan 2026, 14:15 Just use the Aimeos namespace. Then, you don't need your workaround:Place the class in your Aimeos extension in ./src/MShop/Service/Provider/Delivery/InfoForwarder.phpCode: Select all
namespace Aimeos\MShop\Service\Provider\Delivery class InfoForwarder { }
But another question.
I have a code like this:
Code: Select all
/**
* Calculate delivery price using the "price" attribute
*/
public function calcPrice(\Aimeos\MShop\Order\Item\Iface $basket, array $options = []
): \Aimeos\MShop\Price\Item\Iface
{
$manager = \Aimeos\MShop::create( $this->context(), 'price' );
$price = $manager->create();
$price->setCosts( (double)($options['eabi_info_carrier.price']??0) );
return $price;
}
Also how can I make the payment "paid" or "authorized" right away at the moment of order placement?