View Single Post
  #1  
Old 06-13-2004, 11:44 PM
  carlisleglass's Avatar 
carlisleglass carlisleglass is offline
 

eXpert
  
Join Date: Aug 2003
Location: Carlisle, UK
Posts: 316
 

Default Creating a 'From' price

Say you have a stock item which is available in 5 sizes, currently you would need to put the cheapest item in first and try to work out the price differences between them, which is a) confusing the admin and b) confusing to the customer. This mod will allow you to show a 'From' price for this stock item, and make all option prices absolute (бё1.99) rather than addition prices (+бё0.39).

======

Heres an example of the mod - http://shop.cglass.co.uk/customer/search.php?substring=yacht+varnish - Click on view to see the full product page with it on as well !

Firstly make sure that the 'Extra Fields' module is switched on by going into the module list and checking that a check tick is on it.

Now create a extra fields called 'From (бё)' (or literally anything you want to describe it). Also make sure its the first extra field you have, the show box is not checked, and the default value is left blank.

Now to the templates ... where the price is displayed (definantly: /customer/main/product.tpl and /customer/main/products.tpl) you will have to use the following logic to create the 'from .....' display:

Code:
{if $products[product].price eq 0 and $products[product].param00 eq ""} Call for Price {else} {if $products[product].param00 eq ""} from бё{$products[product].param00} {else} {include file="currency.tpl" value=$products[product].price} {/if} {/if}

To remove the + from the product options if its a from price, do the following change in /modules/Product_Options/customer_options.tpl
Code:
{$options[option].surcharge|value_sign:"1"}
to
Code:
{if $product.param00 eq ""}{$options[option].surcharge|value_sign:"1"}{/if}

And finally how to use this modification, when adding or modifying products.

* If the product has a set price, or if the product options is an addition to the set price, leave the 'From' box empty.
* If the product has various sizes (for example) at different prices, make the product price 0.00, put the cheapest item price in the From box and then put the product options as their actual price.
__________________
Darren Kierman
Carlisle Glass (http://www.carlisleglass.co.uk/)
... running X-Cart Gold 4.4.5 [unix]
Reply With Quote