Repository Forums Support WooCommerce Pricing Rules PRO Product Pricing Table show Percent %

Topic Resolution: Resolved
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1231
    AJ Mallory
    Participant

    Hello,

    Is is possible to show the percent of the discount on the product pricing table that is displayed when looking at the product detail view?

    I looked through the forms here and didn’t see this addressed. I also looked in the code hoping there was a filter for this value, but I didn’t see one.

    Thanks,
    AJ

    #1247
    Soft79
    Keymaster

    I just released 1.1.0 which has limited template support.

    copy the file wp-content/plugins/soft79-wc-pricing-rules/templates/single-product/bulk-rule.php
    to:
    wp-content/themes/YOUR_CHILD_THEME/soft79-wc-pricing-rules/templates/single-product/bulk-rule.php

    I commented an example on how to calculate the discount percentage:

    $discount_perc = round( ( $row["price"] - $product->get_price() ) * 100 /  $product->get_price() ) . ' %';
    

    Then replace $row["price_html"]; by $discount_perc and you’re good to go.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.