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)
-   -   Upsells in your cart (where they should be) (https://forum.x-cart.com/showthread.php?t=2685)

YuriC 05-13-2003 12:55 PM

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

enge919 08-21-2003 12:42 AM

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

sabrina 09-04-2003 08:07 AM

Upsell in cart
 
Tell me please where i have to put this codes and how?


All times are GMT -8. The time now is 01:43 PM.

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