Jump to content

show percentage discount price

Recommended Posts

Hi, I need to see a percentage discount on the product page, but it counts me wrong.
Where am I making a mistake ?
Thank you



{if $product.discount_type === 'percentage'} <span class="badge badge-discount discount discount-percentage">-{$product.discount_percentage_absolute}</span> {else} <span style="color:#000; font-weight:600;font-size: 1.2em;"><!--{$product.discount_to_display}--> -{round(($product.price / $product.regular_price) * 100,2)} %</span> {/if}

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More