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

How to display the price for products in the recommends list

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 12-12-2004, 12:13 AM
 
shwekhaw shwekhaw is offline
 

Senior Member
  
Join Date: Nov 2004
Posts: 148
 

Default

Hi BCSE:
I tried your codes in x-cart 4.0.7. I can see the price next to recommended product names but the price does not match to the product. It seems to me that prices are randomly listed next to product.
PHP codes are beyond my knowledge. Any chance you can fix it for 4.0.7?

Thanks.
S-H-W-E-K-H-A-W
__________________
X-Cart Gold Plus 4.5.5
Checkout ONE
Checkout ONE DPM
BCSE CIM
Apache
Linux
Reply With Quote
  #12  
Old 12-14-2004, 11:54 AM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,091
 

Default

I just tested the above code in 4.0.4 and it's showing the right price. Perhaps you inserted the php code in the wrong place?

For 4.0.4 I inserted it into recommends.php (in x-cart directory) after this code:
Code:
if ($config["Modules"]["select_recommends_list_randomly"] == "Y" && count($query_ids)>0) { $query = "SELECT $sql_tbl[products].*, $lng_fields FROM $sql_tbl[products] LEFT JOIN $sql_tbl[products_lng] ON $sql_tbl[products].productid=$sql_tbl[products_lng].productid $lng_condition WHERE $sql_tbl[products].productid IN ('".join("','",$query_ids)."')";

See if that helps!

Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #13  
Old 12-14-2004, 01:09 PM
 
shwekhaw shwekhaw is offline
 

Senior Member
  
Join Date: Nov 2004
Posts: 148
 

Default

I tried again and still not working.
Here is code after edited.

Code:
{* $Id: recommends.tpl,v 1.4 2004/05/28 12:21:12 max Exp $ *} {if $recommends} {capture name=recommends} {section name=num loop=$recommends} <LI> <SPAN class="ItemsList">{$recommends[num].product} {************* PRICE NEXT TO LIST ******} <font class=ProductPrice>{include file="currency.tpl" value=$recommends_prices[num].price}</font><font class=MarketPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$recommends_prices[num].price} {**************************************} </SPAN> </LI> {/section} {/capture} {include file="dialog.tpl" title=$lng.lbl_recommends content=$smarty.capture.recommends extra="width=100%"} {/if}

Parts from recommend.php
Code:
if ($config["Modules"]["select_recommends_list_randomly"] == "Y" && count($query_ids)>0) { $query = "SELECT $sql_tbl[products].*, $lng_fields FROM $sql_tbl[products] LEFT JOIN $sql_tbl[products_lng] ON $sql_tbl[products].productid=$sql_tbl[products_lng].productid $lng_condition WHERE $sql_tbl[products].productid IN ('".join("','",$query_ids)."')"; $recommends_prices = func_query("select * from $sql_tbl[pricing] where quantity='1' and productid in (".join(",",$query_ids).")"); $smarty->assign("recommends_prices",$recommends_prices); } else $query = "SELECT DISTINCT sp2.productid, $sql_tbl[products].*, $lng_fields FROM $sql_tbl[stats_customers_products] as sp1, $sql_tbl[stats_customers_products] AS sp2, $sql_tbl[products], $sql_tbl[products_categories], $sql_tbl[categories] LEFT JOIN $sql_tbl[products_lng] ON $sql_tbl[products].productid=$sql_tbl[products_lng].productid $lng_condition WHERE sp1.productid='$productid' AND sp1.login=sp2.login AND sp2.productid!='$productid' AND $sql_tbl[products].productid=sp2.productid AND $sql_tbl[products].forsale='Y' AND $sql_tbl[products].productid = $sql_tbl[products_categories].productid AND $sql_tbl[products_categories].main = 'Y' AND $sql_tbl[categories].categoryid = $sql_tbl[products_categories].categoryid AND $sql_tbl[categories].membership IN ('".@$user_account['membership']."','') ".$avail_condition." ORDER BY $sql_tbl[products].product LIMIT ".$config["Modules"]["number_of_recommends"]; $recommends = func_query($query); $smarty->assign("recommends",$recommends); ?>

I am assuming that you add the code within if statement.
The error is incorrect pricing shows up next to recommended product.

Under module options,
Select recommended products randomly: checked
Number of products to be displayed : 10
__________________
X-Cart Gold Plus 4.5.5
Checkout ONE
Checkout ONE DPM
BCSE CIM
Apache
Linux
Reply With Quote
  #14  
Old 12-25-2004, 07:28 AM
  CC's Avatar 
CC CC is offline
 

eXpert
  
Join Date: Jun 2004
Posts: 349
 

Default

Worked for me in 4.0.9 Gold.

Nice one Carrie!
__________________
XC 4.2 inc (unofficial) patch release.
Reply With Quote
  #15  
Old 01-06-2005, 03:15 AM
  shishapipe's Avatar 
shishapipe shishapipe is offline
 

Advanced Member
  
Join Date: Dec 2004
Location: London
Posts: 47
 

Default

