|

MOD: Thumbnail,Product info & Delete in Cart Sidebox
Posted 16 December 2006 - 04:47 PM #21
Posted 05 January 2007 - 02:29 PM #22
I am new to PHP so I don´t know if this is the best solution, but it seems to work, except for recently viewed in emty cart page.
I removed R.W. in the emty cart page. I don´t see the point to show the same parts after emty the cart. I still have the side box R.W.
1. Add the following code in /include/customer/cart_status.php
one line before
extract(fn_calculate_cart_content($cart, $auth, false, false, 'F', false));
$smarty->assign_by_ref('cart_products', $cart['products']);
2. Add the following code in /include/customer/cart.php (around line 54) after
$smarty->assign_by_ref('cart_subtotal', $cart['subtotal']);
extract(fn_calculate_cart_content($cart, $auth, false, false, 'F', false));
if (!empty($cart_products)) {
foreach($cart_products as $k => $v) {
fn_gather_additional_product_data($cart_products[$k], true);
}
}
$smarty->assign_by_ref('cart_products', $cart_products);
Can someone with PHP knowledge check the added code?
______________
Peter
Posted 11 January 2007 - 04:35 AM #23
When you click the "x" for remove next to the icon in the shopping cart box it just shows it at no progress for a while then goes to page cannot be displayed for me. But when I refresh the page it shows it as gone

