Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When adding a product to cart via rules, the line item type always saved as 'product' even if product type is not a product.
Comment | File | Size | Author |
---|---|---|---|
#2 | add_a_product_to_cart-2876322-2.patch | 701 bytes | Anas_maw |
|
Comments
Comment #2
Anas_maw CreditAttribution: Anas_maw at Vardot commentedHere is a patch that should solve this issue.
Comment #3
jsacksick CreditAttribution: jsacksick at Centarro commentedThe function expects a line item type, not a product type...
Comment #4
Anas_maw CreditAttribution: Anas_maw at Vardot commented@jsacksick,
I think that you didn't get the idea.
When using this action to add a line item, it's always saved as line item product type in database, regardless of line item type.
Please have another look.
Thanks,
Comment #5
jsacksick CreditAttribution: jsacksick at Centarro commentedOnce again, I think you're confusing the product variation type and the line item type, which isn't the same thing...
See below:
You could have a "tshirt" product variation type with no matching line item type, in that case this logic would fail. By the way nothing prevents you from exposing a custom rules action that follows this logic if that's how your site is configured.