The product with ID "xy" may not be added directly to the shopping cart
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
The product with ID "xy" may not be added directly to the shopping cart
Hello, after updating to 21.4.4 we have the problem that products without variants can no longer be added to the cart. Do you know what could be the reason for this?
Re: The product with ID "xy" may not be added directly to the shopping cart
2021.04.x/21.4.x isn't supported any more and also 2021.10.x/21.10.x LTS will be out of regular support in the near future so you should upgrade to 2022.10.x/22.10.x LTS instead.
Check if the stock values are still associated to the products because referencing them changed from product code to product ID.
Check if the stock values are still associated to the products because referencing them changed from product code to product ID.
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: The product with ID "xy" may not be added directly to the shopping cart
Sorry, I meant 22.4.4.
$product->getListItems( 'catalog' ) is empty ->
for some reason there is no ["catalog"] part in the $product
$prodIds is empty too
$product->getListItems( 'catalog' ) is empty ->
for some reason there is no ["catalog"] part in the $product
$prodIds is empty too
Code: Select all
public function addProduct( \Aimeos\MShop\Product\Item\Iface $product, float $quantity = 1,
array $variant = [], array $config = [], array $custom = [], string $stocktype = 'default'
) : \Aimeos\Controller\Frontend\Basket\Iface
{
if( $product->getListItems( 'catalog' )->isEmpty() )
{
$context = $this->context();
$manager = \Aimeos\MShop::create( $context, 'product' );
$filter = $manager->filter(true);
$func = $filter->make( 'product:has', ['product', 'default', $product->getId()] );
$filter->add( $filter->is( $func, '!=', null ) );
$prodIds = $manager->search( $filter )->keys()->all();
if( empty( $prodIds ) || !$this->checkCategory( $prodIds ) )
{
$msg = $context->translate( 'controller/frontend', 'Adding product with ID "%1$s" is not allowed' );
throw new \Aimeos\Controller\Frontend\Basket\Exception( sprintf( $msg, $product->getId() ) );
}
}
$this->getController()->addProduct( $product, $quantity, $variant, $config, $custom, $stocktype );
return $this;
}
Re: The product with ID "xy" may not be added directly to the shopping cart
2022.04.x/22.4.x is also not supported any more, just 2022.10/22.10 LTS.
Does the products have at least one category assigned?
From where do you try to add the product? Catalog list or detail view?
Does the products have at least one category assigned?
From where do you try to add the product? Catalog list or detail view?
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: The product with ID "xy" may not be added directly to the shopping cart
Yes, but at the time we cannot update to 2022.10 because than the statistic is missing orders (viewtopic.php?f=15&t=4847&p=18974&hilit ... ies#p18974).
The Porducts have at least one category assigned. I tried to add the product in the detail view.
The Porducts have at least one category assigned. I tried to add the product in the detail view.
Re: The product with ID "xy" may not be added directly to the shopping cart
It would be better to provide more details for that problem first and then update to 2022.10 as the other problem might be solved automatically.rvhelp2 wrote: ↑17 Nov 2022, 08:50 Yes, but at the time we cannot update to 2022.10 because than the statistic is missing orders (viewtopic.php?f=15&t=4847&p=18974&hilit ... ies#p18974).
Doesn't it only work for some products or all products? Did it work before?
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: The product with ID "xy" may not be added directly to the shopping cart
For Article that are not variants. It worked before yes, but not with this version.