Forums / General Questions / Adding To Cart Via Product Listing without going to the Product Info Page

Adding To Cart Via Product Listing without going to the Product Info Page

Views: 1,598

Results 1 to 17 of 17
8 Jan 2013, 5:50 PM
#1
schobook avatar

schobook

New Zenner

Join Date:
Jul 2012
Posts:
52
Plugin Contributions:
0

Adding To Cart Via Product Listing without going to the Product Info Page

What could I do to make it so that when a customer clicks "add to card" via product listing it does not jump to the product info page. I would like it to say on the same page, just like every other site. Please check out this site Walmart...

http://www.walmart.com/cp/Anime-Action/1010220

Click on any item in the product listing and it adds the selected item to your cart without going to another page.

I have been searching for a solution for days and have found nothing that works. At least not one that works in my version of Zen Cart. How can I achieve this?

Thank you,

8 Jan 2013, 6:22 PM
#2
stevesh avatar

stevesh

Black Belt

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

Re: Adding To Cart Via Product Listing without going to the Product Info Page

Hard to say without seeing your site, but setting Admin - Configuration - Product Listing - Display Multiple Products Qty Box Status and Set Button Location to 0 does that for me.

8 Jan 2013, 6:56 PM
#3
gjh42 avatar

gjh42

Black Belt

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

Re: Adding To Cart Via Product Listing without going to the Product Info Page

If your products have any attributes (even a single "download type" attribute), they cannot be added to cart without first going to the product info page to select the attribute(s). In most cases, this is a functional necessity, though a single download attribute has nothing to choose and is just an artifact of the system setup.

8 Jan 2013, 7:26 PM
#4
schobook avatar

schobook

New Zenner

Join Date:
Jul 2012
Posts:
52
Plugin Contributions:
0

Re: Adding To Cart Via Product Listing without going to the Product Info Page

stevesh:

Hard to say without seeing your site, but setting Admin - Configuration - Product Listing - Display Multiple Products Qty Box Status and Set Button Location to 0 does that for me.My site is already set up like that, it does not really do what I am looking for. I put the link at the end of this post. Thanks,

stevesh:

If your products have any attributes (even a single "download type" attribute), they cannot be added to cart without first going to the product info page to select the attribute(s). In most cases, this is a functional necessity, though a single download attribute has nothing to choose and is just an artifact of the system setup.I don't have any attributes on any products but I understand what you are talking about. Thanks,

Here is a link to my site.

http://www.schobookcollectibles.com/index.php?main_page=index&cPath=67_148

Click on "Add to Cart" on one of the items and it brings you to the item info page. I want it to stay on the same page so a customer can easily continue shopping without losing their place or having to hit the back button all the time.

8 Jan 2013, 7:33 PM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: Adding To Cart Via Product Listing without going to the Product Info Page

There was a code change in a recent version to make the return go to the original page rather than the product info page... perhaps that was in v1.5.1?

Change the setting stevesh mentioned to 1, 2 or 3 to make the "add" function happen after all qty selections have been made and a button at top/bottom of page is clicked.

8 Jan 2013, 7:37 PM
#6
schobook avatar

schobook

New Zenner

Join Date:
Jul 2012
Posts:
52
Plugin Contributions:
0

Re: Adding To Cart Via Product Listing without going to the Product Info Page

I would rather not upgrade since it can cause serious problems with some of the mods I have installed.

I found this here

http://www.zen-cart.com/showthread.php?196116-Add-to-cart-button-jumps-to-product-info-page

but it does not work, since I have 1.5. Do you know where I can find a code that I can manually put it to make it happen?

Thanks,

8 Jan 2013, 7:44 PM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: Adding To Cart Via Product Listing without going to the Product Info Page

Do you know it doesn't work, or are you assuming it won't work? Have you tried it on a testing copy of your site?

It probably would have been better to continue the discussion on the other thread, where solutions have been posted, instead of starting all over again.

8 Jan 2013, 7:49 PM
#8
schobook avatar

schobook

New Zenner

Join Date:
Jul 2012
Posts:
52
Plugin Contributions:
0

Re: Adding To Cart Via Product Listing without going to the Product Info Page

Its a really old post, and since the last guys question was not responded to I wanted to make a new thread. Also since it is a different version of Zen Cart. And yes I did give it a try, all it did was make my product listings disappear completely. I tried multiple times.

Thanks,

10 Jan 2013, 4:19 PM
#10
schobook avatar

schobook

New Zenner

Join Date:
Jul 2012
Posts:
52
Plugin Contributions:
0

Re: Adding To Cart Via Product Listing without going to the Product Info Page

Can anyone else help me with this? I found out more information that may be useful.

If you click add to cart via new products or feature products listings it does exactly what I want it to do. You add something to the cart and it stays on the same page. Try it out here.

