blurredreality Posted November 29, 2009 Posted November 29, 2009 In order to streamline the order process, I believe it must be easy to skip the shopping cart from the order process, and have the add to cart button not only add the product to the cart, but then redirect straight to the checkout section. Given that you can confirm what you are buying during checkout - why confirm what is in the cart before going to checkout? It seems a superfluous step. I desperately wanted to figure this out myself and post it as a tip, but I've become stuck. However the idea I believe is usefull, so hopefully someone can figure it out. I will share my thoughts on this if it makes it easier: 1. You can choose whether or not to display the cart after adding product in admin>configuration>My Store. However, if you set this as false (do not display cart), the current product_info page is instead loaded. Given that the page loaded can be changed so readily, I think there must be one redirect value you need to change. 2. I looked in the configuration table using phpmyadmin, and found that the changes made on the admin configuration page were processed with a tep function, tep_cfg_select_option. 3. I thing tracked down this function definition to admin/includes/functions/general.php. This is what I believe the relevant code is: // Alias function for Store configuration values in the Administration Tool function tep_cfg_select_option($select_array, $key_value, $key = '') { $string = ''; for ($i=0, $n=sizeof($select_array); $i<$n; $i++) { $name = ((tep_not_null($key)) ? 'configuration[' . $key . ']' : 'configuration_value'); $string .= '<br><input type="radio" name="' . $name . '" value="' . $select_array[$i] . '"'; if ($key_value == $select_array[$i]) $string .= ' CHECKED'; $string .= '> ' . $select_array[$i]; } return $string; } It is here my trail ran cold. I cannot find the arrays where this function is getting its values from. I am very ignorant of th way php works - but I'm SURE the solution will be simple. If you could just track down where the different snippets of code defined by the true or false of the configuration are located - I really think we could just change the redirect code of the false value to redirect to the appropriate page (e.g. checkout_shipping.php). I hope we can all figure this out. PS: Sorry if this is posted in the wrong category.
Jan Zonjee Posted November 29, 2009 Posted November 29, 2009 1. You can choose whether or not to display the cart after adding product in admin>configuration>My Store. However, if you set this as false (do not display cart), the current product_info page is instead loaded. Given that the page loaded can be changed so readily, I think there must be one redirect value you need to change. You can find the code responsible for that in catalog/includes/application_top.php around line 327: 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'); } } Further on in application_top.php you can see that the $goto parameter is used after each action. Since checkout is often a https page the tep_href_link function might need a third parameter: SSL. Haven't looked at that, but I guess it will give trouble.
blurredreality Posted November 29, 2009 Author Posted November 29, 2009 Thanks Jan Zonjee - I edited the following, changing the second $goto value to FILENAME_CHECKOUT_SHIPPING. So it went from this: 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'); } } To this: if (DISPLAY_CART == 'true') { $goto = FILENAME_SHOPPING_CART; $parameters = array('action', 'cPath', 'products_id', 'pid'); } else { $goto = FILENAME_CHECKOUT_SHIPPING; if ($HTTP_GET_VARS['action'] == 'buy_now') { $parameters = array('action', 'pid', 'products_id'); } else { $parameters = array('action', 'pid'); } } It seems to work a treat on my store, which uses a shared SSL certificate. I have the One page Checkout modification installed, so this in turn redirects me to a checkout.php page with all the checkout content on it. Excellent. I hope it works for others too. Thanks again for the key Jan!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.