Jump to content

nbkvh1i

Members
  • Content count

    21
  • Joined

  • Last visited

  • Days Won

    1

nbkvh1i last won the day on November 24 2016

nbkvh1i had the most liked content!

Profile Information

  • Real Name
    Ed Campbell
  1. @Rawi @Tsimi @burt The initial testing on the discounted codes is looking good. We still have not completed the full series of tests but thus far looking good. This includes with the removing the global $PHP_SELF, $oscTemplate, $sess_discount_code; line. We still have additional test cases to execute but thus far is everything is working as expected. The Shopping Cart Counter error I report is a false positive test case result. I was reviewing the test case with the team and seen where that test case could produce a false-positive result. Thus, it is not the global $PHP_SELF, $oscTemplate, $sess_discount_code; or any else in the module is the root cause of that issue. We have something else wrong with our site.
  2. @@Rawi @@Tsimi @@burt We update our development instance tonight with the 4.2 version and make the suggested global change. If it looks good in the dev instance, I will get the team to test overnight our time tonight. Thanks!
  3. @raiwa @Tsimi @@burt All, I download the new file and have my team run the same series of test we did before and report back to you. It may take use a few days (if not a week or so) because we are in middle the holiday shopping, so we are doing good to keep things running at the moment. To let you know we have run into another issue with the module. We have custom header module that @@burt developed for the number of items in the shopping cart in the header of our site (much like the default OSC). This has been working great then we started to get some issues reported by our customers that the shopping cart was dropping items. It turned out that the cart was not really dropping items, it was the counter was not being updated when the user exited the shopping_cart.php by using browser back button. At first, we thought we had a host of issues but discovered that when we turned off the discount codes module in Admin->Modules->Header Tags. The cart counter worked correctly. So, something is not allowing the other header modules to work properly. I have not had time to dig into this issue but thought I would let you guys know in case you had any ideas on where we should start to look when we get a chance. Thanks for all the help and I will get the team to test the new version as quick as I can....
  4. All, Just had a thought, might want to consider working the sort/display order affecting the calculation. I could foresee someone needing to add on another module or add-on and the two could break each other.
  5. @@raiwa @@Tsimi The modified version of the ot_discount does work correctly now as long as the sort order is set to the default order as raiwa points out.
  6. @@Tsimi I did get the Sales Tax to show up by resetting the sort order in the admin -> Modules -> Order Total. Set the tax to be displayed just after subtotal prior to shipping and discounted values. Also moved the discount to be just above the total. So, now the tax amount is being displayed, but the total is still incorrect. How does your tax setup look like? Tax Zones? Tax Classes? Tax Rates? - For this test case, I only have one Tax Zone (North Carolina - NC Sales Tax) configured, one tax class (Taxable Goods), and one rate assigned to the zone and class. Only products are assigned a tax class. - I did change the address for the test customer to a non-zone defined address and it worked correctly. Let me know if think there is still something misconfigured on the tax set up Did you add a tax class to the flat rate shipping? - No, it is not assigned to a tax class or zone. Do you have "display prices with tax" set to true or false? - It is set to false for the product displays. Only in the check out is set to display tax. The sort order seemed to fix the display issue.
  7. @@Tsimi I did run the test 2 use case above after making the suggested change. It appears to be deducting the shipping cost correctly now. However, the sales tax amount (around $0.50 for the test case) is missing, and the total is still deducting an amount (I am assuming it is some percentage of the tax because of the amount but not the full amount). See the attached image (Discount Code - Something Still Off.jpg) The Total should be 7.45 but the total in the use case is 6.58 (which is $0.37 difference that does not match the tax amount).
  8. @@Tsimi Sorry, Notepad++ search did a poor job of finding the string. I actually end up finding it in two different places within the file. One at line 173 and another at 143. The one at line 173 seems to be within the shipping check. I will modify that to the above and test. Sorry again for missing it the first time.
  9. @@Tsimi I don't have those lines in my .../includes/modules/order_total/ot_discount.php file. I did install the latest from 4.1. ------------------------------------ Here is the entire $check['shipping'] section of my file (lines 79-199) if (!empty($check['products_id']) || !empty($check['categories_id']) || !empty($check['manufacturers_id'])) { $products = array(); if (!empty($check['products_id'])) { $products = explode(',', $check['products_id']); } elseif (!empty($check['categories_id'])) { $product_query = tep_db_query("select products_id from products_to_categories where categories_id in (" . $check['categories_id'] . ")" . (empty($check['excluded_products_id']) ? '' : " and products_id not in (" . $check['excluded_products_id'] . ")")); while ($product = tep_db_fetch_array($product_query)) { $products[] = $product['products_id']; } } elseif (!empty($check['manufacturers_id'])) { $product_query = tep_db_query("select products_id from products where manufacturers_id in (" . $check['manufacturers_id'] . ")" . (empty($check['excluded_products_id']) ? '' : " and products_id not in (" . $check['excluded_products_id'] . ")")); while ($product = tep_db_fetch_array($product_query)) { $products[] = $product['products_id']; } } if ((int)$check['exclude_specials'] == 1) { $specials = array(); $product_query = tep_db_query("select p.products_id from products p, specials s where p.products_id = s.products_id and s.status = '1' and ifnull(s.expires_date, now()) >= now()"); while ($product = tep_db_fetch_array($product_query)) { $specials[] = $product['products_id']; } if (sizeof($specials) > 0) { $products = array_diff($products, $specials); } } if (empty($check['number_of_products'])) { $k = PHP_INT_MAX; } else { $k = $check['number_of_products']; } for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) { if (in_array(tep_get_prid($order->products[$i]['id']), $products)) { if ($k >= $order->products[$i]['qty']) { $products_discount = $this->format_raw(strpos($check['discount_values'], '%') === false ? $check['discount_values'] * $order->products[$i]['qty'] : tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * str_replace('%', '', $check['discount_values']) / 100 * $order->products[$i]['qty']); $k -= $order->products[$i]['qty']; } else { $products_discount = $this->format_raw(strpos($check['discount_values'], '%') === false ? $check['discount_values'] * $k : tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * str_replace('%', '', $check['discount_values']) / 100 * $k); $k = 0; } if (!empty($order->products[$i]['tax'])) { if (DISPLAY_PRICE_WITH_TAX != 'true') { $tax_correction = $this->format_raw(($products_discount * ($order->products[$i]['tax'] / 100))); $order->info['total'] -= $tax_correction; } else { $tax_correction = $this->format_raw($products_discount - $products_discount / (1.0 + $order->products[$i]['tax'] / 100)); } } $subtotal_correction += $order->products[$i]['final_price']; //use for tax calculation only products which have taxes $order->info['tax'] -= $tax_correction; $order->info['tax_groups'][$order->products[$i]['tax_description']] -= $tax_correction; $discount += $products_discount; } } $order->info['total'] -= $discount; } elseif (!empty($check['orders_total'])) { if ($check['orders_total'] == 2) { $discount = (strpos($check['discount_values'], '%') === false ? $check['discount_values'] : $order->info['subtotal'] * str_replace('%', '', $check['discount_values']) / 100); if ($discount > $order->info['subtotal']) { $discount = $order->info['subtotal']; } $order_tax = 0; for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) { if (!empty($order->products[$i]['tax'])) { //here it gets complicate, we have to find the proportional part of the global discount for each product $global_tax_correction = $this->format_raw($order->products[$i]['qty']*(( $order->products[$i]['final_price']/$order->info['subtotal'])*$discount)+(($order->products[$i]['qty']* $order->products[$i]['final_price']/$order->info['subtotal'])*$discount) * ($order->products[$i]['tax'] / 100)); $order->info['total'] -= $global_tax_correction; } } if (is_array($order->info['tax_groups']) && count($order->info['tax_groups']) > 0) { foreach ($order->info['tax_groups'] as $key => $value) { if (!empty($value)) { $order->info['tax_groups'][$key] = $this->format_raw(($order->info['subtotal'] - $discount) * ($value / $order->info['subtotal'])); $order_tax += $order->info['tax_groups'][$key]; } } } if (!empty($order_tax)) { $order->info['tax'] = $order_tax; } else { $order->info['total'] -= $discount; } } $shipping_discount = 'false'; } elseif (!empty($check['shipping'])) { //.eof $check['orders_total'] if ($check['shipping'] == 2) { $discount = $order->info['shipping_cost'] * str_replace('%', '', strtolower($check['discount_values'])) / 100; if ($discount > $order->info['subtotal']) { $discount = $order->info['subtotal']; } $order_tax = 0; for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) { if (!empty($order->products[$i]['tax'])) { //here it gets complicate, we have to find the proportional part of the global discount for each product $global_tax_correction = $this->format_raw($order->products[$i]['qty']*(( $order->products[$i]['final_price']/$order->info['subtotal'])*$discount)+(($order->products[$i]['qty']* $order->products[$i]['final_price']/$order->info['subtotal'])*$discount) * ($order->products[$i]['tax'] / 100)); $order->info['total'] -= $global_tax_correction; } } if (is_array($order->info['tax_groups']) && count($order->info['tax_groups']) > 0) { foreach ($order->info['tax_groups'] as $key => $value) { if (!empty($value)) { $order->info['tax_groups'][$key] = $this->format_raw(($order->info['subtotal'] - $discount) * ($value / $order->info['subtotal'])); $order_tax += $order->info['tax_groups'][$key]; } } } if (!empty($order_tax)) { $order->info['tax'] = $order_tax; } else { $order->info['total'] -= $discount; } $shipping_discount = 'true'; } } //.eof $check['shipping']
  10. All, I found a strange bug. The discount code I setup was a free shipping discount. The site has the flate rate shipping module installed. It also has the free shipping turnned on at the order total level within the admin -> Modules -> Order Totals -> Shipping and that is set to $130.00. We had the 3.8 version of discount codes installed. I just upgraded to the latest 4.1 version after discovering this issue. However, the upgrade did not resolve the issue as I had hoped. The use case: For all test cases: Created a free shipping discount code called 1234. Test 1 - The shopping cart has an item that is less than the flat rate shipping fee and there is sales tax being applied and no discount code being applied (attachement: Discount not applied.jpg). This works as expected. Test 2 - The shopping cart has an item that is less than the flat rate shipping fee and a sales tax (same product and etc. from test case 1) however, this time the free shipping discount was entered during the check out process (attachement: Discount applied.jpg). Note: the caculation, the sale tax is missing, the discount was applied to the product price and the total is the difference between the flat rate shipping cost and product price. Test 3 - Removed the product in the shopping cart from test case 1 & 2 and replaced it for a higher price product that exceeded the flat rate shipping amount. The 1234 Free Shipping discount code was applied and everything worked as expected. (attachement: Discount Correct.jpg) Items I have tried: - upgrade from 3.8 to 4.1 versions - multiple free shipping discount codes - attempt to turn-off order total discount within Modules -> Order Totals -> Shipping - several test with products that were under the flat rate shipping with a free shipping discount code(s). Looking for suggestion on how to trace this issue out or if someone has or knows of the solution to resolve it. BTW: We are running BS version of OSC. Thanks in advance for your help
  11. All, the above-listed changes worked for us as well. Thanks John for the information.
  12. Looking for advice here; Should we uninstall and drop back to 3.7 until the issues with 3.8 are resolved or do you think those will be resolved quickly. I was hoping to roll this out with a new version of the site but now wondering if I need to back it out for now or go with 3.7 and not hold up a release.
  13. All, I am having the same issue as @@Umb. I just installed 3.8BS on top of 2.3.4 OSC BS. I have all the modules setup and configured and created a simple order total discount but nothing is showing up on the checkout_payment page for the customer to enter the code/coupon value. One thing I did notice in the instructions is that they jump from step 3.1 to step 8. Are some instructions missing that we are not completing and thus creating the issue? 3.1. Add to the end of the file // Discount Codes 3.8 BS - start if (MODULE_ORDER_TOTAL_DISCOUNT_STATUS == 'true') { if (!tep_session_is_registered('sess_discount_code')) tep_session_register('sess_discount_code'); if (!empty($HTTP_GET_VARS['discount_code'])) $sess_discount_code = tep_db_prepare_input($HTTP_GET_VARS['discount_code']); if (!empty($HTTP_POST_VARS['discount_code'])) $sess_discount_code = tep_db_prepare_input($HTTP_POST_VARS['discount_code']); } // Discount Codes 3.8 BS - end /********************************/ /* SETUP/CONFIGURATION */ /********************************/ 8. Install the Order Total module under Administration -> Modules -> Order Total -> Install Module -> Discount Code -> Install Module. Install the Header Tags module under Administration -> Modules -> Header Tags -> Install Module -> Discount Code -> Install Module.
  14. nbkvh1i

    Multi_Vendor_Shipping new thread

    We did find one a bit of flaw/bug in the logic. What I discovered is that we needed apply a second layer or break up the logic a bit more. So, if the OSC Orders Module is off is one condition and the error should be check every time. Then if it is on we need to add the compound check that it is below the minimal amount. I think in my first attempt I was trying to combine the two and that left some use cases open that should have executed the error check. Here is the revised if statement: // If a shipping method has not been selected for all vendors, redirect the customer to the shipping method selection page if (SELECT_VENDOR_SHIPPING == 'true') { // This test only works under MVS if (!is_array ($shipping['vendor']) || count ($shipping['vendor']) != count ($cart->vendor_shipping)) { // No shipping selected or not all selected if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING != 'true') { //check to see if free shipping at the total char level it configured tep_redirect (tep_href_link (FILENAME_CHECKOUT_SHIPPING, 'error_message=' . ERROR_NO_SHIPPING_SELECTED, 'SSL')); } elseif((MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') && ($cart->total <= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) { //check to see if free shipping at the total char level it configured tep_redirect (tep_href_link (FILENAME_CHECKOUT_SHIPPING, 'error_message=' . ERROR_NO_SHIPPING_SELECTED, 'SSL')); } } } We are finding one other issue. And this is more user frustration type of flaw. I have not researched it, however, I think there is bug within the OSC Order Module within Checkout_Shipping.PHP page using grand total vs. cart sub-total. Here is the failed use case: A user creates an order that is below the minimal free shipping amount. They enter the checkout process and select one or more shipping options (if they have more than one vendor’s product). All seems to work without issue unless they abandon the checkout process (to go back and modify the cart items) after selecting one or more shipping methods. What happens is that when they re-execute the checkout process they may get displayed that they qualify for free shipping even thru the cart amount is still below the minimal amount. What I believe is occurring is that what OSC is using is looking at the total order amount and not the cart sub-total amount. Because if the total order amount is over (with the prior selected shipping amounts) then they are getting displayed free shipping. Now, the funny thing is that the checkout_confirmation.php logic above is trapping for and sending back to select a new shipping method for the order because the cart amount is still below the minimal and no revised shipping method(s) was selected. I could see this as point of frustration for a user being told they get free shipping and at very end they don’t qualify. I am going to take a look at the logic within checkout_shipping.php to see if I can find what it is using.
  15. nbkvh1i

    Multi_Vendor_Shipping new thread

    In case someone ever wants to do free shipping at the cart/order total value level here is what I changed (and Jim let me know if you can see any issues). I took advantage of the constants and the fact that application_top stores the total of the shopping chart. : In the checkout_payment.php around line 26 changed: // if no shipping method has been selected, redirect the customer to the shipping method selection page if (!tep_session_is_registered('shipping')) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } TO: // if no shipping method has been selected, redirect the customer to the shipping method selection page if (!tep_session_is_registered('shipping')) { if ((MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING != 'true') && ($cart->total >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) {//check to see if free shipping at the total cart level it configured tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } } And in checkout_confirmation.php around line 20: // If a shipping method has not been selected for all vendors, redirect the customer to the shipping method selection page if (SELECT_VENDOR_SHIPPING == 'true') { // This test only works under MVS if (!is_array ($shipping['vendor']) || count ($shipping['vendor']) != count ($cart->vendor_shipping)) { // No shipping selected or not all selected tep_redirect (tep_href_link (FILENAME_CHECKOUT_SHIPPING, 'error_message=' . ERROR_NO_SHIPPING_SELECTED, 'SSL')); } } TO: // If a shipping method has not been selected for all vendors, redirect the customer to the shipping method selection page if (SELECT_VENDOR_SHIPPING == 'true') { // This test only works under MVS if (!is_array ($shipping['vendor']) || count ($shipping['vendor']) != count ($cart->vendor_shipping)) { // No shipping selected or not all selected if ((MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING != 'true') && ($cart->total >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) { //check to see if free shipping at the total cart level it configured tep_redirect (tep_href_link (FILENAME_CHECKOUT_SHIPPING, 'error_message=' . ERROR_NO_SHIPPING_SELECTED, 'SSL')); } } } After making the above changes to get it to work all you have to do is set the value and trun on Free Shipping in the in Admin->Modules->Order Totals -> shipping. And the site will we do free shipping at the total cart level with MVS. Now, one thing I noticed from a business perspective is that you need to watch the minimal amount you set the free shipping value to because we had a combination of items that were coming from different vendors when I set the value for free shipping to $50.00 that would have cause the business to loose money on that order. So, we change it to $100.00 so that they could cover the cost of the shipping and the product and still make a marginal profit. The other improvement I am considering is on the checkout_shipping.php page is add a selector that is preselected for Free Shipping so that it matches the page when there is no free shipping. Also, I am considering changing the message/text on the page because is states something like "Please select from...." to be more align that there is a free shipping offer. Jim, Like to know your thought on this approach and if you think it is userful.
×