http://www.schobookcollectibles.com/index.php?main_page=products_new

I would like it to work on all product listing pages. If you click add to cart here it jumps to the items info and I don't want that to happen.

http://www.schobookcollectibles.com/index.php?main_page=index&cPath=68_75

Thanks,

10 Jan 2013, 5:40 PM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: Adding To Cart Via Product Listing without going to the Product Info Page

I observe that they are different "add to cart" mechanisms - the new products gives a link path in the bottom of the page when you hover on the button, while the product info page does not. So I am not sure they are really comparable or usable for tweaking the product info behavior.

What do you have for Configuration > My Store > Display Cart After Adding Product?
When that is set to false, adding from the product listing does go back to the listing page, in my v1.5.1 test site.

I would rather not upgrade since it can cause serious problems with some of the mods I have installed. What mods have serious issues between v1.5.0 and v1.5.1? Most are fully compatible, and most of the rest should require only minor upgrades.

10 Jan 2013, 7:12 PM
#12
schobook avatar

schobook

New Zenner

Join Date:
Jul 2012
Posts:
52
Plugin Contributions:
0

Re: Adding To Cart Via Product Listing without going to the Product Info Page

gjh42:

I observe that they are different "add to cart" mechanisms - the new products gives a link path in the bottom of the page when you hover on the button, while the product info page does not. So I am not sure they are really comparable or usable for tweaking the product info behavior.

What do you have for Configuration > My Store > Display Cart After Adding Product?
When that is set to false, adding from the product listing does go back to the listing page, in my v1.5.1 test site.

What mods have serious issues between v1.5.0 and v1.5.1? Most are fully compatible, and most of the rest should require only minor upgrades.
"What do you have for Configuration > My Store > Display Cart After Adding Product?" It set to false.

I have
Monthly_Sales-Tax_Summary-v1.4
Drolex Image Viewer v1.0.1
USPS v15 Ratev3
a reward points mod (forget the one I used)
wishlist_09 (currently have this uninstalled but I would like to have it back in the future).

I have just read the some people have problems when upgrading for one to another. Do you know what codes are used when you click add to cart? I can just update those selected files if its possible.

Thanks,

10 Jan 2013, 7:51 PM
#13
gjh42 avatar

gjh42

Black Belt

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

Re: Adding To Cart Via Product Listing without going to the Product Info Page

Such partial upgrades are not recommended and just might cause malfunctions where the file versions interact with other (older) files... that can only be known by a detailed examination of the code and its interactions with outside functions.

You might be able to replace the product listing files, but the issue may be in a class or function file elsewhere, mixed with other functionalities that need to stay the same to work with the older version installation. Overall it sounds like a considerable risk and a lot of work to make something non-standard. I would rather advise really investigating the mods to see if they are compatible, or what it would take to upgrade them if necessary. Any popular mod that is not v1.5.1-compatible will have a user base that wants it upgraded, so you might get together with others on that.

10 Jan 2013, 10:57 PM
#14
schobook avatar

schobook

New Zenner

Join Date:
Jul 2012
Posts:
52
Plugin Contributions:
0

Re: Adding To Cart Via Product Listing without going to the Product Info Page

I guess I will take a chance and upgrade. I can always go back with a restore I think. All of my admin setting stay the same right?

11 Jan 2013, 5:32 PM
#15
gjh42 avatar

gjh42

Black Belt

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

Re: Adding To Cart Via Product Listing without going to the Product Info Page

Admin settings are stored in the database, so if you import/save your current db, settings will be retained.

You should try the upgrade on a clone of your live site (copy the files and the database and change the configure.php to point to the new db) so you are not risking your live store in any way.

12 Jan 2013, 1:59 AM
#16
schobook avatar

schobook

New Zenner

Join Date:
Jul 2012
Posts:
52
Plugin Contributions:
0

Re: Adding To Cart Via Product Listing without going to the Product Info Page

I was actually thinking... Is there something that can be put on the product info's page that is a back button to the previous page you were on? Kind of like the Return to Product listing but instead of going back to the first page of the product listing you go to the page you were last on.

Thanks,

13 Jan 2013, 5:10 PM
#17
schobook avatar

schobook

New Zenner

Join Date:
Jul 2012
Posts:
52
Plugin Contributions:
0

Re: Adding To Cart Via Product Listing without going to the Product Info Page

Never mind. I found the solution to staying on the same page. Odd since I was actually searching for something else and came across it...

I had to edit the file in /includes/modules/product_listing.php

and replace this code with the existing one

// qty box with add to cart button
            if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
//              $lc_button= zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($listing->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';
              $lc_button= zen_draw_form('cart_quantity', 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 type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';

Thanks for you help.