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

Detailed Recommends List

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 03-01-2004, 12:27 PM
 
salsabeel salsabeel is offline
 

Senior Member
  
Join Date: Jan 2004
Posts: 132
 

Default Detailed Recommends List

I am almost finished with a custom mod that shows details of the products that show up under the Recommends List. I only have one problem, which I hope you all can help me with, and that is I am unable to get it to display the price. Instead it says: "Enter your price !" as if the products have no prices. The description, product title, and image thumbnail works though. Here is the code:

Code:
{* $Id: recommends.tpl,v 1.3 2004/03/01 16:26:00 salsabeel Exp $ *} {if $recommends} {capture name=recommends} {section name=num loop=3} <table border=0 width=100%> <tr><td width=90 align=center valign=top> <a href=product.php?productid={$recommends[num].productid}&cat={$cat}&page={$navigation_page}>{include file="product_thumbnail.tpl" productid=$recommends[num].productid image_x=$config.Appearance.thumbnail_width product=$recommends[num].product tmbn_url=$recommends[num].tmbn_url} {$lng.lbl_see_details}</a> </td> <td valign=top> {$recommends[num].product}</font> <font size=1> {$recommends[num].descr|truncate:300:"...":true} </font> <hr size=1 noshade width=230 align=left> {if $recommends[num].product_type eq "C"} <font class="FormButton">{$lng.lbl_details} {include file="buttons/go.tpl"}</font> {else} {if $active_modules.Subscriptions ne "" and $recommends[num].catalogprice} {include file="modules/Subscriptions/subscription_info_inlist.tpl"} {else} {if $recommends[num].price ne 0} {if $recommends[num].list_price gt 0 and $recommends[num].price lt $recommends[num].list_price} {math equation="100-(price/lprice)*100" price=$recommends[num].price lprice=$recommends[num].list_price format="%d" assign=discount} <font class=MarketPrice>{$lng.lbl_market_price}: <s>{include file="currency.tpl" value=$recommends[num].list_price}</s></font> {/if} <font class=ProductPrice>{$lng.lbl_our_price}: {include file="currency.tpl" value=$recommends[num].price}</font> <font class=MarketPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$recommends[num].price}</font> {if $recommends[num].list_price gt 0 and $recommends[num].price lt $recommends[num].list_price}, {$lng.lbl_save} {$discount}%{/if} {if $config.Taxes.use_vat eq "Y" and $recommends[num].vat gt "0"}, {$lng.lbl_including_vat} {$recommends[num].vat}%{/if} {else} <font class=ProductPrice>{$lng.lbl_enter_your_price}</font> {/if} </td> <td colspan="3" align="right" valign=center> {if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"} {include file="customer/main/buy_now.tpl" product=$recommends[num]} {/if}{/if} {/if} </td></tr> </table> {/section} {/capture} {include file="dialog.tpl" title=$lng.lbl_recommends content=$smarty.capture.recommends extra="width=100%"}{/if}

Thanks in advanced!
Reply With Quote
  #2  
Old 03-02-2004, 12:27 PM
 
elmtronics elmtronics is offline
 

Advanced Member
  
Join Date: Aug 2003
Posts: 59
 

Default

any update on this? I would love to see this working.
__________________
X-Cart version 3.5.11live
php ver 4.3.7
Reply With Quote
  #3  
Old 03-06-2004, 06:49 AM
 
salsabeel salsabeel is offline
 

Senior Member
  
Join Date: Jan 2004
Posts: 132
 

Default

Does anyone know? I'm pretty sure it has to do with the following part:

Code:
{if $recommends[num].price ne 0} {if $recommends[num].list_price gt 0 and $recommends[num].price lt $recommends[num].list_price} {math equation="100-(price/lprice)*100" price=$recommends[num].price lprice=$recommends[num].list_price format="%d" assign=discount} <font class=MarketPrice>{$lng.lbl_market_price}: <s>{include file="currency.tpl" value=$recommends[num].list_price}</s></font> {/if} <font class=ProductPrice>{$lng.lbl_our_price}: {include file="currency.tpl" value=$recommends[num].price}</font> <font class=MarketPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$recommends[num].price}</font> {if $recommends[num].list_price gt 0 and $recommends[num].price lt $recommends[num].list_price}, {$lng.lbl_save} {$discount}%{/if} {if $config.Taxes.use_vat eq "Y" and $recommends[num].vat gt "0"}, {$lng.lbl_including_vat} {$recommends[num].vat}%{/if} {else} <font class=ProductPrice>{$lng.lbl_enter_your_price}</font> {/if} </td> <td colspan="3" align="right" valign=center> {if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"} {include file="customer/main/buy_now.tpl" product=$recommends[num]} {/if}{/if} {/if}
Reply With Quote
  #4  
Old 03-15-2004, 06:34 AM
  carlisleglass's Avatar 
carlisleglass carlisleglass is offline
 

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

Default

the problem lies in the xcart source code itself - which doesn't grab the price out of the database. If you want this to work you will have to go further than just the templates.
__________________
Darren Kierman
Carlisle Glass (http://www.carlisleglass.co.uk/)
... running X-Cart Gold 4.4.5 [unix]
Reply With Quote
  #5  
Old 03-16-2004, 05:44 PM
 
MOC MOC is offline
 

Senior Member
  
Join Date: Oct 2002
Posts: 171
 

Default

Im sorry, but i cant believe that what you said.

Everything can displayed, so it has to be a way to display the price of the recommended product. If you want to display the list price, this works. In case it has to be way for displaying the actual price, too
Reply With Quote
  #6  
Old 03-17-2004, 03:37 AM
  shan's Avatar 
shan shan is offline
 

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

Default

if you use the debug window and alter the smarty.php file as below you will see all active variables

find

Code:
$smarty->debug_tpl="file:debug_templates.tpl";

change to

Code:
$smarty->debug_tpl="file:debug.tpl";

__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #7  
Old 03-19-2004, 12:38 AM
  carlisleglass's Avatar 
carlisleglass carlisleglass is offline
 

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

Default

Quote:
Originally Posted by MOC
Im sorry, but i cant believe that what you said.

Everything can displayed, so it has to be a way to display the price of the recommended product. If you want to display the list price, this works. In case it has to be way for displaying the actual price, too

theres a sql select statement in the php coding which doesn't grab the price - hence the templates see the price as 0 - (enter your price!).

You have to remember that the list price is just one figure. The selling price can be different for different type of customers, and unforently this is not in the recommend products coding.
__________________
Darren Kierman
Carlisle Glass (http://www.carlisleglass.co.uk/)
... running X-Cart Gold 4.4.5 [unix]
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 05:09 AM.

   

 
X-Cart forums © 2001-2020