Zen Cart Logo
Forums / General Questions / Add jpeg or banner to shopping cart view

Add jpeg or banner to shopping cart view

Views: 1,575

Results 1 to 15 of 15
22 Jan 2013, 9:54 PM
#1
amyleew avatar

amyleew

Zen Follower

Join Date:
Jul 2009
Posts:
159
Plugin Contributions:
0

Add jpeg or banner to shopping cart view

I'm just wondering if it is possible to add an image above the shopping cart contents? When someone clicks view cart and it takes them to the page where everything in the cart is displayed (not the sidebar view), I would like an image to appear above the cart contents.

Amy

22 Jan 2013, 9:59 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Add jpeg or banner to shopping cart view

If you are talking about this page

/index.php?main_page=shopping_cart

Then the default lists this as an option

You may want to add some instructions for using the shopping cart here. (defined in includes/languages/english/shopping_cart.php)

Remember to copy the file for your template

22 Jan 2013, 10:54 PM
#3
amyleew avatar

amyleew

Zen Follower

Join Date:
Jul 2009
Posts:
159
Plugin Contributions:
0

Re: Add jpeg or banner to shopping cart view

Oh I forgot about that spot. What code to I insert to add a jpeg?

23 Jan 2013, 5:29 AM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Add jpeg or banner to shopping cart view

What code to I insert to add a jpeg?
Standard html image code

image src= etc...

23 Jan 2013, 5:39 AM
#5
amyleew avatar

amyleew

Zen Follower

Join Date:
Jul 2009
Posts:
159
Plugin Contributions:
0

Re: Add jpeg or banner to shopping cart view

By etc do you mean filename.jpg?

23 Jan 2013, 6:34 AM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: Add jpeg or banner to shopping cart view

You need to use standard HTML <img> code to display an image. There are multitudes of tutorials on the web about using images in HTML.

23 Jan 2013, 6:41 AM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: Add jpeg or banner to shopping cart view

http://www.w3schools.com/tags/tag_img.asp

You need to either specify the full URL of the image starting with http://, or the relative location starting with images/ (assuming the image is under your Zen Cart /images/ folder).

23 Jan 2013, 9:33 AM
#8
amyleew avatar

amyleew

Zen Follower

Join Date:
Jul 2009
Posts:
159
Plugin Contributions:
0

Re: Add jpeg or banner to shopping cart view

I'm trying really hard to work this out but I just have no idea. This is the line I have in my shopping_cart.php:

define('TEXT_INFORMATION', 'Shipping is based on the total weight of your items. Please take note of shipping weight displayed below before proceeding to checkout.');

and I am attempting to add:

<img src="/images/FreePostage.jpg" alt="Free Postage" height="321" width="600">

but I don't know where to put it. I tried putting it at the end of the text line and on a line of its own but I have no knowledge of code so I can't tell if what I'm doing is wrong or if the <img line is wrong.

23 Jan 2013, 2:26 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Add jpeg or banner to shopping cart view

Something like:

define('TEXT_INFORMATION', 'You may want to add some instructions for using the shopping cart here. (defined in includes/languages/english/shopping_cart.php' . '<br>' .
'<img src="/images/FreePostage.jpg" alt="Free Postage" height="321" width="600">');

should work ...

NOTE: that is an awfully huge image for the shopping_cart and would drive me crazy ...

23 Jan 2013, 8:31 PM
#10
amyleew avatar

amyleew

Zen Follower

Join Date:
Jul 2009
Posts:
159
Plugin Contributions:
0

Re: Add jpeg or banner to shopping cart view

Thanks I will give this a try. I don't know what size to make the image so I just put a huge one in so I can see it then reduce it until I like the size.

23 Jan 2013, 9:11 PM
#11
amyleew avatar

amyleew

Zen Follower

Join Date:
Jul 2009
Posts:
159
Plugin Contributions:
0

Re: Add jpeg or banner to shopping cart view

Thanks. I was able to insert the image. I am now trying to center it on the page using align="middle" but no matter where I seem to stick it, nothing happens. This is what I have tried:

'<img src="/images/FreePostage.jpg" alt="Free Postage" align="middle">');

I took out the height and width because I just want to control that by resizing it in photoshop because I will want to change the picture every now and then.

23 Jan 2013, 9:12 PM
#12
gjh42 avatar

gjh42

Black Belt

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

Re: Add jpeg or banner to shopping cart view

When you decide on the right size for the image, resize the actual image file (saving an original copy of course) to be exactly that size. Then the browser won't have to do a quick & dirty resizing of a larger image, and page processing/downloading will be faster.

OK, nevermind:) You are doing that the right way.
Forget about using align in the <img> code; I believe that is deprecated for HTML5 anyway. Just control the positioning with CSS in your stylesheet.

23 Jan 2013, 10:14 PM
#13
gjh42 avatar

gjh42

Black Belt

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

Re: Add jpeg or banner to shopping cart view

"align" is actually deprecated in HTML 4.01, and removed from HTML5... so you can't use it for future applications even if you want to.

23 Jan 2013, 10:44 PM
#14
amyleew avatar

amyleew

Zen Follower

Join Date:
Jul 2009
Posts:
159
Plugin Contributions:
0

Re: Add jpeg or banner to shopping cart view

I didn't know I couldn't use align. I got that from the website link you posted.

Is there no other way to do it other than in the stylesheet? Clearly I have no idea what I'm doing so I don't know what to do in the stylesheet in the slightest to get it to center.

23 Jan 2013, 11:14 PM
#15
gjh42 avatar

gjh42

Black Belt

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

Re: Add jpeg or banner to shopping cart view

Add to your stylesheet

#cartInstructionsDisplay img {display: block; margin: auto;}