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

Color coded order status...
 
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features
 
Thread Tools Search this Thread
  #21  
Old 11-07-2003, 11:38 PM
  enge919's Avatar 
enge919 enge919 is offline
 

Senior Member
  
Join Date: May 2003
Posts: 141
 

Default

OK, I got the list price to show but still not the discount. only shows -%

Heres the code I have

Code:
{* $Id: products.tpl,v 1.22 2002/11/13 07:17:54 alfiya Exp $ *} {section name=cat_num loop=$products} { if %cat_num.first% } <table border=0> <tr class=TableHead> <td>ID</td> <td>Product</td> {if $usertype eq "A" or $active_modules.Simple_Mode ne ""} <TD>Pos.</TD> {/if} <TD>Quantity</TD> <td colspan=2>List price</td> <td nowrap>Your price</td> </tr> {/if} <tr> {* START COLOR CODE MOD *} <td width=1% {include file="main/products_colors.tpl"}>#{$products[cat_num].productid}</td> <td width=99% {include file="main/products_colors.tpl"}> <input type=radio name=productid value="{ $products[cat_num].productid }" { if %cat_num.first% }checked{/if}> <a href="product_modify.php?productid={ $products[cat_num].productid }"> <font class=ItemsList>{ $products[cat_num].product|escape|truncate:35:"...":false}</font> </a> </td> {if $usertype eq "A" or $active_modules.Simple_Mode ne ""} <TD nowrap align=right {include file="main/products_colors.tpl"}><INPUT type=text size=4 maxlength=4 value="{$products[cat_num].orderby}" name="product_orderby[{$products[cat_num].productid}]"></TD> {/if} <TD nowrap align=right {include file="main/products_colors.tpl"}><INPUT type=text size=6 maxlength=6 value="{$products[cat_num].avail}" name="product_avail[{$products[cat_num].productid}]"></TD> <td nowrap align=right {include file="main/products_colors.tpl"}> {if $products[cat_num].list_price gt 0} {math equation="100-(price/lprice)*100" price=$products[cat_num].price lprice=$products[cat_num].list_price format="%d" assign=discount} <font class=ProductPriceConverting>{include file="currency.tpl" value=$products[cat_num].list_price}</font> {else} <font class=ProductPriceConverting>{include file="currency.tpl" value=$products[cat_num].price}</font> {/if} </td> <td nowrap align=right {include file="main/products_colors.tpl"}> <font class=AdvancedDiscount> -{$products[cat_num].discount}%</font> </td> <td nowrap align=right {include file="main/products_colors.tpl"}> {* END COLOR CODE MOD *} <input type="text" size="7" value="{$products[cat_num].price}" name="product_price[{$products[cat_num].productid}]"> </td> </tr> { if %cat_num.last% } </table> {/if} {/section}

This is what I actually changed (or added) in the code supplied for this mod:

Code:
{if $products[cat_num].list_price gt 0} {math equation="100-(price/lprice)*100" price=$products[cat_num].price lprice=$products[cat_num].list_price format="%d" assign=discount} <font class=ProductPriceConverting>{include file="currency.tpl" value=$products[cat_num].list_price}</font> {else} <font class=ProductPriceConverting>{include file="currency.tpl" value=$products[cat_num].price}</font> {/if}

Again, thanks in advance!
Reply With Quote
  #22  
Old 11-08-2003, 02:33 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

What version are you running? You need to put your version and server type in your forum signature. It's tough to help someone if we don't know what they are running.

Did you copy the whole products.tpl verbatim or just change the tags?

I don't understand the code you posted that you changed. It has nothing to do with this mod. We are adding smarty tags to the cell formatting by inserting the smarty include in the TD tags. That and adding the NEW AdvancedDiscount CSS.
Reply With Quote
  #23  
Old 11-08-2003, 09:48 AM
  enge919's Avatar 
enge919 enge919 is offline
 

Senior Member
  
Join Date: May 2003
Posts: 141
 

