View Single Post
  #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