After clicking the "buy now" link, the "continue shopping" button then contains the product_id of the last product added to the cart.
"&products_id=142". Is there anyway to stop this being added, as im guessing the re-write mod is using this.
After clicking the "buy now" link, the "continue shopping" button then contains the product_id of the last product added to the cart.
"&products_id=142". Is there anyway to stop this being added, as im guessing the re-write mod is using this.
did you solve this...i've got the same problem
So just to clarify this for anyone else reading this post. This is not a problem specific to using a "re-write" mod
A clean install of Zen Cart with no plugins / modules installed will add "&products_id=142" to the end of the URL in the history when "Display Product Add to Cart Button = 2" and "Display Multiple Products Qty Box Status = 0". With these options enabled Zen Cart's default template adds the "&products_id=142" to the form as the "action".
So basically the user's template is adding the "&products_id=142" to the form action which is the cause of if appearing in the URL.
I have not tested against Zen Cart 1.3.x. In Zen Cart 1.5.x $_GET is not used by the routine to add a product to the shopping cart ($_POST is used instead) so clicking "continue shopping" does not add additional products. This was verified with a clean install of Zen Cart 1.5.0, a clean install of Zen Cart 1.5.1, and an install of Zen Cart 1.5.1 w/ one of the common plugins to generate alternative URLs.
So the question is: "If you are running Zen Cart 1.5.x, what is different in your installation (or settings) which causes $_GET to be used by the routine to add a product to the shopping cart"?
The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker
I just installed a clean ZenCart 1.5.1 with demo data...to get this same issue
Then I go to the backend Configuration - Product Listing and set Display Multiple Products Qty Box Status and Set Button Location to 0
then I go to the frontend and go to the category DVD Movies :: Action.......then i start to "click buy" - "continue shopping" and repeat that several times with of course different products in that categorie.
Then I install Ú-SEO URL, and do the same thing.
Wat happens: I click on Die Hard With A Vengeance Linked - Buy Now -- and Continue shopping
Then I click on Fire Down Below Linked - Buy Now
And two times Die Hard With A Vengeance Linked in my card
It makes no sense...sometimes after 2 clicks and sometimes after 10 clicks
You are right, it makes no sense. Doing this same test on both a clean Zen Cart 1.5.1 and a clean Zen Cart 1.5.1 w/ the latest version of "Ultimate URLs" does not exhibit this behavior.
Just to make sure it was not random I ran up and down the entire list of demo products under "DVD Movies" -> "Action" twice... Clicking "add to cart" product 1, "continue shopping", "add to cart" product 1, "continue shopping", "add to cart" product 3, etc. Still unable to duplicate this behavior in the above environments.
Are you downloading Zen Cart 1.5.1 manually from this site and running zc_install? What are you using up upload the files? Is there a proxy between you and the server? What browser are you using? What "add-ons" are installed in your browser? Have you tried clearing the cache, cookies, and saved form data?
When Zen Cart 1.5.1 encounters "?action=add_product&products_id=18" the "&products_id=18" is not used or read... The "action=add_product" triggers the shopping cart to add $_POST['products_id'] and does nothing with $_GET['products_id']... And the "continue shopping" link does not contain "action=" at all, so the code to add a cart is not called when clicking on "continue shopping".
The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker
As $_GET['products_id'] is not used by the "add_product" action in Zen Cart 1.5.1 you can modify the core Zen Cart code to stop adding the superfluous "&products_id=18" to the form (only happens with the settings you mentioned earlier in this thread).
I do not recommend modifying core Zen Cart files except as a last resort. Best practice is to avoid modifying core Zen Cart files whenever possible to avoid future upgrade entanglements and issues.
While this should NOT be needed... Open up "/includes/modules/product_listing.php". For Zen Cart 1.5.1 go to line 136 and remove "products_id" from the URL. When you are done it should look something like this:
Note: The only way I can see this affecting anything is if you have other modifications made to your Zen Cart installation which attempt to use $_GET['products_id'] instead of $_POST['products_id']... Such as AJAX calls implemented by a 3rd party modification to Zen Cart... Or corrupted files...Code:} else { // 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($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=add_product'), '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>'; } else { $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>'; } }
The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker
Yes, it is random...when i do it again and again...different products will be stored in the shopping cart. Just random...
You did set the Configuration - Product Listing and set Display Multiple Products Qty Box Status and Set Button Location to 0
Of course I downloaded the ZC151 from this site and run the zc_install. Downloaded and installed the latest version of "Ultimate URLs". No proxy. Tried local and on normal webhost. Chrome and Firefox tested, clean browser (clear cache and cookies)
Didn't work...same issue![]()
Yup, I did. My tests along with reading through the Zen Cart code is why it really does not make sense... I even tried guest vs. logged into an account (clean Zen Cart 1.5.x and clean Zen Cart 1.5.1 w/ USU)... Not saying you are not seeing the issue in your installation (you would not be here if you were not)... Just saying I have not yet been able to duplicate the behavior...
Had to ask, sometimes the "automated" install scripts bork things. What is the OS of the local computer?
Link to the "test" site so we can see the generated HTML (and form fields - one per each "add to cart")? Any chance the form is being clicked upon before the browser finishes loading and rendering the HTML (such as on a slower server / connection)?
Can you check and make sure the browser is set to not "save" form data? ($_POST is populated from a form... Maybe something in the browser is repopulating the form data with old data? Try running the browser with all add-on's disabled?)
This means you are definitely going to want to check what data is being embedded in the forms (in particular the hidden products_id input field). The generated form + content comes from Zen Cart's core code unless a theme or module has been installed which overrides the code. The same is true for the code handling when "action=add_product" is one of the query parameters in a URL...
Last edited by lhungil; 16 Oct 2013 at 04:49 PM.
The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker
I have tried now also with (besides chrome and firefox) also with a clean safari and ie (no extensions installled, never use them), but same.
If you want I can install a clean zc151 demo and install later USEO...give you grant access to backend and ftp.