Default

I cipied the whole thing verbatim and then noticed the list price (or shop price as it showed after the change) was 0.00 and the discount was -%, being the kinda guy I am, I backed everytinhg up first and then started tearing apart code. Afterall how else do I learn?

So after copying the code verbatim and seeing the list price and discount not working, I started analyzing the original code vs. the modified code and came up with the chunk of code I included, that was in the original code.

In short, using the supplied code in 3.4.8, the list price and discount no longer came up.....hmmmmm
__________________
Web site design - Custom Programming - Upgrades - Marketing
www.netvisionwebdesign.com

Follow on twitter: http://twitter.com/netvisionweb
Become a fan on Facebook: http://www.facebook.com/pages/NetVision-Web-Design/89463493419
Reply With Quote
  #24  
Old 11-08-2003, 09:53 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Do you think it could be that you copied my 3.3.8 code and used it for your version?

If you want to implement this mod, I would recommend going into your original products file and manually adding the tags. If you were using 3.3.8 you may be able to shortcut by copying the code but across release versions it is bound to have issues.

I only provided my products code to show all of the instances where I had to add the tags.

Good Luck!
Reply With Quote
  #25  
Old 11-08-2003, 10:07 AM
  enge919's Avatar 
enge919 enge919 is offline
 

Senior Member
  
Join Date: May 2003
Posts: 141
 

Default

Nevermind......

ADVICE FOR NEWBIES that are really trying to learn how to manipulate the code in X-Cart and think it seems impossible and when you think it makes absolutely no sense do this:

Step back a minute
Take a deep breath


and...............READ THE CODE!


adpBoss, forget everything I said and did in this post. I'm getting better! I just read the code and made a couple changes and everything works just fine. Thanks to all for this mod (and the orders.tpl mod)..They make x-cart a better experience..
__________________
Web site design - Custom Programming - Upgrades - Marketing
www.netvisionwebdesign.com

Follow on twitter: http://twitter.com/netvisionweb
Become a fan on Facebook: http://www.facebook.com/pages/NetVision-Web-Design/89463493419
Reply With Quote
  #26  
Old 11-08-2003, 10:12 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

No problem.

We all have to start somewhere and trust me, staring at your cart code for hours on end will make everything seem difficult and confusing.

Sometimes going for a walk and coming back to a problem can work miracles.

Good Luck with your store!
Reply With Quote
  #27  
Old 11-10-2003, 02:57 PM
 
nfc5382 nfc5382 is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 452
 

Default

love it!!!!
Reply With Quote
  #28  
Old 11-10-2003, 10:15 PM
  BoomBoomBap's Avatar 
BoomBoomBap BoomBoomBap is offline
 

Senior Member
  
Join Date: Nov 2002
Location: San Francisco
Posts: 184
 

Default Custom order date format

Not really wanting to create a new topic for this so Im posting it in the forum that inspired me. Sweet mod in this forum I might add!

Anyhow, here's my mod:

Code:
{$orders[cat_num].date|date_format:"%h. %d, %Y - %r"}

This will display your orders in the following format:
Nov. 10, 2003 - 06:33:21 PM

Here's a useful page for further date customizations:
http://unix.about.com/library/weekly/aa042301a.htm
__________________
Site 1 > XCART LIVE 3.4.12

Site 2 > XCART LIVE 4.0.17
Reply With Quote
  #29  
Old 11-11-2003, 03:47 AM
 
magnumkp magnumkp is offline
 

eXpert
  
Join Date: Apr 2003
Location: England
Posts: 304
 

Default

Shame I missed this thread earlier. Some good mods here, makes life much easier. \
Reply With Quote
  #30  
Old 12-10-2003, 09:09 PM
 
wild boar wild boar is offline
 

Advanced Member
  
Join Date: Sep 2003
Posts: 88
 

Default

Thanks pipercub.. this makes life easier..
__________________
hi
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features


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 11:34 AM.

   

 
X-Cart forums © 2001-2018