Different delivery fees per category
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!
Different delivery fees per category
Hi Aimeos!
I would like to set a different delivery fee in one category than in the others.
How to set this up?
Thank you very much in advance for your answer!
I would like to set a different delivery fee in one category than in the others.
How to set this up?
Thank you very much in advance for your answer!
Re: Different delivery fees per category
Implement a service decorator with a calcPrice() method. There you can modify shipping costs according to the contents of the basket:
https://aimeos.org/docs/latest/provider ... ecorators/
You need to get the categories for the products in the basket because the basket contains only a condensed view of the products without categories. Use the product IDs to retrieve the categories:
https://aimeos.org/docs/latest/provider ... ecorators/
You need to get the categories for the products in the basket because the basket contains only a condensed view of the products without categories. Use the product IDs to retrieve the categories:
Code: Select all
$ids = $basket->getProducts()->getProductId()
$manager = \Aimeos\MShop::create( $this->context(), 'product' );
$filter = $manager->filter()->add( 'product.id', '==', $ids )->slice( 0, count( $ids ) );
$productItems = $manager->search( $filter, ['catalog'] );
$categories = $productItems->getRefItems( 'catalog' );
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