Error adding php to display discount percentage on product page

This topic has 9 replies, 3 voices, and was last updated 2 years, 9 months ago ago by Cor

  • Avatar: Corrado_Lucherini
    Cor
    Participant
    February 2, 2022 at 18:32

    Hi,

    please, I added the following code in the functions.php page to be able to add the discount percentage next to the price on the product page.

    In other XStore themes (https://prnt.sc/26nie82) with the same php configurations, the code works perfectly but on this theme I get error warnings (https://prnt.sc/26nif92).

    Thanks

    Please, contact administrator
    for this information.
    8 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    February 3, 2022 at 13:58

    Hello,

    Read this post and try to improve your code https://wpsimplehacks.com/how-to-display-the-discount-percentage-on-the-sale-badge/

    Additional customization is outside the scope of our support https://themeforest.net/page/item_support_policy

    Regards

    Avatar: Corrado_Lucherini
    Cor
    Participant
    February 3, 2022 at 16:56

    Hi, thanks for your reply.

    I have tried other solutions but I think there is something in your theme that is preventing it from publishing correctly. This is because the same code applied on your other older themes responds well.

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    February 4, 2022 at 12:52

    Hello,

    Does code work ok if you try it with the default Storefront theme?

    Regards

    Avatar: Corrado_Lucherini
    Cor
    Participant
    February 4, 2022 at 16:49

    Hi,

    it works https://prnt.sc/26oq6ik

    Only when I activate the Builder (https://prnt.sc/26oq8ds) is it not visible…

    Can you help me? Please, thank you.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    February 5, 2022 at 10:07

    Hello,

    Provide URL of product and FTP access, we will check what can be done to help you.

    Regards

    Avatar: Corrado_Lucherini
    Cor
    Participant
    February 5, 2022 at 10:52

    Hi, thanks.
    Access In private content.

    Regards

    Please contact administrator
    for this information.
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    February 7, 2022 at 13:42

    Hello,

    Use etheme_woocommerce_template_single_price theme builder hook instead of woocommerce_single_product_summary.
    Check now.

    Regards

    Avatar: Corrado_Lucherini
    Cor
    Participant
    February 7, 2022 at 18:27

    Hi, thank you very much

  • Viewing 9 results - 1 through 9 (of 9 total)

The issue related to '‘Error adding php to display discount percentage on product page’' has been successfully resolved, and the topic is now closed for further responses

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.