Zen Cart Logo
Forums / Addon Sideboxes / Cart Summary Sidebox Make URL's

Cart Summary Sidebox Make URL's

Locked

Views: 4,877

Results 1 to 20 of 23
This thread is locked. New replies are disabled.
30 Apr 2009, 7:35 PM
#1
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Cart Summary Sidebox Make URL's

Hi All,

I have this cart summary mod installed on my site, displaying in the header at https://www.limelites.co.uk

My question is how to make this mod behave like other carts I see on other sites. I would like the text in the cart summary to be clickable and direct to the shopping cart, but only when there is something in the cart.

Does anyone know how to do this?

30 Apr 2009, 8:32 PM
#2
s_t_e_v_e avatar

s_t_e_v_e

Zen Follower

Join Date:
Aug 2006
Location:
UK
Posts:
430
Plugin Contributions:
0

Re: Cart Summary Sidebox Make URL's

What is the name and link to the mod you have installed... Should be rather straightforward to add a link to shopping cart..

30 Apr 2009, 10:08 PM
#3
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Cart Summary Sidebox Make URL's

Hi Steve,

It was the Cart Summary mod here:

http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=345

It would be straightforward to add a link to the cart, but I'd struggle to add a dynamic link that only became clickable when the cart had something added, so only when cart contents >=1 ?

1 May 2009, 2:20 PM
#4
s_t_e_v_e avatar

s_t_e_v_e

Zen Follower

Join Date:
Aug 2006
Location:
UK
Posts:
430
Plugin Contributions:
0

Re: Cart Summary Sidebox Make URL's

You could try...

<?php if ($_SESSION['cart']->count_contents() == 0) { ?>
   <p>nothing in cart - so no link required</p>
<?php  } else { ?>
   <a href="">something in cart so create a link..</a>
<?php }?>

If that doesnt help, I'll take a look at the mod...

1 May 2009, 3:05 PM
#5
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Cart Summary Sidebox Make URL's

Hi Steve,

Thanks for that... It's working, you've certainly got the right coding but I wonder how I might add the URL to the existing text in the cart summary.

When the cart is empty, this is the text:

Items in Cart: 0
Weight: 0kgs
Amount: £0.00

How easy would it be to change that code so that the whole of the existing text changes to red font and becomes clickable?

The other issue I had was with the little image of the cart I've used. Ideally, this should be clickable when the cart is active too. I've had to cheat with that image though as I've actually positioned it on my main site logo so it appears as part of the cart. I realise it should be a background image applied to #navCartMainSummary.... I had this applied originally like this:

#navMainCartSummary {
position: relative; left: 885px; top:25px;
width: 10%;
height: 70px;
text-align: left;
color: #000000;
background-image: url("../images/shopping_cart.png");
background-position:right;
background-repeat: no-repeat;
}

... which was working great, but which brings me to another problem with my poor html skills :-) I can't seem to force the Items in Cart---Weight---Amount each onto a new line of their own. I tried it with <p> in the language define file but it makes it all screwy..... I'm having to make them take up a new line using a 10% width control in the stylesheet above which isn't ideal as I can't apply the background image so the little cart could never be clickable along with the text.

Hope you can understand what I'm trying to describe. It's a hard one to put across. I could illustrate exactly what I mean by sending some adaptive screenshots?

1 May 2009, 4:12 PM
#6
s_t_e_v_e avatar

s_t_e_v_e

Zen Follower

Join Date:
Aug 2006
Location:
UK
Posts:
430
Plugin Contributions:
0

Re: Cart Summary Sidebox Make URL's

I'll download the mod.. and look at the code... If you want the shopping basket clickable, then remove it from the background so it can be included as a small pic... .

1 May 2009, 4:24 PM
#7
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Cart Summary Sidebox Make URL's

Hi Steve,

I've removed the cart pic from the main background image, so it can be included as a small pic....

Here is a link to the mod, together with the file I'd been working on:

http://www.limelites.co.uk/CartContentsSidebox.rar

2 May 2009, 9:55 AM
#8
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Cart Summary Sidebox Make URL's

For anyone interested in having a dynamic shopping cart like the one **Steve's ** just created for my site at https://www.limelites.co.uk then feel free to download the full version here:

http://www.limelites.co.uk/Active_Cart_Sidebox_Steve_Limelites.rar

I've submitted this to contributions for review, courtesy of the original mod author and the outstanding modifications made by Steve to add cart images and active urls to the cart summary.

17 May 2009, 9:08 AM
#9
mrchristoh avatar

mrchristoh

New Zenner

Join Date:
May 2009
Location:
from parts unknown
Posts:
74
Plugin Contributions:
0

Re: Cart Summary Sidebox Make URL's

Nice work steve and limelites :bigups:

