Cart rules / vouchers throw a database exception error for products with attributes -



  • [Title and content edited after seeing different issues pop up and trying to separate them]

    I created a cart rule with a product needing to match these conditions:

    • A certain attribute
    • A certain product
    • All customer groups

    It has the action of applying the discount to the product of the attribute.

    It gives me this error:

    Unknown column ‘cp.id_product_attrbute’ in ‘on clause’

    SELECT cp.`quantity`, cp.`id_product`, pac.`id_attribute`, cp.`id_product_attribute`
    FROM `tb_cart_product` cp
    LEFT JOIN `tb_product_attribute_combination` `pac` ON cp.`id_product_attrbute` = pac.`id_product_attribute`
    WHERE (cp.`id_cart` = 481) AND (cp.`id_product` IN (70,57,41)) AND (cp.`id_product_attribute` > 0)
    


  • [Edited due to different issues popping up and confusing the tread]



  • OK, so it looks like there are two separate issues here:

    1. There is the originally reported issue of the first post.
    2. Then there is an error that vouchers weren’t working because of conditions a customer group selection.

    A friend took a look at the customer group error and he thinks the problem is:

    SELECT crg.id_cart_rule
    FROM tb_cart_rule_group crg
    WHERE (crg.id_cart_rule = 7) AND (crg.id_group = = 1) LIMIT 1

    –> the = 7 should probably be = = 7
    See https://forum.thirtybees.com/topic/1161/cart-rules-vouchers-customer-group-restrictions-throw-an-error



  • This is the error thrown by the first issue:

    Unknown column ‘cp.id_product_attrbute’ in ‘on clause’

    SELECT cp.`quantity`, cp.`id_product`, pac.`id_attribute`, cp.`id_product_attribute`
    FROM `tb_cart_product` cp
    LEFT JOIN `tb_product_attribute_combination` `pac` ON cp.`id_product_attrbute` = pac.`id_product_attribute`
    WHERE (cp.`id_cart` = 481) AND (cp.`id_product` IN (70,57,41)) AND (cp.`id_product_attribute` > 0)
    


  • Brilliant! Tested and it works!


 

Looks like your connection to thirty bees forum was lost, please wait while we try to reconnect.