Zen Cart Logo
Forums / Addon Sideboxes / adding shopping cart image to shopping cart sidebox?

adding shopping cart image to shopping cart sidebox?

Views: 7,555

Results 1 to 14 of 14
28 Jan 2010, 10:20 PM
#1
robertg avatar

robertg

Zen Follower

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

adding shopping cart image to shopping cart sidebox?

Hi again and again,
I want to change the Text Shipping Cart (more) to an image of a shopping cart. I have the image all I need to know is which file do I copy the code to. I read several Threads but did not find anythiong similar.
Thanks for your help,
Bob

28 Jan 2010, 11:22 PM
#2
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: adding shopping cart image to shopping cart sidebox?

RobertG:

Hi again and again,
I want to change the Text Shipping Cart (more) to an image of a shopping cart. I have the image all I need to know is which file do I copy the code to. I read several Threads but did not find anythiong similar.
Thanks for your help,
Bob

try this article in the tutorials/FAQ section

1 Feb 2010, 10:17 PM
#3
robertg avatar

robertg

Zen Follower

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

Re: adding shopping cart image to shopping cart sidebox?

Am I suppose to add anything to this: my pic isn't showing up

$title = zen_image($template->get_template_dir(BOX_HEADING_CATEGORIES, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . BOX_HEADING_CATEGORIES, HEADER_ALT_TEXT);

the pic name is cart.jpg and is located in my admin/images directory.
Thanks Bob

1 Feb 2010, 10:36 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: adding shopping cart image to shopping cart sidebox?

Because that heading is also a link, it will still have the [more] after/below the image. You can redefine the text to blank, but then all other sidebox headings that have the [more] will lose it too.

Instead of manually editing PHP files for each sidebox, the easiest way is to install the Image Titles mod from Free Addons (link in my sig), and upload the image to /includes/templates/your_template/buttons/english/ with the filename boxhead-shoppingcart.gif.

1 Feb 2010, 10:43 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: adding shopping cart image to shopping cart sidebox?

Note: this is an old mod which I have not yet brought up to my current standards of flexibility. If you want to use jpegs instead of gifs, you will need to edit a file.
In /includes/templates/your_template/common/tpl_box_default_left.php, find```php
//image titles - box header image if file exists 2007-10-04
$title = (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/boxhead-' . $box_id . '.gif') ? zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/boxhead-' . $box_id . '.gif') : $title);
if ($title_link) {
if (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/boxhead-' . $box_id . '.gif')) {
$title = '<a href="' . zen_href_link($title_link) . '">' . $title . '</a>';
} else {
$title = '<a href="' . zen_href_link($title_link) . '">' . $title . BOX_HEADING_LINKS . '</a>';
}
}
//

1 Feb 2010, 10:50 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: adding shopping cart image to shopping cart sidebox?

the pic name is cart.jpg and is located in my admin/images directory.

Files in /admin/images/ will not be found by the storefront output code. If you are going to do the manual edit method, you need to put the file in the base /images/ folder, not
/admin/images/.

2 Feb 2010, 12:19 PM
#7
bonheddwr avatar

bonheddwr

Zen Follower

Join Date:
Jun 2007
Location:
Cymru
Posts:
124
Plugin Contributions:
0

Re: adding shopping cart image to shopping cart sidebox?

This looks good, but have you got a list of the names that we need to give the gif files for the sideboxes?

i.e. the source code for my language box is:

<!--// bof: languages //-->
<div class="rightBoxContainer" id="languages" style="width: 210px">
<h3 class="rightBoxHeading" id="languagesHeading">Languages</h3>
<div id="languagesContent" class="sideBoxContent centeredContent"><a href="[URL="http://www.zen-cart.com/forum/view-source:http://www.cadwyngifts.com/shopping_cart.html?language=en&number_of_uploads=0"]http://www.cadwyngifts.com/shopping_cart.html?language=en&number_of_uploads=0[/URL]"><img src="[URL="http://www.zen-cart.com/forum/view-source:http://www.cadwyngifts.com/includes/languages/english/images/icon.gif"]includes/languages/english/images/icon.gif[/URL]" alt="English" title=" English " width="91" height="27" /></a>  <a href="[URL="http://www.zen-cart.com/forum/view-source:http://www.cadwyngifts.com/shopping_cart.html?language=cy&number_of_uploads=0"]http://www.cadwyngifts.com/shopping_cart.html?language=cy&number_of_uploads=0[/URL]"><img src="[URL="http://www.zen-cart.com/forum/view-source:http://www.cadwyngifts.com/includes/languages/cymraeg/images/icon.gif"]includes/languages/cymraeg/images/icon.gif[/URL]" alt="Cymraeg" title=" Cymraeg " width="91" height="27" /></a>  <br /></div></div>
<!--// eof: languages //-->
```What should I therefore name the gif file?
2 Feb 2010, 2:10 PM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: adding shopping cart image to shopping cart sidebox?

All sideboxes show their id at the top in view source:

<div class="rightBoxContainer" id="languages"

so you would use boxhead_languages.gif.

3 Feb 2010, 8:48 PM
#9
robertg avatar

robertg

Zen Follower

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

Re: adding shopping cart image to shopping cart sidebox?

Update: I am using the link you suggested "can I use an image for Sidebox Header. I put a copy of my Cart (cart.gif) into file includes/templates/Tte/images and uploaded to the server. I also had the same pic in base/images folder
I then went to includes/modules/sideboxes and in DEFINE_HEADING_SHOPPING_CART, <a href="http://30408.vws.magma.ca/TTEZENCART/images/cart.gif"></a>; I uploaded it to the server
I then went to my Stylesheet, and since I was only going to change the header on the right-side of the page I went to rightBoxHeading in stylesheet. This is what is there Now:.rightBoxHeading {
margin: 0em;
background-color: #3A558B;
padding: 0.2em 0em;
}
Now my problem is that I didn't understand the insruction of (background: url(../images/cart.gif)#ff6699.
I am not sure where and how i'm suppose to document the changes.
If you go to my site you will notice that on the right side colomn the lettering Shopping Cart is no longer there but the (more) is.
I need your help again, sorry to be such a pain.
Bob

4 Feb 2010, 3:36 PM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: adding shopping cart image to shopping cart sidebox?

That article gives an awkward method of doing the substitution, which cannot remove the [more]. Reverse what you have done and install Image Titles from Free Addons; this will automatically remove the [more] from the sidebox where you replace the text with an image.
Name the image boxhead-shoppingcart.gif and save it in
/includes/templates/Tte/buttons/english/. Done.

27 Aug 2010, 1:51 AM
#11
dingoman avatar

dingoman

New Zenner

Join Date:
Apr 2010
Posts:
6
Plugin Contributions:
0

Re: adding shopping cart image to shopping cart sidebox?

gjh42:

That article gives an awkward method of doing the substitution, which cannot remove the [more]. Reverse what you have done and install Image Titles from Free Addons; this will automatically remove the [more] from the sidebox where you replace the text with an image.
Name the image boxhead-shoppingcart.gif and save it in
/includes/templates/Tte/buttons/english/. Done.

WOW!!! Thanks so much for that! never though it would work after all that but it did!

25 Oct 2011, 9:44 PM
#12
lissa8723 avatar

lissa8723

New Zenner

Join Date:
Feb 2010
Posts:
24
Plugin Contributions:
0

Re: adding shopping cart image to shopping cart sidebox?

Ive been searching for this and cant quite find the answer.
I want to know how to add the products images into the sidebox shopping cart besides the text thats just there.
So the customer can see a visual in the sidebox rather than just text.
Is there a way to do this?
Thanks :)

26 Oct 2011, 4:56 AM
#13
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: adding shopping cart image to shopping cart sidebox?

It would require some PHP recoding of the sidebox files, to look up and incorporate product images. Not a big job if you are familiar with PHP.

26 Oct 2011, 5:24 AM
#14
lissa8723 avatar

lissa8723

New Zenner

Join Date:
Feb 2010
Posts:
24
Plugin Contributions:
0

Re: adding shopping cart image to shopping cart sidebox?

im no pro...lol
but am willing to try if someone can give me a code.
thanks so much :laugh: