Zen Cart Logo
Forums / General Questions / How can I stop page from going to header after adding to cart?

How can I stop page from going to header after adding to cart?

Views: 1,376

Results 1 to 7 of 7
3 Oct 2012, 11:18 AM
#1
newbie76 avatar

newbie76

Zen Follower

Join Date:
Aug 2009
Posts:
100
Plugin Contributions:
0

How can I stop page from going to header after adding to cart?

I just wondered if anybody can help me here regarding the above question.

I have v 1.5.0 installed and have been changing the settings so it no longer goes to cart by default after adding a product to cart, so instead it shows the header messagestack, but this is where I am needing assistance to configure it.

First I will explain what I have done so far in case anybody else wishes to do similar in the future:

I have edited this so it shows further down the page by removing it from tpl_header.php (due to it messing with some custom images and text I have placed in my header), and placing it into the following files (near the top):

tpl_modules_product_listing.php
tpl_modules_products_new_listing.php
tpl_modules_products_featured_listing.php
tpl_modules_products_all_listing.php

I have also edited the box that pops up from the default "Successfully added selected Product(s) to cart" to add the options to continue shopping or go to cart (with links).

I am happy with this part and it works exactly how I wanted it to.

BUT

My problem is on the product info page (tpl_product_info_display.php)

Again, I have pasted the messagestack box (with my links to include the option to continue shopping or go to cart), but the problem is I need to paste it near the top of the page as it goes to the top by default after adding a product, I know how to place the message where I want it, however, where I want it is below the add to cart box, but then the customer wouldn't see it as it takes them to the top of the page by default so I have had to place it near the top (above the description).

The problem here is I have the related products addon installed so I don't want my customers to be taken away from this when they add an item (hence turning off automatically going to the cart to begin with), I have added the words 'view related products below' to the message, but would still prefer it to display just below the add to cart box so the related products are in view after they have added the main (or primary) item to the cart.

I hope this makes sense (I tried explaining the best I could), so if anybody can tell me how to stop it from automatically going to the top of the page after adding a product that would be appreciated.

For example, here is a link to one of my products: http://www.prodemon.co.uk/games_consoles/games_consoles/sony_playstation_3_console_320gb_with_karate_kid_blu-ray

Thanks in advance!

3 Oct 2012, 1:51 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: How can I stop page from going to header after adding to cart?

From your source, it looks like you pasted the message code just above the product description, which is where it's displaying here, at least in Firefox. None of your styling is displaying in IE8.

3 Oct 2012, 3:46 PM
#3
newbie76 avatar

newbie76

Zen Follower

Join Date:
Aug 2009
Posts:
100
Plugin Contributions:
0

Re: How can I stop page from going to header after adding to cart?

stevesh:

From your source, it looks like you pasted the message code just above the product description, which is where it's displaying here, at least in Firefox. None of your styling is displaying in IE8.

Thanks for replying, yes, I did paste it directly above the description, but where I want it is below the add to cart box so the buyer can still see the related products (which I can move easily enough), the problem is after adding to cart the page automatically goes to the top, meaning the message will not be seen by the customer if I place it there, this is why I want to stop it from automatically going to the top after adding a product to cart and want the screen stay where it is.

I'm not sure why it's not showing the styling in IE8 to be honest but thanks for informing me (any ideas as to why this may be happening?), it's wierd because it's showing everything including top level categories, infor pages, contact, cart, new, featured, new products (you can even add to cart directly from these pages), but it won't show 2nd or 3rd level categories or product info pages, this is even though I haven't changed anything to do with those since it was working in IE, so my guess is it must just be an incompatibility issue with one of microsofts recent updates and one (or more) of my addons, as I have several colour schemes available for my template (in it's raw state) and it all shows in another template, but wouldn't have a clue as to how to fix it (for example 2nd or 3rd level categories are coded no different to top level, nor do they have different settings), so must be something in IE clashing surely?

Thanks

3 Oct 2012, 4:24 PM
#4
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: How can I stop page from going to header after adding to cart?

It looks like it reloads the page to display that message, which will move the page to the top. Maybe someone else will have an idea how to change that.

I would guess your IE problem might be caused by the URL rewriting mod you use, but I don't use them, so I can't help there either except to suggest you turn the rewriting off temporarily and see if the problem goes away.

You also might try removing the stylesheet 20copy.css - it may be interfering with the other sheets.

3 Oct 2012, 4:39 PM
#5
newbie76 avatar

newbie76

Zen Follower

Join Date:
Aug 2009
Posts:
100
Plugin Contributions:
0

Re: How can I stop page from going to header after adding to cart?

stevesh:

It looks like it reloads the page to display that message, which will move the page to the top. Maybe someone else will have an idea how to change that.

I would guess your IE problem might be caused by the URL rewriting mod you use, but I don't use them, so I can't help there either except to suggest you turn the rewriting off temporarily and see if the problem goes away.

You also might try removing the stylesheet 20copy.css - it may be interfering with the other sheets.

Thanks Steve!!!

Disabling the seo mod has got it working again in IE8, when I first installed it I was still on IE7 and it was working fine, so it must just be an incompatibility issue (which would explain my drop in sales and stupidly high bounce rate (approx 70%)), I have also removed the stylesheet copy, this was an oversight on my part when testing something new as I didn't want to overwrite the original but the intention was to delete it ages ago.

Thanks again!

EDIT: Forgot to say I was using CEON URI Mapping to rewrite

Anyone got any ideas how I could implement a static message upon adding to cart from the product info page (even if it's done in javascript without reloading the page / going to the top)?

As can be seen from my site, I have done a lot of work myself but I'm really stuck here (I wouldn't ask otherwise).

Thanks in advance!

3 Oct 2012, 4:56 PM
#6
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: How can I stop page from going to header after adding to cart?

It would probably have to be done in Javascript, and I'm not coder enough to help. One possible kludge would be to move the message back to the top of the page and use an animated GIF as a background image to draw the customer's eye. Or maybe this is a solution in search of a problem - have you had customers complain they don't know when they've add something to the cart ?

3 Oct 2012, 6:08 PM
#7
newbie76 avatar

newbie76

Zen Follower

Join Date:
Aug 2009
Posts:
100
Plugin Contributions:
0

Re: How can I stop page from going to header after adding to cart?

stevesh:

It would probably have to be done in Javascript, and I'm not coder enough to help. One possible kludge would be to move the message back to the top of the page and use an animated GIF as a background image to draw the customer's eye. Or maybe this is a solution in search of a problem - have you had customers complain they don't know when they've add something to the cart ?
Not yet it's just a problem that I am forseeing, I have only recently changed the setting to false for showing the cart as it takes the customer away from the related items, so it's more of an attempt to promote upselling really (and this is why I have it above the description for the time being as it can be seen after the page goes to the top, whereas it couldn't if I had the message where I want it.

Hopefully someone can advise as I really don't want to draw customers away from related products, especially like phones upselling accessories, consoles upselling games, etc. and I have spent literally hours trying to figure something out and just going round in circles unfortunately.

Thanks for alll your other help anyway, much appreciated.