Guest Posted September 2, 2010 Posted September 2, 2010 When you click on a buy now button on my store it adds the product to the cart no problems, if you then click Continue to Shop, all the product id's are set to the first product in the cart for the buy in now buttons in that sub category. Example Before adding anything to cart, buy now buttons link to: ....html?products_id=1908&action=buy_now&sort=2a ....html?products_id=2908&action=buy_now&sort=2a ....html?products_id=3908&action=buy_now&sort=2a etc After you add one item, say products_id=1908 to the cart and click Continue to shop, you return to the same sub-category but the buy now buttons link to: ....html?products_id=1908&action=buy_now&sort=2a ....html?products_id=1908&action=buy_now&sort=2a ....html?products_id=1908&action=buy_now&sort=2a etc Therefore if you add anything else from that sub-category, it just adds another 1908 to the cart If you go to another sub-category and click buy now it works until you return and try and add soemthing else from that sub-cat. Is this a known fault? Can't find anything in the forums to help. Where does the Continue to shop button code come from? Any help appreciated
♥FWR Media Posted September 2, 2010 Posted September 2, 2010 When you click on a buy now button on my store it adds the product to the cart no problems, if you then click Continue to Shop, all the product id's are set to the first product in the cart for the buy in now buttons in that sub category. Example Before adding anything to cart, buy now buttons link to: ....html?products_id=1908&action=buy_now&sort=2a ....html?products_id=2908&action=buy_now&sort=2a ....html?products_id=3908&action=buy_now&sort=2a etc After you add one item, say products_id=1908 to the cart and click Continue to shop, you return to the same sub-category but the buy now buttons link to: ....html?products_id=1908&action=buy_now&sort=2a ....html?products_id=1908&action=buy_now&sort=2a ....html?products_id=1908&action=buy_now&sort=2a etc Therefore if you add anything else from that sub-category, it just adds another 1908 to the cart If you go to another sub-category and click buy now it works until you return and try and add soemthing else from that sub-cat. Is this a known fault? Can't find anything in the forums to help. Where does the Continue to shop button code come from? Any help appreciated Is this a new problem or happens even after you swapped from 2-2.2d to my stable release? Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Guest Posted September 2, 2010 Posted September 2, 2010 Is this a new problem or happens even after you swapped from 2-2.2d to my stable release? No I think its always been there but only noticed it when I was trying to add 2 products from the same sub-cat that suffered from the seo problem. I guess its one of those problems that you don't notice as you don't order from your own site!!!
Guest Posted September 2, 2010 Posted September 2, 2010 Just looking some more.... When I hover over the Continue to shop button I get .....html?products_id=XXX&sort=2a where XXX is the product id that has just been added so it would appear that the Continue to shop button is assigning all products in that sub-cat with the id of what has just been added. Having a look at shopping_cart.php the Continue to shop button code is: <td class="main"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td> Not sure if that helps!
♥FWR Media Posted September 2, 2010 Posted September 2, 2010 Just looking some more.... When I hover over the Continue to shop button I get .....html?products_id=XXX&sort=2a where XXX is the product id that has just been added so it would appear that the Continue to shop button is assigning all products in that sub-cat with the id of what has just been added. Having a look at shopping_cart.php the Continue to shop button code is: Not sure if that helps! I believe you missed out the part of my install instructions for product_listing.php Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Guest Posted September 2, 2010 Posted September 2, 2010 I believe you missed out the part of my install instructions for product_listing.php Indeed I had! I have changed it and now I don't even get a Contine to shop button?!?!?!
Guest Posted September 2, 2010 Posted September 2, 2010 shopping_cart.php has: <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo tep_image_submit('button_update_cart.gif', IMAGE_BUTTON_UPDATE_CART); ?></td> <?php $back = sizeof($navigation->path)-2; if (isset($navigation->path[$back])) { ?> <td class="main"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td> <?php } ?> <?php // MVS Shipping Estimator start if (SHIP_ESTIMATOR_BUTTON_SHOPPING_CART == 'true') { echo ' <td class="main" align=center><a href="javascript:estimatorpopupWindow(\'' . tep_href_link (FILENAME_SHIP_ESTIMATOR, 'pid=' . (int) $_GET['products_id'], 'SSL') . '\')">' . tep_image_button ('button_estimate_shipping.gif', IMAGE_BUTTON_SHIP_ESTIMATOR) . '</a></td>'; } // MVS Shipping Estimator end ?> But is now completely ignoring the bold bit (continue to shop button) it doesn't even appear in the source code!
♥FWR Media Posted September 2, 2010 Posted September 2, 2010 shopping_cart.php has: But is now completely ignoring the bold bit (continue to shop button) it doesn't even appear in the source code! That just means there's no navigation back path .. it's nothing to do with the seo urls contribution. Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Guest Posted September 2, 2010 Posted September 2, 2010 That just means there's no navigation back path .. it's nothing to do with the seo urls contribution. Where should the navigation back path be??? The only changes I have made have been the SEO ones
♥FWR Media Posted September 2, 2010 Posted September 2, 2010 Where should the navigation back path be??? The only changes I have made have been the SEO ones Dunno .. the navigation path should always contain at least two paths if you are at the shopping cart, therefore it should find a path, therefore it should show a continue button. Without looking at your code I can't help further .. try printing out the contents of $navigation->path when you are at the shopping cart page. Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Guest Posted September 2, 2010 Posted September 2, 2010 try printing out the contents of $navigation->path when you are at the shopping cart page. Sorry, being a php noobie how would i do that?
Guest Posted September 2, 2010 Posted September 2, 2010 Ignore the above......its back! not sure what happened And the buy now button is working.....FWR Media you are a genius (again!)thank you
peter.tbt Posted November 14, 2010 Posted November 14, 2010 Ignore the above......its back! not sure what happened And the buy now button is working.....FWR Media you are a genius (again!)thank you If the navigation path is < 2 when it shouldn't be then it is probably coz of cookies. Try clearing cookies, problem will go away. Funny! But I had a similar problem where navigation path>=2 and I had the problem with the Buy now button, all buy now buttons point to the same product you last added to the cart. This only happens if you clicked "Continue" button in the shopping cart to go back to the categories. On closer inspection, I found that after clicking continue, I go back to the category page and the query string has a &products_id=xxx where xxx is the last item you added to cart using the buy now button. I changed some code in the shopping_cart.php and now it works fine. 1) Find: $back = sizeof($navigation->path)-2; if (isset($navigation->path[$back])) { Just after this add: $arr_tmp=$navigation->path[$back]['get']; if($arr_tmp["action"]=="buy_now"){ $arr_tmp["products_id"]=""; //remove products id //next line i put $arr_tmp instead of the original$navigation->path[$back]['get'] } 2) Find: <td class="main"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . print_r($navigation) . '</a>'; ?></td> Replace with: <td class="main"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($arr_tmp, array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . print_r($navigation) . '</a>'; ?></td> Can't believe I noticed the problem after such a long time, and nobody but Tartan had the same problem. Not sure where to post, so posted here. Hope it helps someone.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.