Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

MOD: Thumbnail,Product info & Delete in Cart Sidebox Rate Topic   - - - - -

 
  • akmarket
  • Member
  • Members
  • Join Date: 15-Feb 06
  • 75 posts

Posted 16 December 2006 - 04:47 PM #21

This mod i need it to be the last 5 items added to the cart. Plus the items don't show in any pages except view cart. Theres like no point of it check it out at www.akmarket.com

 
  • Grennix
  • Junior Member
  • Members
  • Join Date: 02-Nov 06
  • 5 posts

Posted 05 January 2007 - 02:29 PM #22

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

 
  • JosiahW
  • Senior Member
  • Members
  • Join Date: 13-Dec 06
  • 160 posts

Posted 11 January 2007 - 04:35 AM #23

Looks cool... would be great if it was fixed up.
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.

 
  • sholand
  • Senior Member
  • Members
  • Join Date: 16-Jan 07
  • 142 posts

Posted 07 February 2007 - 02:13 PM #24

This mod is great but really confusing for the end user. Did anyone get the products to show right away?

Thanks

 

Posted 01 March 2007 - 05:55 AM #25

Hey Nwsco,

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?
I've moved on from CS-Cart to WooC******** - If you need anything I can be of little help.

 
  • snorocket
  • Forum Janitor
  • Members
  • Join Date: 15-Mar 06
  • 2519 posts

Posted 01 March 2007 - 01:07 PM #26

what is up with "BEGIN__VBULLETIN__CODE__SNIPPET"
SNOROCKET.COM, Now Accepting PRE-ORDERS:
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

NFI, I think someone's playing around with the 'code' and 'php' snippets.
or else it's not writing to the page correctly, it's was working earlier today
I've moved on from CS-Cart to WooC******** - If you need anything I can be of little help.

 
  • brandonvd
  • is Super Awesome
  • Members
  • Join Date: 19-Dec 06
  • 2633 posts

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

 
  • mdekok3000
  • Senior Member
  • Members
  • Join Date: 06-Feb 08
  • 883 posts

Posted 01 March 2008 - 10:51 AM #29

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 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=2]
[/SIZE]

 
  • BarryH
  • Senior Member
  • Members
  • Join Date: 03-Sep 07
  • 1459 posts

Posted 01 March 2008 - 03:58 PM #30

Hi

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


 
  • mdekok3000
  • Senior Member
  • Members
  • Join Date: 06-Feb 08
  • 883 posts

Posted 01 March 2008 - 06:05 PM #31

The post above is a copy and paste from my cart_thumbs.tpl file. Every other file was modified the same way suggested by nwsco. Here is my other file.

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=2]
[/SIZE]

 
  • mdekok3000
  • Senior Member
  • Members
  • Join Date: 06-Feb 08
  • 883 posts

Posted 01 March 2008 - 06:15 PM #32

And I would also like to know how I could get it to appear in all pages as well. My fix still only shows it on the cart.

Anyway here is a screenshot of my result:

Attached Files


[SIZE=2]
[/SIZE]

 
  • BarryH
  • Senior Member
  • Members
  • Join Date: 03-Sep 07
  • 1459 posts

Posted 01 March 2008 - 06:33 PM #33

Hi Matt

Thanks for that I will Try Again!!!!

Barry

BarryH

 

CS-Cart v4.4.3 (Plus one being developed v4.5.2 SP2)
UK User


 
  • ThomH
  • Senior Member
  • Members
  • Join Date: 20-Nov 07
  • 1615 posts

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


 
  • miracles
  • Senior Member
  • Members
  • Join Date: 19-Sep 07
  • 1533 posts

Posted 05 March 2009 - 07:26 PM #35

I add your code but it shows fatal error. Here is my cart_status.tpl file code.

{* $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.
CS-CART 3.0.6 GRENADE

Please vote for CDN Add-on

For SEO Article Submission, Forum Profile Links, Web 2.0 links, contact me through PM.

 
  • baballuci
  • Senior Member
  • Members
  • Join Date: 02-Mar 06
  • 969 posts

Posted 05 March 2009 - 10:12 PM #36

Step 3 is refering to /include/customer/cart_status.php, not a tpl file.
Charlie

 
  • miracles
  • Senior Member
  • Members
  • Join Date: 19-Sep 07
  • 1533 posts

Posted 06 March 2009 - 04:45 AM #37

Why it is not working on dark steel skin. It is not showing image on the cart.:mad:
CS-CART 3.0.6 GRENADE

Please vote for CDN Add-on

For SEO Article Submission, Forum Profile Links, Web 2.0 links, contact me through PM.

 
  • photogabor
  • Member
  • Members
  • Join Date: 28-May 09
  • 32 posts

Posted 29 May 2009 - 07:27 AM #38

anything like this for version 2?