Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18
  1. #11
    Join Date
    Jul 2012
    Posts
    16,799
    Plugin Contributions
    17

    Default Re: Product listing page "add to cart" button redirects to product info

    So the plugin resolves the issue of opening the product info page upon increasing/decreasing the quantity by well, not doing so. As stated in the plugin/forum thread, the images are not the top pick, but that can be resolved by using the picture of choice.

    To me it seems like it resolves the general issue, and perhaps some modification to further get what you're looking.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #12
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,849
    Plugin Contributions
    11

    Default Re: Product listing page "add to cart" button redirects to product info

    mikey,
    allow me to throw my 2 cents in but you already have members of the a-team on the case.

    it seems that the ajax-to-cart functionality would resolve your problem, as you would just stay on the current page without even a need to refresh the whole page. when i go to your page, and add something to the cart, i see EXACTLY the behavior that you are talking about. i also see some console errors that suggest to me you "might" already have that ajax add-to-cart functionality in your responsive avonlee contempo template but you are not loading jquery prior to that call. so your jquery call fails and then you are going to some default behavior that might be addressed via a configuration setting that others have talked about.

    i know nothing about that template, but i "think" if you get those console errors addressed, everything might work exactly the way you want it. (you can see console errors via developer tools which are mostly accessed by pressing the F12 key when on your page, although it varies based on what browser you are using.)

    good luck!
    author of square Webpay.
    mxWorks now has Apple Pay and Google Pay. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  3. #13
    Join Date
    Jan 2012
    Location
    Canada
    Posts
    16
    Plugin Contributions
    0

    Default Re: Product listing page "add to cart" button redirects to product info

    Thanks, I fixed up some of those bugs you pointed out. Jquery wasn't loading before my other scripts. That didn't resolve my issue.

    I don't seem to have Ajax-to-cart, so I tried installing the addon you mentioned. It's giving me a few problems, that might be my template and my mods messing with it. It doesn't display the cart contents, and there's no pop-up explaining anything has been added to the cart. Also, I have to modify it to work on the product listing page.

    If my zen-cart isn't reloading the page the way it's supposed to in the first place, I don't see how any number of addons will make it start working again. Something has to be in there changing the way Zencart should be working right? It's just seems like a lot of work modifying addons just to see if they work in my scenario.
    Sorry I'm just a little frustrated at the moment. You guys have been very helpful, and I appreciate your responses.

  4. #14
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,849
    Plugin Contributions
    11

    Default Re: Product listing page "add to cart" button redirects to product info

    Quote Originally Posted by Mikey D View Post
    If my zen-cart isn't reloading the page the way it's supposed to in the first place, I don't see how any number of addons will make it start working again. Something has to be in there changing the way Zencart should be working right? It's just seems like a lot of work modifying addons just to see if they work in my scenario.
    Sorry I'm just a little frustrated at the moment. You guys have been very helpful, and I appreciate your responses.
    mikey d,
    no need to apologize. i think we have all been there.

    with regards to the statement above, when working properly an ajax request will "hijack" the click to add to cart and do something else, so if you could get the ajax request to work, it would not matter that the other part does not work the way you want to it.... except for those users on older browsers who do not use javascript. but getting ajax requests to work can be a lot of work. and i'm still seeing some weird jquery error on the console.

    you can tell if you have the Ajax Add to Cart module installed if there is a menu item for it on the admin -> configuration pulldown. but again, in my experience, ajax requests get more complex.

    let's if we can point you in a better direction. with regards to how you are configured and what you want it to do, i'm not sure any of the ZC configurations will change it. i could be wrong... and if someone knows better, by all means chime in....

    i've reviewed all of the comments. let's see if we get this right:

    - you don't want to go to the shopping cart after adding something. the DISPLAY_CART configuration is set to false. all good.
    - you are NOT making use of the multiple_products_cart_quantity form. you do not like this because you then lose your add to cart button associated with each item on the category display. if you made use of this form, which only has a button on the top of the form and bottom of the form, the resulting behavior would be what you want.
    - instead you are using the cart_quantity form which gives you the add-to-cart button, but instead of refreshing this page, you end up on the product information page.

    and there is the dilemma. you like those individual buttons which are only available with the cart_quantity form, but you want the resulting page to be the result of the multiple_add_to_cart form. i think that is correct, please let me know if not...

    in looking at the code, i'm not sure ZC will do what you want without making some custom changes. it looks like you would need to change the:

    includes/modules/product_listing.php

    script; which may be overridden already and be here:

    includes/modules/responsive_avonlee_contempo/product_listing.php

    (i have zero experience with this template.)

    i'm going to take a wild shot on this one. you might be able to change the code as below, and this might work. no guarantees. around line 136 look for:

    PHP Code:
     $lc_buttonzen_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_CARTBUTTON_IN_CART_ALT) . '</form>';

    // change to:

     
    $lc_buttonzen_draw_form('cart_quantity'zen_href_link(FILENAME_DEFAULTzen_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_CARTBUTTON_IN_CART_ALT) . '</form>'
    you are only changing the $_GET['main_page'] to FILENAME_DEFAULT.

    without having a test server set up the exact way here you have it, i can not tell you if it will work, but it could be worth a shot.

    good luck!
    author of square Webpay.
    mxWorks now has Apple Pay and Google Pay. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  5. #15
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,410
    Plugin Contributions
    94

    Default Re: Product listing page "add to cart" button redirects to product info

    What happens if you (temporarily) disable your URL rewriter? Does the problem persist?

    I keep poking because a fresh Zen Cart install with a change to Configuration->My Store->Display Cart After Adding Product set to false (see http://vinosdefrutastropicales.com/d...=2_20&sort=20a) provides the functionality you're looking for. When you click the "add multiple" button, the items are added to the cart and the listing page is redisplayed.

    That demo site is a "slightly-modified" Zen Cart v1.5.4 site.

  6. #16
    Join Date
    Jul 2012
    Posts
    16,799
    Plugin Contributions
    17

    Default Re: Product listing page "add to cart" button redirects to product info

    Quote Originally Posted by lat9 View Post
    What happens if you (temporarily) disable your URL rewriter? Does the problem persist?

    I keep poking because a fresh Zen Cart install with a change to Configuration->My Store->Display Cart After Adding Product set to false (see http://vinosdefrutastropicales.com/d...=2_20&sort=20a) provides the functionality you're looking for. When you click the "add multiple" button, the items are added to the cart and the listing page is redisplayed.

    That demo site is a "slightly-modified" Zen Cart v1.5.4 site.
    Two things related to the above link and a third related to the issue.

    1) The selection of multiple products top/bottom has been described as not so desired (though does provide the desired response).
    2) Similar to a post I made recently to help another out with their copying of a site/use of a new template/SSL issue, when attempting to add one of the products to the cart from the above link, am presented with a SSL security issue related to bootstrap that the certificate is for a different server/host than against the one "picked up". That's a side issue related to the referenced site and doesn't pertain to the issue of the OP.
    3) I tested operation of adding a product to the cart from product listing using one of my test sites, and obtained the result desired when each product has the add-to-cart button adjacent to it. I know that the plugin I referenced earlier isn't installed (at least the SQL isn't), but now am questioning what other changes were made to the software, because it is responding different than described as "normal". I plan to download a vanilla version of ZC 1.5.4 again to compare against this to see what I had changed on that site if anything and throw the code out there if it was modified. The test location was: http://template3.mc12345678.com/inde...index&cPath=64
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #17
    Join Date
    Jan 2012
    Location
    Canada
    Posts
    16
    Plugin Contributions
    0

    Default Re: Product listing page "add to cart" button redirects to product info

    I figured out the problem, It was a template issue. I was changing things and saw nothing, well that's because of a theme override file i just didn't notice. I was looking for an "override" folder, and wasn't seeing the theme folder in includes/modules. It was coded to keep going to the info page.

    The problem is fixed, I now stay on the page, and the banner pops up saying I've added the item to the cart.

    Carlwhat, that little bit of code helped me track down and fix the issue. But, everyone's help and patience was super awesome! Thank you!


  8. #18
    Join Date
    Mar 2018
    Location
    Alabama
    Posts
    61
    Plugin Contributions
    0

    Default Re: Product listing page "add to cart" button redirects to product info

    I am having the same problem, which file did you edit to fix your problem?

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. EasyPopulate problem: "Add to Cart" and "price" not showing on product info page
    By pcspot in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 29 Apr 2010, 08:06 AM
  2. Replies: 26
    Last Post: 19 Feb 2010, 02:56 AM
  3. Adding more than one button "add to cart" on product info page....
    By Celebrimbor in forum General Questions
    Replies: 14
    Last Post: 4 Feb 2010, 05:41 PM
  4. How to add a string to "product info" and "product listing"?
    By SanchoPanza in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 20 Dec 2007, 03:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR