Is it possible to still show that an item is on sale while using the dynamic product variable for store_product_price?

Here is what I am trying to do:

{if on_sale}{regular_price}{sale_price}{if:else}{price}{/if}

When I use the above code, it ONLY shows the sale price, but I'd still like it to show the regular price crossed out.

Am I missing something?

1 Answer 1


You should be able to do something along the lines of:

{if on_sale}
  Price: <del>{regular_price}</del> 
   Price: {price}


If you want to use the dynamic price variables you would need to do something slightly different in this case then putting the css class on the h2 element. Something along the lines of this to only show the regular price if the item is on sale.

  Price: {if on_sale}<del>{regular_price}</del>{/if} 
  <span class="store_product_price">{price}</span>.   
  • Hi Justin. That is what I am doing now, but it only shows the sale price, never the regular crossed out. Here is exactly what I have in my template... <h2 class="store_product_price"> {if on_sale}Price: <del>{regular_price}</del> {price}. {if:else} Price: {price} {/if} </h2> Nov 8, 2013 at 22:26
  • Aww sorry I somehow missed the you were using the dynamic variables (rereading the initial question I am not quite sure how I did that. The short answer is if you want to show both sale and regular price you can't use the dynamic variable. Nov 9, 2013 at 0:21
  • The content that you enter inside of whatever element you put as the dynamic variable is a fallback when CSS/JS are disabled and under most circumstances won't be displayed to the user. Nov 9, 2013 at 7:03
  • Is there a work around? I'd still like the price to dynamically update AND show that the items in on sale. Thx Justin. Nov 10, 2013 at 20:34
  • The only work around that I know of at the moment would be to use something similar to the code under Edit 1 or for you to extend the store js to also handle sale price. Nov 11, 2013 at 5:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.