Content of the page

Giftware – WooCommerce Gift Cards


Content of the article

Plugin: https://makewebbetter.com/product/giftware-woocommerce-gift-cards/

  • In file \wp-content\plugins\woocommerce-ultimate-gift-card\function\woocommerce-ultimate-gift-card-function.php add next code:
    if (class_exists('WOOCS')) {
        global $WOOCS;
        $currency = $WOOCS->current_currency;
        $currencies = $WOOCS->get_currencies();
        $rate = $currencies[$currency]['rate'];
        if (isset($_POST['mwb_wgm_price']) AND floatval($_POST['mwb_wgm_price']) != 0.0) {
            $_POST['mwb_wgm_price'] = floatval($_POST['mwb_wgm_price']) / $rate;
        }
    }

  • $rate = 1;
    if (class_exists('WOOCS')) {
        global $WOOCS;
        //$order_id=$item->get_order_id();
        //$order_currency = get_post_meta($order_id, ‘_order_currency’, true);
        //woocs
        $order_currency = $WOOCS->current_currency;
        $currencies = $WOOCS->get_currencies();
        $rate = $currencies[$order_currency]['rate'];
    }

  • $total_discount = $mwb_ugc_discount/$rate;

  • $total_discount = $mwb_ugc_discount/$rate;

  • if (class_exists('WOOCS')) {
        global $WOOCS;
        $cur_cur = $WOOCS->current_currency;
        $WOOCS->reset_currency();
        $args['amount'] = wc_price($mwb_wgm_common_arr['couponamont']);
        $WOOCS->set_currency($cur_cur);
    }

  • //woocs
    $currency_symbol = get_woocommerce_currency_symbol();
    if (class_exists('WOOCS')) {
        global $WOOCS;
        $currency = $WOOCS->default_currency;
        $currencies = $WOOCS->get_currencies();
        $currency_symbol = $currencies[$currency]['symbol'];
    }
    $message = str_replace('COUPONAMOUNT', $currency_symbol . $remaining_amount, $message);
    

Faster WordPress HostingWPBE - WordPress Posts Bulk Editor Professional