# Custom Added Product to Cart Not Triggering Promotions

**URL:** <https://forum.shopware.com/t/custom-added-product-to-cart-not-triggering-promotions/106027>\
**Category:** Programming (EN)\
**Tags:** programming\
**Created:** [3. Dezember 2024 um 15:08 UTC](https://forum.shopware.com/t/custom-added-product-to-cart-not-triggering-promotions/106027 "2024-12-03T15:08:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakub.g](https://avatars.discourse-cdn.com/v4/letter/j/f1d935/32.png) [@jakub.g](https://forum.shopware.com/u/jakub.g)\
**Post date:** [3. Dezember 2024 um 15:08 UTC](https://forum.shopware.com/t/custom-added-product-to-cart-not-triggering-promotions/106027/1 "2024-12-03T15:08:52Z")

</div>

Hi everyone,

I’m currently working on a custom plugin for Shopware, and I’ve run into an issue regarding promotions in the cart. Here’s the situation:

When I add a product to the cart programmatically (using custom logic in my plugin: ), the product does not trigger any active promotions. However, if I then add a product to the cart using the standard Shopware process, the promotion starts to apply — not only to the newly added product but also to the product that was initially added via my custom method.

This suggests that my custom-added product is missing something essential for the promotion to work right away.

It’s worth mentioning that there are no errors during the process — neither when adding the product to the cart via my custom logic nor when setting up or applying the promotions themselves.

Has anyone encountered a similar issue? Are there any specific services, events, or methods that I might need to call to ensure that promotions are applied properly to custom-added products?

I’d appreciate any insights or suggestions on how to resolve this. Thanks in advance!

Here is code with my custom logic:

```auto
  $lineItem = $this->factory->create([
                    'type' => LineItem::PRODUCT_LINE_ITEM_TYPE,
                    'referencedId' => $variationId,
                    'quantity' => 1,
                    'payload' => [
                        'customPayload' => 'myCustomPayload',
                        'index' => $index,
                    ],
                ], $context);

                $lineItem->setStackable(false);

                $this->cartService->add($cart, $lineItem, $context);

```

Best regards,
