Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Jul 2006
    Posts
    40
    Plugin Contributions
    0

    Default POST data is getting lost on the way to actionMultipleAddProduct

    Im not sure what caused it, and have tried rolling back changes for as long as i remember. This is a 1.3.5 cart that worked fine until I installed latest GCO module ( it think this is what broek it , bit reversing out change has not fixed it)

    Problem as follows
    ..... in shopping cart when productlist is displayed, when product list has form fields for quantity of product enabled example
    http://www.scanpancookware.com/featured-products/
    http://www.scanpancookware.com/products-all/
    when selecting one or more products and submitting
    the selected products are not being passed to the cart.
    ======================================================

    i created inserts into error_log to highlight status

    function actionMultipleAddProduct($goto, $parameters) {
    global $messageStack;
    if (isset($_POST['products_id'])) {
    error_log("DEBUG - POST of products id is set. Values are as follows :".join(',',$_POST['products_id']));

    and when I add values to form fields in product list and submit the log displays

    [28-Sep-2007 11:04:15] DEBUG - POST of products id is set. Values are as follows :1,0,0,0,0,0,0,0,0,0

    so as a result we never reach

    while ( list( $key, $val ) = each($_POST['products_id']) ) {

    so products are not added to cart.

    I have traced this to death, can anyone suggest what may interfere with the contents of a POST between the form submission and the arrival at the action ?

    This system uses magicSEO... i have tried with it enabled and disabled.

    drByte looked at this and a few others experts, no luck yet.... please help ...mostly suggestions on what conditions may interfere with the POST data en route to the action ?

    By the way ..i dont think its a PHP core config as I have another site on the same server www.swissdiamondstore.com that works fine.

    Any help is HUGELY appreciated ...

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: POST data is getting lost on the way to actionMultipleAddProduct

    This is a 1.3.5 cart that worked fine until I installed latest GCO module
    Not of immediate use, but for future reference: Always the best course before adding any thing to a live shop is to "Backup" files and DB just for this type of event.
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jul 2006
    Posts
    40
    Plugin Contributions
    0

    Default Re: POST data is getting lost on the way to actionMultipleAddProduct

    Quote Originally Posted by kobra View Post
    Not of immediate use, but for future reference: Always the best course before adding any thing to a live shop is to "Backup" files and DB just for this type of event.
    As mentioned in my post, latest changes were rolled back from backup. Problem remained, so it maybe that the problem was there before recent changes and was not noticed. ... thanks for commenting though

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: POST data is getting lost on the way to actionMultipleAddProduct

    Sorry, "rolling back" and restoring all from a backup are read as different to me.

    Did you require any DB alterations to install this?
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Jul 2006
    Posts
    40
    Plugin Contributions
    0

    Default Re: POST data is getting lost on the way to actionMultipleAddProduct

    Quote Originally Posted by kobra View Post
    Sorry, "rolling back" and restoring all from a backup are read as different to me.

    Did you require any DB alterations to install this?

    GCO required this change only

    update orders set orders_status = 100 where orders_status = 1 and payment_module_code = 'googlecheckout';
    update orders set orders_status = 101 where orders_status = 2 and payment_module_code = 'googlecheckout';
    update orders set orders_status = 102 where orders_status = 3 and payment_module_code = 'googlecheckout';

  6. #6
    Join Date
    Jul 2006
    Posts
    40
    Plugin Contributions
    0

    Default Re: POST data is getting lost on the way to actionMultipleAddProduct

    Believe it or not ....

    I have solved this problem by replacing in actionMultipleAddProduct

    while ( list( $key, $val ) = each($_POST['products_id']) ) {

    with

    foreach($_POST['products_id'] as $key=>$val) {

    Thanks to drbyte, Dan at IDG , and jiri from magic SEO for taking time to work on it ..these guys are GREAT !! for stepping up to help.

    but ... in the end, old fashioned debugging saved the day.

    Allan

  7. #7
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: POST data is getting lost on the way to actionMultipleAddProduct

    I'm glad you've got it working.
    I'm still a bit puzzled that it "works", considering that checking the value of $_POST before running the while/list was showing empty during earlier testing ...

    Was there anything else that you changed? (or, rather, left changed while doing many tests and didn't back out after testing)
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Jul 2006
    Posts
    40
    Plugin Contributions
    0

    Default Re: POST data is getting lost on the way to actionMultipleAddProduct

    Quote Originally Posted by DrByte View Post
    I'm glad you've got it working.
    I'm still a bit puzzled that it "works", considering that checking the value of $_POST before running the while/list was showing empty during earlier testing ...

    Was there anything else that you changed? (or, rather, left changed while doing many tests and didn't back out after testing)
    As far as I can tell , i removed all flags that I had inserted during the debug process. I was playing with various structures with ourput to error_log, and quite by fluke when I inserted the foreach, suddenly started to notice that it started to present the output of the $_POST, when i reverted to a while, the $_POST stopped displaying data. I tried a join(',',$_POST['products_id'] and it was showing erratic data.

    Even now, after the fact, if I revert to the "while", it breaks it again.

    Now why this works fine on 100K other ZC installs, and also on other ZC installs on the same server is beyond me...but for now ill settle for the fact that it works. Just wish I knew what else is broken as a result.

    Allan

  9. #9
    Join Date
    Apr 2005
    Location
    Calera, OK
    Posts
    76
    Plugin Contributions
    1

    Default Re: POST data is getting lost on the way to actionMultipleAddProduct

    So, any explanation of this? The behavour SHOULD be the same, they are equivalent. BUT, on our web site, exactly the same thing happens, replacing the while list each with foreach makes the problem go away. This is soundlng like a PHP bug perhaps? foreach is preferred anyway, but, I do not see any logical reason the 2 statement shoudl not behave the same, but they don't.

  10. #10
    Join Date
    Jul 2006
    Posts
    40
    Plugin Contributions
    0

    Default Re: POST data is getting lost on the way to actionMultipleAddProduct

    Well , im pleased that someone else has seen this problem and solved it the same way. I thought I was going crazy. Seems im not :-)

    Thanks

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Where are the code that handle the shipping estimator POST data
    By su35 in forum General Questions
    Replies: 2
    Last Post: 31 Jan 2014, 10:05 PM
  2. Replies: 2
    Last Post: 10 Jan 2013, 12:00 AM
  3. Replies: 2
    Last Post: 16 Jun 2011, 04:11 PM
  4. How do I import products in my newly hosted shop if i lost the data on phpmyadmin.
    By Oredayo in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 7 Oct 2010, 02:31 AM
  5. Getting rid of the sample data
    By mojara in forum Basic Configuration
    Replies: 2
    Last Post: 25 May 2010, 07:08 PM

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