Adding payment option to cart

How to configure and adapt Aimeos based shops as developer
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!
User avatar
aimeos
Administrator
Posts: 8714
Joined: 01 Jan 1970, 00:00

Re: Adding payment option to cart

Post by aimeos » 25 Jan 2026, 14:15

Just use the Aimeos namespace. Then, you don't need your workaround:

Code: Select all

namespace Aimeos\MShop\Service\Provider\Delivery

class InfoForwarder
{
}
Place the class in your Aimeos extension in ./src/MShop/Service/Provider/Delivery/InfoForwarder.php
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
matish
Posts: 43
Joined: 04 Nov 2025, 11:52

Re: Adding payment option to cart

Post by matish » 28 Jan 2026, 16:24

aimeos wrote: 25 Jan 2026, 14:15 Just use the Aimeos namespace. Then, you don't need your workaround:

Code: Select all

namespace Aimeos\MShop\Service\Provider\Delivery

class InfoForwarder
{
}
Place the class in your Aimeos extension in ./src/MShop/Service/Provider/Delivery/InfoForwarder.php
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.

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;
    }

It works, but it does not account any taxes. How can I make the shpping/payment method to include taxes in the cost?
Also how can I make the payment "paid" or "authorized" right away at the moment of order placement?

Post Reply