booch Posted October 26, 2006 Posted October 26, 2006 I was convinced I would find an answer to this without having to post a new topic, but I haven't found any solutions on the forum, contributions or otherwise. What we need is the functionality of a checkout button in the product info page that will actually take the place of the "add to cart" button. The checkout button needs to not only add the item to the shopping cart, but also skip shopping_cart.php and proceed directly to checkout. The reason why we need this functionality is our company sells products in the same way as a car dealership. When/if you purchase a car online, a shopping cart page is really not necessary and can be confusing because people (typically) buy 1 car. So when a customer finds the product they're looking for, they won't need to continue shopping and instead just proceed directly to checkout. I got into the php to try to get it working myself through changing code in (product_info.php and /includes/application_top.php), but just resulted in messing things up. (of course I restored from backups) I've seen this done on other osCommerce carts before, so I know it's possible. Any help would be greatly appreciated!
boxtel Posted October 26, 2006 Posted October 26, 2006 I was convinced I would find an answer to this without having to post a new topic, but I haven't found any solutions on the forum, contributions or otherwise. What we need is the functionality of a checkout button in the product info page that will actually take the place of the "add to cart" button. The checkout button needs to not only add the item to the shopping cart, but also skip shopping_cart.php and proceed directly to checkout. The reason why we need this functionality is our company sells products in the same way as a car dealership. When/if you purchase a car online, a shopping cart page is really not necessary and can be confusing because people (typically) buy 1 car. So when a customer finds the product they're looking for, they won't need to continue shopping and instead just proceed directly to checkout. I got into the php to try to get it working myself through changing code in (product_info.php and /includes/application_top.php), but just resulted in messing things up. (of course I restored from backups) I've seen this done on other osCommerce carts before, so I know it's possible. Any help would be greatly appreciated! in application_top: if (DISPLAY_CART == 'true') { $goto = FILENAME_SHOPPING_CART; $parameters = array('action', 'cPath', 'products_id', 'pid'); } else { $goto = basename($PHP_SELF); if ($HTTP_GET_VARS['action'] == 'buy_now') { $parameters = array('action', 'pid', 'products_id'); } else { $parameters = array('action', 'pid'); } } if you have set in admin to move to the cart after adding an item. you could change : $goto = FILENAME_SHOPPING_CART; to $goto = FILENAME_CHECKOUT_SHIPPING; Treasurer MFC
booch Posted October 26, 2006 Author Posted October 26, 2006 in application_top: if (DISPLAY_CART == 'true') { $goto = FILENAME_SHOPPING_CART; $parameters = array('action', 'cPath', 'products_id', 'pid'); } else { $goto = basename($PHP_SELF); if ($HTTP_GET_VARS['action'] == 'buy_now') { $parameters = array('action', 'pid', 'products_id'); } else { $parameters = array('action', 'pid'); } } if you have set in admin to move to the cart after adding an item. you could change : $goto = FILENAME_SHOPPING_CART; to $goto = FILENAME_CHECKOUT_SHIPPING; Beautiful. It seems to work great! When I posted originally, I actually had changed that line of code to be exactly what you specified, but made additional changes to the product info page so it didn't work properly. Thanks for the help!
booch Posted October 26, 2006 Author Posted October 26, 2006 you could change : $goto = FILENAME_SHOPPING_CART; to $goto = FILENAME_CHECKOUT_SHIPPING; Like I mentioned before, your above suggestion works great. I'm trying to redirect the checkout process to go to directly to FILENAME_CREATE_ACCOUNT. With your suggested modification, it goes through FILENAME_CHECKOUT_SHIPPING -> FILENAME_CREATE_ACCOUNT, which is not necessary since 99.9% of customers are new and do not have an account. After purchasing a product, it is likely that they will not return due to the life of the product. I've tried just substituting FILENAME_CHECKOUT_SHIPPING with FILENAME_CREATE_ACCOUNT ($goto = FILENAME_CREATE_ACCOUNT;), but that does not work. It ends up kicking new users and returning users back to the default (index.php). Any suggestions on how I can get this working?
booch Posted October 27, 2006 Author Posted October 27, 2006 in application_top: if (DISPLAY_CART == 'true') { $goto = FILENAME_SHOPPING_CART; $parameters = array('action', 'cPath', 'products_id', 'pid'); } else { $goto = basename($PHP_SELF); if ($HTTP_GET_VARS['action'] == 'buy_now') { $parameters = array('action', 'pid', 'products_id'); } else { $parameters = array('action', 'pid'); } } if you have set in admin to move to the cart after adding an item. you could change : $goto = FILENAME_SHOPPING_CART; to $goto = FILENAME_CHECKOUT_SHIPPING; *bump* I'd appreciate any help!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.