Is there any way to get a list of contents like the shopping cart sidebox?

And if possible a image included of the products as in the cart?

please look at my site and expand the element in the header after adding to the cart.

I am using the cart summary:

<div> <?php require(DIR_WS_MODULES . 'sideboxes/cart_summary.php'); ?> </div>

My wish is to place this content in the div and it would be great to have a version of this that displays contents and images :)

Please check my other posts from today and maybe you can contribute to the AJAX modification that i made.

i have a question.....
Limelites
"can i ask you hoe did you do the redirect on empty cart?"
it looks great

is this the one for download above?

Thanks

17 May 2009, 10:50 AM
#10
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Cart Summary Sidebox Make URL's

Is there any way to get a list of contents like the shopping cart sidebox? And if possible a image included of the products as in the cart?
There are a couple of mods you can download which display the shopping cart content with product images:


please look at my site and expand the element in the header after adding to the cart.
There's no link to your site?
_______________________________________________________

i have a question.....
Limelites
"can i ask you how did you do the redirect on empty cart?"
it looks great

is this the one for download above?

Take a look at this contribution and just tweak the code so that it redirects to your own defined page which has your own content:

17 May 2009, 10:58 AM
#11
mrchristoh avatar

mrchristoh

New Zenner

Join Date:
May 2009
Location:
from parts unknown
Posts:
74
Plugin Contributions:
0

Re: Cart Summary Sidebox Make URL's

Hi Limelite,

ooops the site is
http://pets.mychikyuya.com

thanks for the links :)

17 May 2009, 12:40 PM
#12
mrchristoh avatar

mrchristoh

New Zenner

Join Date:
May 2009
Location:
from parts unknown
Posts:
74
Plugin Contributions:
0

Re: Cart Summary Sidebox Make URL's

Hi,

Its all working now :)

check it out

I will post the code within a day or two :yes:

4 Sep 2009, 12:52 PM
#13
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Cart Summary Sidebox Make URL's

Hey, your site's coming on leaps and hounds lol, looking good! One thing I notice straight off the bat though, your png files on the main page are taking some time to load.... Not sure why you're using png's for those, gifs or jpgs would look just as crips with that type of graphic and they'd load so much faster.

Where did you get the animated menu at the top and the bottom? I teke it those are javascript?

10 May 2010, 12:43 AM
#14
rapro avatar

rapro

New Zenner

Join Date:
Nov 2009
Posts:
44
Plugin Contributions:
0

Re: Cart Summary Sidebox Make URL's

Hi,

I need some help with this addon. I installed and deleted it few times and tryed to understand the code but still cant get it working properly.

  1. First it does not read changes that i made in cart_contents_sidebox.php

even when i change it to:

aaaaa
bbbb
ccccc

to test it it does not display anywhere.

It is very weird becouse when i am in shopping cart it shows everythink correct and even in dutch.
At the moment when i navigate to different page it shows

TEXT_TOTAL_ITEMS1
TEXT_TOTAL_AMOUNT€0.00

And second question is how to bring the tekst to the right under the shoppingcart image.

Realy need help with it, spend alot of time but still cant get it right.

link: https://www.witgoedextra.nl/wxt

10 May 2010, 12:47 AM
#15
rapro avatar

rapro

New Zenner

Join Date:
Nov 2009
Posts:
44
Plugin Contributions:
0

Re: Cart Summary Sidebox Make URL's

Basicly if i woud know where it reads the shopping cart information from i think i can get it workin.
Probably from cart_contents.php but cant figure it out from which part.

10 May 2010, 6:33 AM
#16
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Cart Summary Sidebox Make URL's

Sounds like you've not uploaded this file:

/includes/languages/english/extra_definitions/cart_contents_sidebox.php

........... either that, or you've edited it incorrectly. Upload the original again.

10 May 2010, 6:53 AM
#17
rapro avatar

rapro

New Zenner

Join Date:
Nov 2009
Posts:
44
Plugin Contributions:
0

Re: Cart Summary Sidebox Make URL's

Thanks for reply :smile:

I just did but no effect.

I tryed it already many times and even changed it to weird letter combinations to see when it reads from.

What i know is that when i am not on shopping cart page it reads from

 switch (true) {
    case (SHOW_TOTALS_IN_CART == '1'):
      $totalDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() ."\n" . $item_separator . TEXT_TOTAL_WEIGHT . $_SESSION['cart']->show_weight() . TEXT_PRODUCT_WEIGHT_UNIT ."\n" . $item_separator . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
      break;
    case (SHOW_TOTALS_IN_CART == '2'):
      $totalDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . ($_SESSION['cart']->show_weight() > 0 ? $item_separator . TEXT_TOTAL_WEIGHT . $_SESSION['cart']->show_weight() . TEXT_PRODUCT_WEIGHT_UNIT : '') . $item_separator . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
      break;
    case (SHOW_TOTALS_IN_CART == '3'):
      $totalDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . $item_separator . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
      break;

somewhere from this code.

But when i am on shopping cart page where does it get dutch discriptions from no idia.

Gonna look at it from begin )

