X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Detailed Recommends List (https://forum.x-cart.com/showthread.php?t=6517)

salsabeel 03-01-2004 12:27 PM

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!

elmtronics 03-02-2004 12:27 PM

any update on this? I would love to see this working.

salsabeel 03-06-2004 06:49 AM

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}


carlisleglass 03-15-2004 06:34 AM

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.

MOC 03-16-2004 05:44 PM

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

shan 03-17-2004 03:37 AM

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";

:wink:

carlisleglass 03-19-2004 12:38 AM

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.


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

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.