View Single Post
  #10  
Old 08-08-2003, 11:39 AM
 
slimmedia slimmedia is offline
 

Member
  
Join Date: May 2003
Posts: 23
 

Default

This has been a peeve of mine in the way x-cart works for a long time. The way x-cart does pricing makes a lot of sense for a store that offers all of it's products at a discount off of retail prices. It doesn't make much sense for a store that sets its own regular prices, and occasionally puts things on sale.

Even if you make edits to the languages variables, there are still stupid things like it displaying a 0% discount.

Let's say you have an item setup with the regular price of $25.00 inputted as the price, and you leave the list price blank (0.00). Everything looks fine.

Then you want to put it on sale. You go to the admin area, go to "modify product" and you do a search. The product appears in a list, possibly with others. It shows that the "list price" is $25.00 and "your price" is $25.00. So far so good. It has a nice text box for you to edit the "your price" so that you don't have to go two clicks further to the modify product screen. This is especially nice if you want to put a number of products on sale.

So, you change the "your price" to $20.00 and hit "update". Now the "your price" is $20.00 , but the "list price" is also $20.00 . So then you have to go into the modify screen for that product and input the list price of $25.00. Now everything's fixed, just the way you wanted it: It's list price is $25.00, it's price is $20.00 it shows that it's at a 20% discount .

So then you want to take the product off sale, back to regular price. You go to the modify product area, do a search, change the price back to $25.00 and click update. Now the list price is $25.00 and the price is $25.00 , but it shows that the product has a 0% discount . So again, you have to go into the individual product's information to change the list price back to 0.00 (or blank).

After dealing with this for a while, I took matters into my own hands. I set all my prices to have the same "list price" as the "price" then I made it display the way I want by editing the templates. Now I can go and put a bunch of products on sale right from the search page.

In order to make it work I made changes to '/skin1/customer/main/products.tpl'. I replaced the pricing logic with the following:

Code:
{if $products[product].price ne 0} {if $products[product].list_price ne $products[product].price and $products[product].list_price gt 0} {math equation="100-(price/lprice)*100" price=$products[product].price lprice=$products[product].list_price format="%d" assign=discount} <font class="MarketPrice">{$lng.lbl_market_price}: <s>{include file="currency.tpl" value=$products[product].list_price}</s></font> <font class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].price}</font><font class="MarketPrice">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].price}</font> (save {$discount}%) {else} <font class="ProductPrice">{include file="currency.tpl" value=$products[product].price}</font> {/if} {if $config.Taxes.use_vat eq "Y" and $products[product].vat gt "0"}, {$lng.lbl_including_vat} {$products[product].vat}%{/if} {else} <font class="ProductPrice">{$lng.lbl_enter_your_price}</font> {/if} {/if}

I also used the same logic in '/skin1/customer/main/product.tpl' to make sure that the "save money" graphic didn't display showing a 0% discount.

Product on sale BEFORE :
Quote:
Regular price: $25.00
Now: $20.00 (save 20%)

Product at regular price BEFORE :
Quote:
Regular price: $25.00
Now: $25.00 (save 0%)

Product on sale AFTER :
Quote:
Regular price: $25.00
Now: $20.00 (save 20%)

Product at regular price AFTER :
Quote:
$25.00
Reply With Quote