OSC-Sevilla Posted September 30, 2011 Posted September 30, 2011 Please see the attached images. NOTE: I HAVE TESTED THE SETTINGS IN ADMIN - still the same result Check stock level true Subtract stock true Allow Checkout false Mark product out of stock <span style="background:#cc0033; font-size:6px"> </span> Stock Re-order level 5 -------------- Basically my OSC i heavily modified. the stock 2.3.1 vertion is fine. The Problem: If a product has "0" quanity in stock, on its corresponding products_info page when the "Add to cart" is pressed you are normally taken to shopping_cart.php, where it shows your product and a warning (see image 4). This is not happening currently, and instead i see "Your Shopping Cart is empty!" (see image 2). However in the index page, if I add that same product to the cart it works fine (see image 4). PLS ANYONE HAD AND SOLVED THIS ISSUE? I have tested, by running the stock version and still the same issue, hence: products_info.php, ---- (no problems) shopping_cart.php ---- (no problems) -------------- WHERE ELSE TO LOOK-????? THANK YOU
OSC-Sevilla Posted October 3, 2011 Author Posted October 3, 2011 OK - I have found the issue but dont know how to solve: This issue is with the MOD/ADDON "quantity select in product info page." As per its instructions: open: catalog/includes/application_top.php find: $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1, $attributes); replace with: <!--- BOF: Quantity Input Field mod --> $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id'])) + $HTTP_POST_VARS['cart_quantity'], $HTTP_POST_VARS['id']); <!--- END: Quantity Input Field mod --> ------------------- This code is generating the error described above - any help pls?
FIMBLE Posted October 3, 2011 Posted October 3, 2011 Hello I tested this and it worked fine on my site as is. A few things you can try though Change $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id'])) + $HTTP_POST_VARS['cart_quantity'], $HTTP_POST_VARS['id']); for $cart->add_cart($_POST['products_id'], $cart->get_quantity(tep_get_uprid($_POST['products_id'], $_POST['id'])) + $_POST['cart_quantity'], $_POST['id']); and <td><strong><?php echo TEXT_ENTER_QUANTITY ?></strong></td> <td> <?php $val = $product_info['products_quantity']; ?> <select name="cart_quantity"> <?php for($i=1;$i<=$val;$i++) {?> <option><?php echo $i;?></option> <?php } ?> </select></td> for <td><strong><?php echo TEXT_ENTER_QUANTITY ?></strong></td> <td> <?php $val = $product_info['products_quantity']; ?> <select name="cart_quantity"> <?php for($i=1; $i<=$val; $i++) {?> <option><?php echo $i;?></option> If none of this works it could be a code clash with another add on. Nic Sometimes you're the dog and sometimes the lamp post [/url] My Contributions
OSC-Sevilla Posted October 4, 2011 Author Posted October 4, 2011 Thanks Nic. Your solution did not work but i have formulated this that does. Im not 100% sure how i could tidy this up but it is working (simply added an OR command). $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id'])) + $HTTP_POST_VARS['cart_quantity'], $HTTP_POST_VARS['id']) or $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1, $attributes); ONE ISSUE: if i select from the drop down (5) in the cart it reads 6, this i because we are running both strings..... this method seems a little OTT - so if it could be condensed or improved please help - Many Many thanks
OSC-Sevilla Posted October 4, 2011 Author Posted October 4, 2011 Thanks Nic. Your solution did not work but i have formulated this that does. Im not 100% sure how i could tidy this up but it is working (simply added an OR command). $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id'])) + $HTTP_POST_VARS['cart_quantity'], $HTTP_POST_VARS['id']) or $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1, $attributes); ONE ISSUE: if i select from the drop down (5) in the cart it reads 6, this i because we are running both strings..... this method seems a little OTT - so if it could be condensed or improved please help - Many Many thanks
OSC-Sevilla Posted October 4, 2011 Author Posted October 4, 2011 SOLVED: if ($HTTP_POST_VARS['cart_quantity'] >= 2){ $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id'])) + $HTTP_POST_VARS['cart_quantity'], $HTTP_POST_VARS['id'] ); }else $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1, $attributes);
Recommended Posts
Archived
This topic is now archived and is closed to further replies.