Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / Returning to product listing after putting product in shopping cart

Returning to product listing after putting product in shopping cart

Locked
This thread is locked. New replies are disabled.
15 Apr 2007, 7:26 AM
#1
trondos avatar

trondos

New Zenner

Join Date:
Oct 2006
Posts:
10
Plugin Contributions:
0

Post #1 by trondos

I'm really not sure where to post this question, but this might be a start...

I would like to return the customer to the product listing after she puts a product in the shopping cart. (almost like tusing the back button in the browser). The customers don't need to see the product info after the have chosen and picked the product.

Does anyone know if there's an easy way to do this - and then how to do it - or if my zen-cart installation needs major surgery to implement it?

Thanks very much

15 Apr 2007, 2:23 PM
#2
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Post #2 by rstevenson

I second that request.

I would like the add to cart button to behave exactly like a back button. If the user adds to cart from a category listing, they go back to (in effect, they remain on) that category listing. If from a product detail page, they go back to that page. As it works now, they end up on the details page in both cases.

Rob

Breakfast: the most important donut of the day.

15 Apr 2007, 3:07 PM
#3
ajeh avatar

ajeh

Oba-san

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

Post #3 by ajeh

You could turn off the Shop Shopping Cart in the Configuration ... My Store ...

Display Cart After Adding Product
Display the shopping cart after adding a product (or return back to their origin)

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

15 Apr 2007, 4:19 PM
#4
trondos avatar

trondos

New Zenner

Join Date:
Oct 2006
Posts:
10
Plugin Contributions:
0

Post #4 by trondos

Ajeh:

You could turn off the Shop Shopping Cart in the Configuration ... My Store ...

Sorry, no that just won't cut it. Of course that option has been set. My customers should not have to click themselves out of the shopping cart, but that's not the problem. When a customer clicks on a "BuyNow!" button (or similar) she should not be redirected to any other age unless she clicks on the product image.

//TrondOS

15 Apr 2007, 7:29 PM
#5
trondos avatar

trondos

New Zenner

Join Date:
Oct 2006
Posts:
10
Plugin Contributions:
0

Post #5 by trondos

OK. I solved the problem.

In product_listing.php I changed the line

$lc_button= zen_draw_form('cart_quantity_' . $listing->fields['products_id'], zen_href_link(zen_get_info_page($listing->fields['products_id']),...

to

$lc_button= zen_draw_form('cart_quantity_' . $listing->fields['products_id'], zen_href_link($_GET['main_page'],...

A crude solution, but it does the trick. I noticed that I had missed a vital piece of info. The BuyNow button actually has this functionality ... :blush:

//TrondOS

16 Apr 2007, 1:07 AM
#6
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Post #6 by rstevenson

Again I agree TrondOS. I too have the Display Cart After Adding Product set to false. And I too don't want the customer bounced to any page after adding something to the cart. It's disconcerting and confusing, and neither of those things promotes sales. :(

However, your solution ... ['main_page'] ... looks like it bounces the customer back to the main page -- not much of an improvement from my point of view. Does it do that? Or am I being too literal?

Rob

Breakfast: the most important donut of the day.

16 Apr 2007, 9:53 AM
#7
trondos avatar

trondos

New Zenner

Join Date:
Oct 2006
Posts:
10
Plugin Contributions:
0

Post #7 by trondos

Hi.

I have my solution working on a "shop in progress" at www.northernquilts.no/zen. It's in norwegian, but if u try this url and click the "Legg i kurven"-button you'll see how it works. It returns the customer to the page of the product he put in the cart. Not to the same position down the page, but it's a huge improvement to being shown the product info.

The url and parameters submitted by clicking the Buy-button makes it all happen. Look at the url when displaying a product list, it looks something like this: ```
www.yoursite.com/index.php?main_page=index&cPath=17_71

Which means that the main_page with a cPath in fact is the product listing.
 
I have been testing a bit and I can't find any cases in my shop where it fails. (It's not really my shop, it's my wife's, but I'm adapting zen-cart for a new version of her existing shop at [www.northernquilts.no](http://www.northernquilts.no))
 
//TrondOS
 
 
//TrondOS
16 Apr 2007, 8:56 PM
#8
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Post #8 by rstevenson

Yup, I was being too literal. :blush:

Thanks. I'll give that a try tomorrow, and report back.

Rob

Breakfast: the most important donut of the day.

17 Apr 2007, 1:45 PM
#9
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Post #9 by rstevenson

I see it works on your site. Unfortunately, when I replaced all occurrences of the string you showed above with the string below that, I got errors.

I replaced... zen_get_info_page($listing->fields['products_id']
with... $_GET['main_page']
seven times in the product_listing.php file. I must have made a mistake somewhere.

I did notice that the first part (the one I replaced) was enclosed in round brackets, but in your replacement, the closing bracket was missing. Maybe that was intentional?

Rob

Breakfast: the most important donut of the day.

18 Apr 2007, 9:22 AM
#10
trondos avatar

trondos

New Zenner

Join Date:
Oct 2006
Posts:
10
Plugin Contributions:
0

Post #10 by trondos

rstevenson:

I see it works on your site. Unfortunately, when I replaced all occurrences of the string you showed above with the string below that, I got errors.

I replaced... zen_get_info_page($listing->fields['products_id']
with... $_GET['main_page']
seven times in the product_listing.php file. I must have made a mistake somewhere.

I did notice that the first part (the one I replaced) was enclosed in round brackets, but in your replacement, the closing bracket was missing. Maybe that was intentional?

Rob

I only replaced it once. Just below the line; php // qty box with add to cart button , there's a line that (in my code) reads; ```php
$lc_button= zen_draw_form('cart_quantity_' . $listing->fields['products_id'], zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input align="top" type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']);

This is where the form that processes the add to cart button is created. If you change it anywhere else I really don't know what makes the code fail, but surely it does...
 
//TrondOS