Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    Aug 2011
    Posts
    121
    Plugin Contributions
    0

    Default Problem with my "buy now"

    Hi,

    If you go to this page: http://www.purenappycakes.com/boys-baby-gifts-c-7.html and click "buy now" on the cup cakes. then from the shopping cart click "back to shopping", then click "buy now" for any other item. The cup cake quantity goes up 1, instead of adding other items to the cart.
    I noticed the button for every product then links to the same item number.

    Any ideas to what could be causing this?

    Thanks

    Joe

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Bug with "buy now"

    It doesn't do it if the customer uses the Back browser button rather than Continue Shopping. What happens if you turn off your URL-rewriting mod and try again ?

  3. #3
    Join Date
    Aug 2011
    Posts
    121
    Plugin Contributions
    0

    Default Re: Bug with "buy now"

    sorry for the delayed response.

    after disabling it. the problem goes away. So there must be a problem in the .htaccess file? or the zen cart addon?

  4. #4
    Join Date
    Aug 2011
    Posts
    121
    Plugin Contributions
    0

    Default Re: Bug with "buy now"

    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.

  5. #5
    Join Date
    Jul 2004
    Location
    The Netherlands, Wierden
    Posts
    430
    Plugin Contributions
    0

    Default Re: Bug with "buy now"

    did you solve this...i've got the same problem

  6. #6
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Bug with "buy now"

    Quote Originally Posted by joecooper View Post
    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.
    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

  7. #7
    Join Date
    Jul 2004
    Location
    The Netherlands, Wierden
    Posts
    430
    Plugin Contributions
    0

    Default Re: Bug with "buy now"

    Quote Originally Posted by lhungil View Post
    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"?
    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

  8. #8
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Bug with "buy now"

    Quote Originally Posted by raimond View Post
    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

  9. #9
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Remove superflous &products_id

    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:
    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>';
      }
    }
    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...
    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

  10. #10
    Join Date
    Jul 2004
    Location
    The Netherlands, Wierden
    Posts
    430
    Plugin Contributions
    0

    Default Re: Bug with "buy now"

    Quote Originally Posted by lhungil View Post
    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.
    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

    Quote Originally Posted by lhungil View Post
    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?
    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)

    Quote Originally Posted by lhungil View Post
    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:
    Didn't work...same issue

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Extra "Buy Now" buttons for Buy 1, Buy 2, Buy 3, Buy 4 etc...
    By AndyVI in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 20 Mar 2011, 06:15 PM
  2. How to: new/featured main page - "buy now/details" change to "design" with attributes
    By ladybugmom in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Jan 2011, 11:23 AM
  3. Replies: 16
    Last Post: 21 Apr 2010, 07:38 PM
  4. "more info" instead of "buy now" (even with no attributes)
    By p m in forum Setting Up Categories, Products, Attributes
    Replies: 8
    Last Post: 2 Aug 2007, 03:24 AM
  5. Force "more info" instead of "buy now" (even with no attributes)
    By thechoyboy in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 31 Oct 2006, 12:37 AM

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