View Single Post
  #11  
Old 08-11-2015, 06:25 PM
  seyfin's Avatar 
seyfin seyfin is offline
 

X-Cart team
  
Join Date: May 2004
Posts: 1,223
 

Default Re: Show products with variants with price lowest to highest

Quote:
Originally Posted by fiberglass.supply
final issue is how to not show on products with no variants or options. on those products it shows price lowest to highest but it not needed.

Just change the code as follows:

Code:
{if $variants} {assign var="variant_max_price" value=$product.taxed_price} {assign var="variant_min_price" value=$product.taxed_price} {foreach from=$variants item="variant_item"} {math assign="variant_max_price" equation="max(x, y)" x=$variant_max_price y=$variant_item.taxed_price} {math assign="variant_min_price" equation="min(x, y)" x=$variant_min_price y=$variant_item.taxed_price} {/foreach} Max. Price: {$variant_max_price} Min. Price: {$variant_min_price} {/if}
__________________
Sincerely yours,
Sergey Fomin
X-Cart team
Chief support group engineer

===

Check this out. Totally revamped X-Cart hosting
http://www.x-cart.com/hosting.html

Follow us:
https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart
Reply With Quote