This worked for me on 4.0.9, here is the code.
/skin1/modules/Recommended_Products/recommends.tpl
Code:
{* $Id: recommends.tpl,v 1.4 2004/05/28 12:21:12 max Exp $ *} {if $recommends} {capture name=recommends} {section name=num loop=$recommends} <LI> <font class=ProductPrice>{include file="currency.tpl" value=$recommends_prices[num].price}</font> <font class=MarketPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$recommends_prices[num].price}</font> <span class="ItemsList">{$recommends[num].product}</SPAN> </LI> {/section} {/capture} {include file="dialog.tpl" title=$lng.lbl_recommends content=$smarty.capture.recommends extra="width=100%"} {/if}

The above is the full code in recommends.tpl
__________________
Regards Maxking

SERVER: Microsoft-IIS/5.0
MYSQL Server: 4.0.18-NT
PERL: 5.006001
PHP: 4.3.6
X-CART pro: 4.3
X-AOM: 4..3
X-RMA: 4..3X-FancyCategories 4.3
Skin: Own Design
Marketing Manager Professional 3.0 Bundle
Reply With Quote
  #16  
Old 01-06-2005, 03:22 AM
  shishapipe's Avatar 
shishapipe shishapipe is offline
 

Advanced Member
  
Join Date: Dec 2004
Location: London
Posts: 47
 

Default

And the last bit of the code in the your_shop_cart_root/recommends.php


Code:
if ($config["Modules"]["select_recommends_list_randomly"] == "Y" && count($query_ids)>0) { $query = "SELECT $sql_tbl[products].*, $lng_fields FROM $sql_tbl[products] LEFT JOIN $sql_tbl[products_lng] ON $sql_tbl[products].productid=$sql_tbl[products_lng].productid $lng_condition WHERE $sql_tbl[products].productid IN ('".join("','",$query_ids)."')"; # Add extra code for Prices to Show $recommends_prices = func_query("select * from $sql_tbl[pricing] where quantity='1' and productid in (".join(",",$query_ids).")"); $smarty->assign("recommends_prices",$recommends_prices); $query = "SELECT $sql_tbl[products].*, $lng_fields FROM $sql_tbl[products] LEFT JOIN $sql_tbl[products_lng] ON $sql_tbl[products].productid=$sql_tbl[products_lng].productid $lng_condition WHERE $sql_tbl[products].forsale='Y' ".$avail_condition." AND $sql_tbl[products].productid IN (".join(",",$query_ids).")"; #End Add extra code for Prices to Show } else $query = "SELECT DISTINCT sp2.productid, $sql_tbl[products].*, $lng_fields FROM $sql_tbl[stats_customers_products] as sp1, $sql_tbl[stats_customers_products] AS sp2, $sql_tbl[products], $sql_tbl[products_categories], $sql_tbl[categories] LEFT JOIN $sql_tbl[products_lng] ON $sql_tbl[products].productid=$sql_tbl[products_lng].productid $lng_condition WHERE sp1.productid='$productid' AND sp1.login=sp2.login AND sp2.productid!='$productid' AND $sql_tbl[products].productid=sp2.productid AND $sql_tbl[products].forsale='Y' AND $sql_tbl[products].productid = $sql_tbl[products_categories].productid AND $sql_tbl[products_categories].main = 'Y' AND $sql_tbl[categories].categoryid = $sql_tbl[products_categories].categoryid AND $sql_tbl[categories].membership IN ('".@$user_account['membership']."','') ".$avail_condition." ORDER BY $sql_tbl[products].product LIMIT ".$config["Modules"]["number_of_recommends"]; $recommends = func_query($query); $smarty->assign("recommends",$recommends); ?>

I added the extra lines in the code which you can see is marked with:
# Add extra code for Prices to Show
And ends with
# End Add extra code for Prices to Show
__________________
Regards Maxking

SERVER: Microsoft-IIS/5.0
MYSQL Server: 4.0.18-NT
PERL: 5.006001
PHP: 4.3.6
X-CART pro: 4.3
X-AOM: 4..3
X-RMA: 4..3X-FancyCategories 4.3
Skin: Own Design
Marketing Manager Professional 3.0 Bundle
Reply With Quote
  #17  
Old 01-23-2005, 11:30 PM
  enge919's Avatar 
enge919 enge919 is offline
 

Senior Member
  
Join Date: May 2003
Posts: 141
 

Default

How about a mod to display the prices of the product options in the order_info.tpl (in the orders view in the xcart admin)...4.0.x??
__________________
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
  #18  
Old 02-14-2005, 08:58 PM
 
MOC MOC is offline
 

Senior Member
  
Join Date: Oct 2002
Posts: 171
 

Default

What do i have to change in 3.5.14
Reply With Quote
  #19  
Old 06-15-2006, 05:57 AM
  jvleigh's Avatar 
jvleigh jvleigh is offline
 

Advanced Member
  
Join Date: Feb 2004
Location: Kentucky, USA
Posts: 30
 

Default

I've tried this MOD and have to agree with other posters that it randomizes the prices so that they do not match the products.

Has anybody had success getting the prices to match?

Thanks.
__________________
X-Cart Gold: 2 live sites running 4.1.x and 4.2.x Add ons: XAOM, XCONF & XFANCYCAT
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 09:31 AM.

   

 
X-Cart forums © 2001-2020