Recent Topics

how to change product-card__badge



  • i tried,i want to show the percentage of the promotion that i am giving to the product (cart rule)

    has anyone have any good ideas



  • Hello,

    When any cart rule gets applied on the product after adding it to cart then you can get its percentage using 'discount_percent' column in 'cart_items' table.

    Thanks



  • i want it to show on the product badge



  • Hello @gayanpriyankara

    You can not apply cart rule until the product is not added in the cart but according to your requirement, you can create a catalogue rule for the same ( It is also part of promotion ).

    It is applied to the product without any delay and from haveSpecialPrice method of product type, you can get which rule is applied and can show their desired values.



  • @rahul
    am sorry my mistake i have asked the question ina wrong way
    this is the real problem

    I was trying to show the cart rule percentage or the name on the product badge so that the coustomer can see the given promotion to the product but I couldn't



  • Hi @gayanpriyankara

    You can get the applied cart rule from 'applied_cart_rule_ids' in the cart and cart_items table and can show the desired data (like name, percentage or price for discount) on product badge.


Log in to reply