10 May 2010, 7:03 AM
#18
rapro avatar

rapro

New Zenner

Join Date:
Nov 2009
Posts:
44
Plugin Contributions:
0

Re: Cart Summary Sidebox Make URL's

Is it right that the most code is in cart_contents.php

this is it

<?php



  $item_separator =  '<br />';

  $totalDisplay = '';
  switch (true) {
    case (SHOW_TOTALS_IN_CART == '1'):
      $totalDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() ."\n" . $item_separator . TEXT_TOTAL_WEIGHT . $_SESSION['cart']->show_weight() . TEXT_PRODUCT_WEIGHT_UNIT ."\n" . $item_separator . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
      break;
    case (SHOW_TOTALS_IN_CART == '2'):
      $totalDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . ($_SESSION['cart']->show_weight() > 0 ? $item_separator . TEXT_TOTAL_WEIGHT . $_SESSION['cart']->show_weight() . TEXT_PRODUCT_WEIGHT_UNIT : '') . $item_separator . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
      break;
    case (SHOW_TOTALS_IN_CART == '3'):
      $totalDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . $item_separator . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
      break;
  }

  // you need your shopping cart image in your includes/templates/YOURTEMPLATE/images/ folder

    if ($_SESSION['cart']->count_contents() == 0) {
    // display nothing???
    $totalsDisplay = '<a href="' . zen_href_link(FILENAME_SHOPPING_CART) . '"><span class="headerbasketempty" style="position:relative; top:-15px;">'. zen_image(DIR_WS_TEMPLATE_IMAGES . 'ShoppingCartEmpty.jpg', 'Empty Shopping Basket') .'</span>';
} else {
    // make all content a link... Float image to the right? will need CSS styling..

   $totalsDisplay = '<a href="' . zen_href_link(FILENAME_SHOPPING_CART) . '"><span class="headerbasket" style="float:right;">'. zen_image(DIR_WS_TEMPLATE_IMAGES . 'ShoppingCartFull.jpg', 'Your Shopping Basket') .'</span>'. $totalDisplay .'</a>';
    }


  $content = $totalsDisplay;

/////////////////////////
// Sidebox disabled or displayed (Admin->Configuration->Stock)
  $show_shopping_cart_box = true;
  switch (true) {
    case (SHOW_SHOPPING_CART_BOX_STATUS == '0'):
      $show_shopping_cart_box = true;
      break;
    case (SHOW_SHOPPING_CART_BOX_STATUS == '1'):
      if ($_SESSION['cart']->count_contents() > 0 || (isset($_SESSION['customer_id']) && zen_user_has_gv_account($_SESSION['customer_id']) > 0)) {
        $show_shopping_cart_box = true;
      } else {
        $show_shopping_cart_box = false;
      }
      break;
    case (SHOW_SHOPPING_CART_BOX_STATUS == '2'):
      if ( ( ($_SESSION['cart']->count_contents() > 0) || (isset($_SESSION['customer_id']) && zen_user_has_gv_account($_SESSION['customer_id']) > 0) ) && ($_GET['main_page'] != FILENAME_SHOPPING_CART) ) {
        $show_shopping_cart_box = true;
      } else {
        $show_shopping_cart_box = false;
      }
      break;
  }
///////////////////////


  require($template->get_template_dir('tpl_cart_contents.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_cart_contents.php');

  if ($box_id !='' && $show_shopping_cart_box == true) {
    $title = '<label>' . BOX_HEADING_CART_CONTENTS . '</label>';
    $title_link = false;
    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
  } else {
    if ($show_shopping_cart_box == true)
    require($template->get_template_dir('tpl_box_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_box_header.php');
  }
  
$totalsDisplay = '';

?> 

I cant find here any reference to cart_contents_sidebox.php. Not sure how it works but as i think there have to be any reference to it somewhere.

10 May 2010, 7:13 AM
#19
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Cart Summary Sidebox Make URL's

Have you tried removing all the mod files from your server, then uploading the original files again?

Here is a link to the files I have on my own servers and the mod works well on all three sites:

http://www.superfancy.co.uk/shop/cart_summary_sidebox_1-3.zip

10 May 2010, 7:19 AM
#20
rapro avatar

rapro

New Zenner

Join Date:
Nov 2009
Posts:
44
Plugin Contributions:
0

Re: Cart Summary Sidebox Make URL's

This link u gave is to original addon right.

I used the one u gave before

Active_Cart_Sidebox_Steve_Limelites

this is the one u using right?