freakystreak Posted January 30, 2019 Posted January 30, 2019 Has anyone any knowledge if there is an addon or code to add a quantity box to the product_listing page in 2.3.4.1 Edge CE? I've searched through the apps but can't find one that works with this version OSC. Also, where had the case 'buy_now' funtions gone from application_top.php? I know they are now modular but where have they gone? Cheers Quote Ah, the world wide web. What a wonderful place.
burt Posted January 30, 2019 Posted January 30, 2019 Qty box on product listing would not work without either; a. recoding to add in a form for each product or b. javascript trickery (which would be foolhardy) log into admin, then go modules > actions this page will show all actions and where they are located Quote
freakystreak Posted January 30, 2019 Author Posted January 30, 2019 cheers for the heads up Quote Ah, the world wide web. What a wonderful place.
freakystreak Posted January 30, 2019 Author Posted January 30, 2019 I'm surprised this isn't already built in to be fair as majority of online stores have this feature. Quote Ah, the world wide web. What a wonderful place.
♥JcMagpie Posted January 30, 2019 Posted January 30, 2019 Take a look at this thread it may be of some help. Quote
freakystreak Posted January 30, 2019 Author Posted January 30, 2019 (edited) 22 minutes ago, JcMagpie said: Take a look at this thread it may be of some help. Cheers for the suggestion but I saw this before but it's coded for Edge before application_top became modular. Is there a way to adapt this to work on the latest and most current version? I can have products without attributes as I know this causes issues. I'm sure someone must have done it. Edited January 30, 2019 by freakystreak Quote Ah, the world wide web. What a wonderful place.
♥JcMagpie Posted January 30, 2019 Posted January 30, 2019 32 minutes ago, freakystreak said: Edge before application_top became modular That would be a question for one of the developer, But I would imagin most of the code you need is in shopping_cart.php as it makes use of this. Then its should just be a case of moving that to the section you need it to be in. Quote
greasemonkey Posted January 30, 2019 Posted January 30, 2019 @freakystreak the correct way to do this is move the changes mentioned in application_top into a NEW action module - specifically create a new action module (you could use the buy_now action module as a start) renamed name it say "buy_now_form" integrating @Tsimi changes The changes to the product_listing would be the same.... Quote
greasemonkey Posted January 30, 2019 Posted January 30, 2019 You could "test" this (I have NOT tested this).... upload to includes/actions/buy_now_forms.php <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2018 osCommerce Released under the GNU General Public License */ class osC_Actions_buy_now_form { public static function execute() { global $PHP_SELF, $messageStack, $cart, $goto, $parameters; if (isset($_POST['products_id'])) { $cart->add_cart($_POST['products_id'], $cart->get_quantity(tep_get_uprid($_POST['products_id'], $_POST['id']))+($_POST['cart_quantity']), $_POST['id']); } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); } } Quote
freakystreak Posted January 31, 2019 Author Posted January 31, 2019 Many thanks @greasemonkey. Sorry for the late reply. I will try this today. Quote Ah, the world wide web. What a wonderful place.
freakystreak Posted February 12, 2019 Author Posted February 12, 2019 OK, so I've tried what you suggested @greasemonkeyand it does indeed add the products to the cart but I get this error. Quote Parse error: syntax error, unexpected '}' in C:\xampp\htdocs\osc-edge\includes\actions\buy_now_form.php this is the code that is producing the error tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); If I remove the above code, products are added to the cart but the quantity boxes of each product after refresh have the same quantity number set that was used to add to the cart. For instance, add a quantity of 2 for one product then when the page refreshes after the items are added to the cart, each product has a default quantity of 2 in the box. I'm nearly there with this so I would greatly appreciate any advise or suggestions on how to fix this. Quote Ah, the world wide web. What a wonderful place.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.