And of course I still do not have the icon show up imediatly after adding it to the cart.
And I have the first Items I added instead of the last.
If it worked smoothly it would be a great! addon to CS-Cart.
Posted 07 February 2007 - 02:13 PM #24
Thanks
Posted 01 March 2007 - 05:55 AM #25
I know this was a very long time ago, but do you have a code snippet to make it display (only) the last 4 items added?
Posted 01 March 2007 - 01:07 PM #26
Customer Service (Helpdesk) Addon for CS-Cart v4.3.1
Quote and Invoicing Addon for CS-Cart v4.3.1
Posted 01 March 2007 - 01:52 PM #27
or else it's not writing to the page correctly, it's was working earlier today
Posted 12 March 2007 - 03:48 AM #28
I have tried to fix the AJAX bug with some trial & error and come up with this solution.
I am new to PHP so I don´t know if this is the best solution, but it seems to work, except for recently viewed in emty cart page.
I removed R.W. in the emty cart page. I don´t see the point to show the same parts after emty the cart. I still have the side box R.W.
1. Add the following code in /include/customer/cart_status.php
one line before
extract(fn_calculate_cart_content($cart, $auth, false, false, 'F', false));
$smarty->assign_by_ref('cart_products', $cart['products']);
2. Add the following code in /include/customer/cart.php (around line 54) after
$smarty->assign_by_ref('cart_subtotal', $cart['subtotal']);extract(fn_calculate_cart_content($cart, $auth, false, false, 'F', false));
if (!empty($cart_products)) {
foreach($cart_products as $k => $v) {
fn_gather_additional_product_data($cart_products[$k], true);
}
}
$smarty->assign_by_ref('cart_products', $cart_products);
Can someone with PHP knowledge check the added code?
______________
Peter
I don't know anything about PHP, but this fix worked great as an AJAX fix. Thank you.
Brandon
Posted 01 March 2008 - 10:51 AM #29
Here's my version, I removed the truncate for mine, but left it in for you:
{* $Id: [COLOR=red]cart_thumbs.tpl[/COLOR] 2006-10-31 nwsco $ *} {if $cart_products} {literal} <style type="text/css">.thumb_cart_divider { border-bottom:1px dotted #808080; } /*you can move this line to styles.css if you like*/</style> {/literal} <table cellpadding="0" cellspacing="0" width="100%" align="center" border="0"> {foreach from=$cart_products item="product" key="key"} <tr height="40"> <td valign="middle" rowspan="2" style="padding-right:5px"> <a href="{$index_script}?{$target_name}=products&product_id={$product.product_id}"> {include file="common_templates/image.tpl" image_width=35 obj_id=$key images=$product.main_pair object_type="product"}</a> </td> <td valign="top" colspan="2"> <a title="{$product.product}" href="{$index_script}?{$target_name}=products&product_id={$product.product_id}" class="product-title">{$product.product[COLOR=red]|truncate:15:".."[/COLOR]}</a> </td> </tr> <tr> <td valign="top"> {include file="common_templates/price.tpl" value=$product.price class="price"} </td> <td align="right" valign="top"> <a href="{$index_script}?{$target_name}=[COLOR=blue]checkout[/COLOR]&cart_id={$key}&{$mode_name}=delete"><img src="{$images_dir}/delete_product.gif" width="12" height="12" border="0" alt="{$lang.remove} {$product.amount}x" title="{$lang.remove} {$product.amount}x" align="absbottom" /></a> </td> </tr> <tr height="1"> <td class="thumb_cart_divider" colspan="3"> </td> </tr> {/foreach} </table> <br /> {/if}
[/SIZE]
Posted 01 March 2008 - 03:58 PM #30
Trying to get this mod to work (v1.3.5 sp2) New vision blue. Have managed to create the cart ok but only get thumbnails to show when I go to view cart. All other pages just have the side box with no images etc.
How do we get the thumbnails to appear in this side box on all pages???
By the way, we haven't tried Matt's version yet, unsure where to paste the top code anyway.
Any idea please.
Barry
BarryH
CS-Cart v4.4.3 (Plus one being developed v4.5.2 SP2)
UK User
Posted 01 March 2008 - 06:05 PM #31
cart_status.php
<?php /****************************************************************************** * * * Copyright (c) 2004-2007 CS-Cart.com. All rights reserved. * * * ******************************************************************************* * * * CS-Cart is commercial software, only users who have purchased a valid * * license through [URL]https://www.cs-cart.com/[/URL] and accept to the terms of this * * License Agreement can install this product. * * * ******************************************************************************* * THIS CS-CART SHOP END-USER LICENSE AGREEMENT IS A LEGAL AGREEMENT BETWEEN * * YOU AND YOUR COMPANY (COLLECTIVELY, "YOU") AND CS-CART.COM (HEREINAFTER * * REFERRED TO AS "THE AUTHOR") FOR THE SOFTWARE PRODUCT IDENTIFIED ABOVE, * * WHICH INCLUDES COMPUTER SOFTWARE AND MAY INCLUDE ASSOCIATED MEDIA, PRINTED * * MATERIALS, AND "ONLINE" OR ELECTRONIC DOCUMENTATION (COLLECTIVELY, THE * * "SOFTWARE"). BY USING THE SOFTWARE, YOU SIGNIFY YOUR AGREEMENT TO ALL * * TERMS, CONDITIONS, AND NOTICES CONTAINED OR REFERENCED HEREIN. IF YOU ARE * * NOT WILLING TO BE BOUND BY THIS AGREEMENT, DO NOT INSTALL OR USE THE * * SOFTWARE. * * * * PLEASE READ THE FULL TEXT OF SOFTWARE LICENSE AGREEMENT IN THE "COPYRIGHT" * * FILE PROVIDED WITH THIS DISTRIBUTION. THE AGREEMENT TEXT IS ALSO AVAILABLE * * AT THE FOLLOWING URL: [URL]https://www.cs-cart.com/license.html[/URL] * ******************************************************************************/ // // $Id: cart_status.php 4397 2007-12-06 13:43:15Z zeke $ // if ( !defined('IN_CSCART') ) { die('Access denied'); } sess_register('cart'); $cart['amount'] = @empty($cart['amount']) ? 0 : $cart['amount']; $cart['subtotal'] = @empty($cart['subtotal']) ? 0 : $cart['subtotal']; [COLOR=blue]$smarty->assign_by_ref('cart_products', $cart_products);[/COLOR] $smarty->assign_by_ref('cart_amount', $cart['amount']); $smarty->assign_by_ref('cart_subtotal', $cart['display_subtotal']); if (!empty($cart['shipping_cost'])) { $smarty->assign_by_ref('cart_shipping_cost', $cart['shipping_cost']); } $CALLER = __FILE__; include CORE_DIR . 'include_addons.php'; [COLOR=blue]extract(fn_calculate_cart_content($cart, $auth, true, false));[/COLOR] [COLOR=blue] if (!empty($cart_products)) {[/COLOR] [COLOR=blue] foreach($cart_products as $k => $v) {[/COLOR] [COLOR=blue] fn_gather_additional_product_data($cart_products[$k], true);[/COLOR] [COLOR=blue] }[/COLOR] [COLOR=blue] }[/COLOR] ?>
[/SIZE]
Posted 01 March 2008 - 06:15 PM #32
Anyway here is a screenshot of my result:
Attached Files
[/SIZE]
Posted 01 March 2008 - 06:33 PM #33
Thanks for that I will Try Again!!!!
Barry
BarryH
CS-Cart v4.4.3 (Plus one being developed v4.5.2 SP2)
UK User
Posted 04 March 2008 - 06:13 PM #34
For those running 1.3.5 SP2, you might find that the delete button doesn't work.
Here's my version, I removed the truncate for mine, but left it in for you:
{* $Id: [COLOR=red]cart_thumbs.tpl[/COLOR] 2006-10-31 nwsco $ *} {if $cart_products} {literal} <style>.thumb_cart_divider { border-bottom:1px dotted #808080; } /*you can move this line to styles.css if you like*/</style> {/literal} <table cellpadding="0" cellspacing="0" width="100%" align="center" border="0"> {foreach from=$cart_products item="product" key="key"} <tr height="40"> <td valign="middle" rowspan="2" style="padding-right:5px"> <a href="{$index_script}?{$target_name}=products&product_id={$product.product_id}"> {include file="common_templates/image.tpl" image_width=35 obj_id=$key images=$product.main_pair object_type="product"}</a> </td> <td valign="top" colspan="2"> <a title="{$product.product}" href="{$index_script}?{$target_name}=products&product_id={$product.product_id}" class="product-title">{$product.product[COLOR=red]|truncate:15:".."[/COLOR]}</a> </td> </tr> <tr> <td valign="top"> {include file="common_templates/price.tpl" value=$product.price class="price"} </td> <td align="right" valign="top"> <a href="{$index_script}?{$target_name}=[COLOR=blue]checkout[/COLOR]&cart_id={$key}&{$mode_name}=delete"><img src="{$images_dir}/delete_product.gif" width="12" height="12" border="0" alt="{$lang.remove} {$product.amount}x" title="{$lang.remove} {$product.amount}x" align="absbottom" /></a> </td> </tr> <tr height="1"> <td class="thumb_cart_divider" colspan="3"> </td> </tr> {/foreach} </table> <br> {/if}
Nice work, only one little problem:
is not xhtml...

WebGraphiq offers a wide range of professionally developed, ready to use CS-Cart add-ons to provide additional functionality and boost your sales. The oldest active CS-Cart add-on development team. -- Since 2006 --
CS-CART ADD-ONS | FREE QUOTE | CS-CART DEVELOPMENT | @webgraphiq
Posted 05 March 2009 - 07:26 PM #35
{* $Id: cart_status.tpl 3782 2007-08-30 06:29:35Z zeke $ *} <table cellspacing="0" cellpadding="0" border="0" align="center"> <tr> <td height="26" valign="middle"> <a href="{$index_script}?{$target_name}=checkout&{$mode_name}=cart"> {if $cart_amount} <img src="{$images_dir}/filled_cart_icon.gif" width="17" height="14" border="0" alt="" /> {else} <img src="{$images_dir}/empty_cart_icon.gif" width="17" height="14" border="0" alt="" /> {/if} </a></td> <td> </td> <td> {if $cart_amount} {$lang.products}: <b>{$cart_amount}</b><br /> {$lang.subtotal}: <b>{include file="common_templates/price.tpl" value=$cart_subtotal}</b> {else} <b>{$lang.cart_is_empty}</b> {/if}</td> </tr> </table> <hr />
I can't understand the step 3 because there is no "one line before the ?>". Could you please tell how to add this line.
Please vote for CDN Add-on
For SEO Article Submission, Forum Profile Links, Web 2.0 links, contact me through PM.
Posted 05 March 2009 - 10:12 PM #36