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

Upsells in your cart (where they should be)
 
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features
 
Thread Tools Search this Thread
  #1  
Old 05-13-2003, 12:55 PM
 
YuriC YuriC is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 66
 

Default Upsells in your cart (where they should be)

Yet More effective upsell mod that would put upsell products into your shopping cart placing it on the right side of every product. Inspired by my own mod which places the upsells underneath the product thumb thus making sure that customer doesnt have to scroll to see the products you want to upsell (-http://x-cart.com/forum/viewtopic.php?t=3334&highlight=&sid=c3a7d92d53d7ac 9c9c337ef937ac89d1)

Anyways.. da code is hier

Step 1: get an array of upsells

Code:
<? # # $Id: related_products_cart.php,v 1.131.2.15 2003/03/07 12:26:49 acidleak Exp $ # # This script implements upsells inside of your shopping cart # $upsell_links = func_query($search_query = "select DISTINCT $sql_tbl[products].*, $sql_tbl[categories].category, $sql_tbl[product_links].*, $sql_tbl[pricing].price from $sql_tbl[products], $sql_tbl[pricing], $sql_tbl[categories], $sql_tbl[product_links] where ($sql_tbl[pricing].membership='') and ($sql_tbl[pricing].productid=$sql_tbl[products].productid) and ($sql_tbl[pricing].quantity=1) and ($sql_tbl[products].categoryid=$sql_tbl[categories].categoryid) and $sql_tbl[products].forsale='Y' and ($sql_tbl[products].productid=$sql_tbl[product_links].productid2) ORDER BY $sql_tbl[products].product"); $smarty->assign("upsell_links",$upsell_links); ?>

Step 2: Template
Code:
{* $Id: related_products_cart.tpl,v 1.7 05/12/2003 10:27:05 acidleak Exp $ *} {if $upsell_links ne ""} <table border=0 width="170" cellspacing=0 cellpadding=1> <tr><td class=DialogBorder><font class=UpsellTitle>This works well with</font></td> <tr><td class=DialogBorder> <TABLE border=0 cellPadding=3 cellSpacing=0 width="100%"> <tr class="ItemsList"> <td class="DialogBox"> {section name=cat_num loop=$upsell_links} {if $upsell_links[cat_num].productid1 == $productid} <a href="product.php?productid={ $upsell_links[cat_num].productid2 }" target=_blank> <font class=UpsellLinkText>•{$upsell_links[cat_num].product}</font> </a> {/if} {/section} </td> </tr> </table> </td></tr> </table> {/if}

Step 3: add this to your cart.php right before first "smarty->"
Code:
# Upsells if($active_modules["Upselling_Products"]) include "./custmods/related_products_cart.php";

Step 4: add this to your cart.tpl where u want the upsell to appear
Code:
<div align="right"> {if $active_modules.Upselling_Products ne ""} {include file="../customer/custmods/related_products_cart.tpl" productid=$products[product].productid} {/if} </div>

This code can be seen at work on www.worldhealthproducts.com
--
hack well
- acidleak
Reply With Quote
  #2  
Old 08-21-2003, 12:42 AM
  enge919's Avatar 
enge919 enge919 is offline
 

Senior Member
  
Join Date: May 2003
Posts: 141
 

Default Help with code

I've got the first mod for the upsells under the product picture but I cant figure out how to make this one work. I am reading the code but guess I am still a bit too new at this the figure it out on my own. Could you please help as to where to put everything?

Check out how the first mod looks on my site
http://www.dssnutrition.com/store/customer/product.php?productid=25974&xid=0b7e8989666ce5b614 dafeb28ea0516a

Also, how do I change the color of the table?

any suggestions would be greatly appreciated
Reply With Quote
  #3  
Old 09-04-2003, 08:07 AM
 
sabrina sabrina is offline
 

Advanced Member
  
Join Date: Feb 2003
Location: Indianapolis, IN., USA
Posts: 53
 

Default Upsell in cart

Tell me please where i have to put this codes and how?
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 10:44 AM.

   

 
X-Cart forums © 2001-2018