Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

make "save x%" icon conditional?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 08-04-2003, 08:45 AM
 
jfreed jfreed is offline
 

Newbie
  
Join Date: Aug 2003
Posts: 4
 

Default make "save x%" icon conditional?

I like the "save x%" in the product list and the nice icon on the detail page. It looks lame, however, when there is no discount!!

I wonder if anyone has made a fix to make that conditional?

While your at it, I'd like to be able to show Marketprice crossed out on product detail pages too.

I find smartys to be incredibly painful -- it's like learning *another* language and I've barely got html figured out.



Environment components info:
Component Status б═
X-Cart version 3.4.4 б═
PHP 4.3.2 details >>
Console PHP (cli) 4.1.2 б═
MySQL server 3.23.56 б═
Web server Apache б═
Operation system Linux б═
Perl 5.006001 details >>
Net::SSLeay not found б═
libCURL not found б═
CURL executable curl 7.9.5 (i386-redhat-linux-gnu) libcurl 7.9.5 (OpenSSL 0.9.6b) (ipv6 enabled) б═
Magic quotes (magic_quotes_gpc) enabled
Reply With Quote
  #2  
Old 08-04-2003, 08:53 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

It shouldnt show when there is no discount anyway
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 08-04-2003, 09:11 AM
 
jfreed jfreed is offline
 

Newbie
  
Join Date: Aug 2003
Posts: 4
 

Default maybe it *shouldn't* but....

Here is an example:

http://www.6seconds.org/xcart/customer/product.php?productid=66&cat=1&page=1


Maybe there is a template I messed up?? But I did almost nothing to templates ('cause like I said, smartys just kills me)
-J
Reply With Quote
  #4  
Old 08-04-2003, 09:20 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

look at skin1/customer/product.tpl

there may be a problem there. try and restore the template
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #5  
Old 08-04-2003, 09:34 AM
 
jfreed jfreed is offline
 

Newbie
  
Join Date: Aug 2003
Posts: 4
 

Default no love

I had not changed, but re-uploaded anyway, and no dif.

I see in the template the part that should be doing this if:

Quote:
{if $product.list_price gt 0}<table border=0 width=60><tr><td width=55 height=56 class="SaveMoneyLabel" background="{$ImagesDir}/save_money.gif" align=center valign=middle>


{math equation="100-(price/lprice)*100" price=$product.price lprice=$product.list_price format="%d" assign=discount}
{ $discount }%
</td></tr></table>{/if}

But it does not look like it checks to see if price<lprice....

The only template I changed is "powered by" -- I tried changing the help menu too, but failed...
Reply With Quote
  #6  
Old 08-08-2003, 05:32 AM
 
ocabj ocabj is offline
 

Newbie
  
Join Date: Jul 2003
Posts: 3
 

Default

I also want to get rid of the "Save 0%" icon in the Product Details listing. X-Cart still displays it if there is no discount.
Reply With Quote
  #7  
Old 08-08-2003, 06:13 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

Did you fill in both market price and price.

If they are the same then it will show o% discount

Just fill in your price and NOT market price if there is no discount
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #8  
Old 08-08-2003, 07:58 AM
 
ocabj ocabj is offline
 

Newbie
  
Join Date: Jul 2003
Posts: 3
 

Default

Ah, thanks for the tip. Looks good now.
Reply With Quote
  #9  
Old 08-08-2003, 08:20 AM
 
jfreed jfreed is offline
 

Newbie
  
Join Date: Aug 2003
Posts: 4
 

Default Yea! :D

That worked for me too!!!

I guess I could have thought of trying that -- somehow not obvious to me.



Thanks for the help!
Reply With Quote
  #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
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:43 PM.

   

 
X-Cart forums © 2001-2020