Jump to content

Gyakutsuki

♥Ambassador
  • Content count

    802
  • Joined

  • Last visited

  • Days Won

    22

Everything posted by Gyakutsuki

  1. Ok, if you don'tl tel me the files I don't search everytime. I think your problem become in my opinion on the transfert value, I have some problem with that and that's why you need to use $_SESSION['coupon']. Go back on the page I sent you above and try to follow the debug and test every time if you see all the values. checkout_payment discount class checkout confirmation order_total checkout process
  2. it appears with string(6) "erika2" at the top of the confirmation page... does that help? Seems the value is created. Try to test in order_total directory, discount_coupon.php if you see the calcul of the coupon by a var_dump($this->output); If you don't see the coupon line or not the calcul, it seems the $coupon does'nt pass, and it's better to use $_SESSION. It can be a pb with php version.
  3. it breaks it, normal, you need to see an information about $_SESSION['coupon']. If you see you coupon, it's ok, if not, pb. try to reinstall de contribution with a software like beyond compare. It's important to the value else in checkout confirmation you won't see the information.
  4. could you look in order class if you have $_SESSION['coupon'] if yes write this var_dump($_SESSION['coupon']) exit; and test
  5. your problem is the coupon value. It does'nt sent I think.
  6. look this : http://forums.oscommerce.com/topic/213019-contribution-discount-coupon-codes/page-171
  7. Look if the session is correct in confirmation echo $_SESSION['coupon']; exit; I you don't see the session,you have a pb. See the page above, I explain in details this pb.
  8. shoppingCart::attributes_price does'nt exist in 2.3.x and replace this elementpar the old. $_SESSION['cart']->attributes_price I think.
  9. @@Dan Cole Ok, depends on your configuration in order total and coupon (the setup is very important and you can have at the end some difference, yes it's a bug no simple to resolve) you can have a difference between the shopping and the checkout process This configuration for canada work for me : Sort order in module total order Coupon réduction 1 Expédition 10 Sous-Total 8 Taxes 20 Total 50 and in Coupon : the most important display discount with coupon : true calcul the discount after the taxe :false display taxe applied : false sort order : 1 and for shop configuration display price with taxe : no In my cart not connected Code coupon test applique: -10.00CAD Sous-Total: 25.00CAD Livraison gratuite (livraison offerte dés 20.): 0.00CAD Zone TVH 9.975: 2.49CAD Zone TPS 5%: 1.25CAD Total: 28.74CAD in my cart connected : Code coupon test applique: -10.00CAD Sous-Total: 25.00CAD Livraison gratuite (livraison offerte dés 20.): 0.00CAD Zone TVH 9.975: 2.49CAD Zone TPS 5%: 1.25CAD Total: 28.74CAD in checkout confirmation Code coupon test applique: -10.00CAD Sous-Total: 25.00CAD Livraison gratuite (livraison offerte dés 20.): 0.00CAD Zone TVH 9.975: 2.49CAD Zone TPS 5%: 1.25CAD Total: 28.74CAD
  10. no work with on not taxe. see my email
  11. the system work when your are login or not
  12. $zone_country_id must be $country_id
  13. try with this, it work for me $products = $OSCOM_ShoppingCart->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { $products_tax = Tax::getTaxRate($products[$i]['tax_class_id'], $OSCOM_Order->delivery['country_id'], $OSCOM_Order->delivery['zone_id']); $products_tax_description = Tax::getTaxRateDescription($products[$i]['tax_class_id'], $OSCOM_Order->delivery['country_id'], $OSCOM_Order->delivery['zone_id']); if ( DISPLAY_PRICE_WITH_TAX == 'true' ) { //Modified by Strider 42 to correct the tax calculation when a customer is not logged in $tax_val = (($products[$i]['final_price']/100)*$products_tax)*$products[$i]['quantity']; } else { $tax_val = (($products[$i]['final_price']*$products_tax)/100)*$products[$i]['quantity']; } if ( !empty($OSCOM_Order->info['tax']) ) { $OSCOM_Order->info['tax'] += $tax_val; } else { $OSCOM_Order->info['tax'] = $tax_val; } if (!empty($OSCOM_Order->info['tax_groups']) ) { $OSCOM_Order->info['tax_groups']['' . $products_tax_description . ''] += $tax_val; } else { $OSCOM_Order->info['tax_groups']['' . $products_tax_description . ''] = $tax_val; }
  14. The add must be deleted, not interested in this case. The contribution had a bug to zone id and country id, I just changed theses elements.
  15. @@Dan Cole Ok work like a charm just a modification 1/ Remove in ot_discount.php this or insert comment // $OSCOM_Order->info['total'] = $OSCOM_Order->info['total'] - $discount; // $OSCOM_Order->info['subtotal'] -= $discount; // unset($_SESSION['coupon']); 2/ in classe coupon discount add this two functions becarefull on that : $_GET['shopping_cart'] or if ($PHP_SELF == 'shopping_cart') in shopping_cart.php $_SESSION['shopping_cart'] i don't exactly remember is the name else change private by public and in getZoneCountryid() write var_dump($_SESSION). /* * Display the id of the country zone id * @[member='param'] * @[member='Return'] $zone_country_id, id country zone id * @[member='access'] private */ private function getZoneCountryid() { if (isset($_GET['shopping_cart'])) { //$tax_address['entry_zone_id'] $zone_country_id = $_SESSION['cart_zone']; } else { $zone_country_id = $_SESSION['shopping_cart']['shipping_address']['zone_id']; } return $zone_country_id; } /* * Display the id of the country * @[member='param'] * @[member='Return'] $zone_country_id, id country * @[member='access'] private */ private function getCountryid() { if (isset($_GET['shopping_cart'])) { // $tax_address['entry_country_id'] $country_id = $_SESSION['cart_country_id']; } else { $zone_country_id = $_SESSION['shopping_cart']['shipping_address']['country_id']; } return $country_id; } In this function total_valid_products change this line (sorry don't remember exactlythe synthax, it's mine. $this->getCountryid() and $this->getZoneCountryid() doesn't have any information, that's why the element does'nt display. The bug is here for( $i = 0; $i < count( $products ); $i++ ) { if (DISPLAY_PRICE_WITH_TAX == 'true'){ $product_tax = Tax::getTaxRate($products[$i]['tax_class_id'], $this->getCountryid(), $this->getZoneCountryid()); .... If you want a professionnal code program like phpstorm, you will see yours errors. That's all, I can send you the classe but I rewrite all and the code is different than the 2.3 (reverse ingeniring must be done) but with this element you have the solution, I think.
  16. Ok Dan, I am rewriting the class, let me time to test and i will explain you to integrate the classif you are interesting because I want I resolve pb inside and also my pb. If it succes, I tell you.
  17. In quebec it's arround 14%, curently I try to resolve my clic system (3 to appear a taxe), after I will see the taxe. This example above is a way, not sur it's the best.
  18. I think to appear the taxe, you need to implement the code like for the $OSCOM_Order->info['total'] = $OSCOM_Order->info['total'] - $discount; The example above is an ideabut not sure. I am not in in this moment. try to test this quickly in ot_discount_coupon.php after $order->info['subtotal'] -= $discount; //take the similar code in your case sorry but I don't work on 2.3.x in the module order total. You must see the taxes and the total order $OSCOM_ShoppingCart= Registry::get('ShoppingCart'); $products = $OSCOM_ShoppingCart->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { $products_tax = Tax::getTaxRate($products[$i]['tax_class_id'], $OSCOM_Order->delivery['country_id'], $OSCOM_Order->delivery['zone_id']); var_dump($products_tax); $OSCOM_Order->info['total'] += $products_tax; var_dump($OSCOM_Order->info['total'] ); }
  19. the code included in order total calcul (module) $products = $OSCOM_ShoppingCart->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { $products_tax = Tax::getTaxRate($products[$i]['tax_class_id'], $OSCOM_Order->delivery['country_id'], $OSCOM_Order->delivery['zone_id']); $products_tax_description = Tax::getTaxRateDescription($products[$i]['tax_class_id'], $OSCOM_Order->delivery['country_id'], $OSCOM_Order->delivery['zone_id']); if ( DISPLAY_PRICE_WITH_TAX == 'true' ) { //Modified by Strider 42 to correct the tax calculation when a customer is not logged in $tax_val = (($products[$i]['final_price']/100)*$products_tax)*$products[$i]['quantity']; } else { $tax_val = (($products[$i]['final_price']*$products_tax)/100)*$products[$i]['quantity']; } if ( !empty($OSCOM_Order->info['tax']) ) { $OSCOM_Order->info['tax'] += $tax_val; } else { $OSCOM_Order->info['tax'] = $tax_val; } if (!empty($OSCOM_Order->info['tax_groups']) ) { $OSCOM_Order->info['tax_groups']['' . $products_tax_description . ''] += $tax_val; } else { $OSCOM_Order->info['tax_groups']['' . $products_tax_description . ''] = $tax_val; } // Modified by Strider 42 to correct the order total figure when shop displays prices with tax if ( DISPLAY_PRICE_WITH_TAX == 'true' ) { $OSCOM_Order->info['total']; } else { $OSCOM_Order->info['total'] += $tax_val; }
  20. look the order_total in the module shopping cart, you have the first way.
  21. @@Dan Cole How many clic do you need to see the result. For me it's weird : 3 clics to see the discount (good coupon) 2 clics after to delete the discount (bas coupon)
  22. yes it's another solution and better idea
  23. I also have a problem with the taxes, it diseapear ! Step by step This element does'nt allow in checkout_confirmation to use this code (below) This code go in ot_discount_coupon.php $PHP_SEL = $PHP_SELF $this->output[] = array('title' => $OSCOM_Order->coupon->format_display($tax_group) . ':', 'text' => $text, 'value' => $display_type . $discount ); if (MODULE_SHOPPING_CART_COUPON_DISCOUNT_STATUS == 'true' && $PHP_SELF == 'shopping_cart.php') { $OSCOM_Order->info['total'] = $OSCOM_Order->info['total'] - $discount; $OSCOM_Order->info['subtotal'] -= $discount; }
  24. I don't text with canada tax, tomorrow but work with normal tax. include this adapted at your case if (MODULE_SHOPPING_CART_COUPON_DISCOUNT_CONTENT_WIDTH == 'true'&& $PHP_SEL="shopping_cart.php) { $OSCOM_Order->info['total'] = $OSCOM_Order->info['total'] - $discount; $OSCOM_Order->info['subtotal'] -= $discount; }
×