
Originally Posted by
Mikey D
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_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>';
// change to:
$lc_button= zen_draw_form('cart_quantity', zen_href_link(FILENAME_DEFAULT, 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>';
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!
Bookmarks