Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


Everything posted by Gyakutsuki

  1. @@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.
  2. 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.
  3. 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.
  4. 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'] ); }
  5. 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; }
  6. look the order_total in the module shopping cart, you have the first way.
  7. @@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)
  8. yes it's another solution and better idea
  9. 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; }
  10. 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; }
  11. Seem to work in different configuration with the module. No work with me if I insertt a limited price (pb), limit coupon (normal), number available, categories, products, manufacturers error on coupon name Could you test on your part Tk
  12. @Dan Cole A first way, but not tested in deep with all options after this in ot_discount.php $this->output[] = array('title' => $OSCOM_Order->coupon->format_display($tax_group) . ':', 'text' => $text, 'value' => $display_type . $discount ); add $OSCOM_Order->info['total'] = $OSCOM_Order->info['total'] - $discount; $OSCOM_Order->info['subtotal'] -= $discount; in other case, it's possible to add also for conflict problem with checkout_confirmation.php 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; } Let me know if it's first idea works;
  13. Do you tried with different configuration taxe, no tax, above sub total, after sub total, after total ?
  14. @Dan Cole no inside coupon discount
  15. try to insert unset($_SESSION['coupon']); just a litlle improve if it can help you (HTML::sanitize change by good osc 2.3.x synthax) //verifier intégrité coupon if (!isset($_SESSION['coupon'])) { $_SESSION['coupon'] = HTML::sanitize($_POST['coupon']); } //this needs to be set before the order object is created, but we must process it after if (isset($_SESSION['coupon'])) { if (osc_not_null($_SESSION['coupon'])) { $_SESSION['coupon'] = HTML::sanitize($_SESSION['coupon']); } else { unset($_SESSION['coupon']); } } else { unset($_SESSION['coupon']); }
  16. @Dan Cole is it possible to display your work ? I'm developping something but not yet finish. Good news I am able to display the discount amount without customer session Bad news : the total amount is not calculate. Below an example on the code in execute function. if (isset($_POST['coupon'])) { //verifier intégrité coupon if (!isset($_SESSION['coupon'])) { $_SESSION['coupon'] = HTML::sanitize($_POST['coupon']); } //this needs to be set before the order object is created, but we must process it after //this needs to be set before the order object is created, but we must process it after // $coupon = osc_db_prepare_input($_POST['coupon']); if (isset($_SESSION['coupon'])) { $coupon = ''; if (tep_not_null($_SESSION['coupon'])) { $_SESSION['coupon'] = tep_db_prepare_input($_SESSION['coupon']); } } require_once(DIR_WS_CLASSES . 'order.php'); $order = new order; // discount coupons if (isset( $_SESSION['coupon']) && is_object($order->coupon) ) { $order->coupon->verify_code(); // erreur quand le nbr de coupon permis = 0 et debug = false } $form = tep_draw_form('coupon', osc_href_link('sopping_cart.php', '', 'SSL'), 'post', 'id ="coupon"onsubmit="return check_form();"', true); $endform = '</form>'; $coupon = tep_draw_input_field('coupon', '', 'id="inputCoupon" class="input-sm" placeholder="' . ENTRY_DISCOUNT_COUPON . '"' );; $button_coupon = tep_draw_button(IMAGE_BUTTON_CONTINUE, null, null, 'secondary', null, 'sm'); if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true') { // call template with $form . $coupon . $button_coupon . $endform } } }
  17. @Dan Cole No, I tried but it doesn't work, no search more.
  18. @Dan Cole I use with paypal standard,I don't know if it work with paypal express, but it should be.
  19. @@dinopacha You can improve you script with this in catalog/includes/modules/content/header/cm_header_jssor.php after insert this global $oscTemplate, $header_tags_array; $footer_tag .= '<script type="text/javascript" src="ext/jssor/jssor.slider.mini.js"></script>'; $oscTemplate->addBlock($footer_tag, 'footer_scripts'); it should work.
  20. Gyakutsuki

    How to integrate with OSCommerce?

    If you want to use a warehouse, you can use ERP odoo and use the add on osc to odoo. It manage the stock
  21. Gyakutsuki

    Europe Confidentialities Cookie Law

    @metaminas2015 No, you must to do a manual installation adapted to 2.2
  22. Gyakutsuki

    Europe Confidentialities Cookie Law

    To activate the module, you must go in modules/header tag section in the admin of osc, that' all.
  23. you can try this contribution : http://addons.oscommerce.com/info/9354