Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2009
    Posts
    45
    Plugin Contributions
    0

    Default Back to Shopping Link

    I am using Zen Cart 1.3.9f

    I have the "add to Cart" button showing in the product listing. If you press that button it takes you to the cart. if you then press the "back to shopping" button it takes you to the product details page of the product you added... it doesnt take you back to the product list.

    If I change zen_back_link()'s session navigation path to -3 rather than -2 it works... but then ofcourse that makes it go all the way back to the product listing when adding to the cart from the product detail page.


    it seems that when pressing the Add to Cart button in the product listing page that an entry is wrongly put into $_SESSION['navigation']->path for the product detail page.

    I never navigated to that page so it shouldn't go into that session array.

    hopefully I am making sense :)

  2. #2
    Join Date
    Nov 2009
    Posts
    45
    Plugin Contributions
    0

    Default Re: Back to Shopping Link

    Well, the answer why was a little clearer then I thought it was. The "add to Cart" form used in the product listing takes you to the product info page which then adds the item to the cart and sends you off to the cart.

    There must be a way to fix this. I cant have people add something to the cart from the product list and be taken back to a page they never visited.

  3. #3
    Join Date
    Nov 2009
    Posts
    45
    Plugin Contributions
    0

    Default Re: Back to Shopping Link

    I fixed it.

    in includes/modules/product_listing.php

    changed:
    Code:
    line #136:   $lc_button= zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($listing->fields['products_id']), 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>';
    to:
    Code:
    line #136:   $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>';
    This makes the form submission process the 'add_product' action on the product listing page(simply changing the forms action url). the default zen cart way has the form submitting to the product_info page... which then wrongly puts in the navigation as having visited that page.

 

 

Similar Threads

  1. Replies: 3
    Last Post: 4 Jan 2013, 09:26 PM
  2. creating a link from shopping cart back to main website
    By irori in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 21 Aug 2012, 12:45 AM
  3. Link for Back to shopping
    By stitchnkitty in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 3 Oct 2009, 03:46 PM
  4. Please help how to change the link of Back to Shopping button
    By romanhk in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 15 May 2008, 04:23 AM
  5. Back to Shopping Link
    By mcqueeneycoins in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 7 Jan 2008, 12:43 AM

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