X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Ranged variant pricing display on products.tpl (https://forum.x-cart.com/showthread.php?t=10354)

wishbringer 11-12-2004 10:40 PM

Ranged variant pricing display on products.tpl
 
I would like to modify products.tpl (I'm using the two-column version) so that instead of displaying "Market Price" and "Our Price" and all that, instead it looks at the minimum variant price and the maximum variant price (there's four variants per product) and displays this in a range, like:

"Priced from $11 to $21"

Does anyone have an idea of how to accomplish this?

wishbringer 11-18-2004 07:58 AM

Anyone have any idea? :>

jtoth@caimen.com 12-01-2004 10:48 AM

Not really a solution, but what I did
 
I modified the products template and added a language variable to display "Priced From" instead of "Our Price" if the product has options.

It's not really a great solution, I was looking for the same thing you were, but I kept digging deeper and deeper and I was going to end up modifying files I didn't want to lose on the next upgrade process...

Here's my code: ( search for $lng.lbl_our_price for placement)

Code:

{* CAIMEN MOD - Show "Priced From" if variants are there *}
        {if $active_modules.Product_Options ne ""}{$lng.lbl_priced_from}{else}{$lng.lbl_our_price}{/if}
{* /CAIMEN MOD *}


I also added it in products_t.tpl for the featured items...

PhilJ 01-07-2005 10:45 AM

I tried...

Code:

{if $active_modules.Product_Options ne ""}
From
{/if}


...in products_t.tpl , but it displays 'from' whether the product has options or not.

I also tried...

Code:

{if $product_options ne ""}

...but that doesn't work properly either. Anyone got this to work?

sportruck 04-15-2005 01:09 PM

In customer/main/products_t.tpl, change this:

Code:

{$lng.lbl_our_price}:

To this....

Code:

{if $products[product].is_variant eq Y}{$lng.lbl_priced_from}{else}{$lng.lbl_our_price}{/if}:

Also, create the new langauge entry under Labels called lbl_priced_from and use whatever text you want, such as "Priced from" or "Starting at", or you could just enter the text in the template if you aren't using multiple languages.

pauldodman 05-15-2005 04:26 AM

Thanks for posting that bit of code - worked fine for me when I used it in products.tpl.

Was wondering though, if you use product prices including tax (VAT) how do you get the Variants to display including tax? All other prices work and when you add a product with Variants to the cart, the prices is fine, but in Variants it doesn't work???


All times are GMT -8. The time now is 10:23 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.