Home Forums Plugins CURCY – WooCommerce Multi Currency curcy and woo discount rules plugin compatibility

curcy and woo discount rules plugin compatibility

  • Author
    Posts
  • #185196

    Milan Matuska
    Participant

    Hello,
    I am using plugin woo discount rules pro (from flycart) for discounted prices.
    When I activate curcy and in my other plugin I call folloving method via ajax, the discount rules plugin is not working. When I deactivate curcy, the prices are discounted in folloving method.

    `function calculate_cart_subtotal() {
    $include_tax = wc_tax_enabled();
    $subtotal = 0;

    foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
    $line_total = $cart_item[‘line_total’];
    $line_tax = $cart_item[‘line_tax’];
    $_product = apply_filters( ‘woocommerce_cart_item_product’, $cart_item[‘data’], $cart_item, $cart_item_key );

    if (isset($cart_item[‘provize’]) && $cart_item[‘provize’] * 1 === 1) {
    // speciální podmínka pro provizi
    } else if (stripos($_product->get_sku(), ‘GVTB’) !== false) {
    // speciální podmínka pro produkty s určitým SKU
    } else {
    $subtotal += round($line_total, 2) + round($line_tax, 2);
    }
    }

    return round($subtotal,2);
    }

You must be logged in to see replies to this topic. Click here to login or register