Home Forums Plugins CURCY – WooCommerce Multi Currency How to add 10% extra to product base price?

How to add 10% extra to product base price?

  • Author
    Posts
  • #166970

    courageous
    Participant

    Hello we are using paid plugin into our site, we want to add something like below with this plugin, so when user change currency from GBP to USD then we want to add 10% to product base price then calculate price in new currency.

    function return_custom_price($price, $product)
    {
    global $post, $blog_id;

    $product = wc_get_product(‘$post_id’);

    $post_id = $post->ID;
    $wc_product_id = 67438;
    if ($post_id == $wc_product_id) {
    $price = 77;
    }
    return $price;
    }
    add_filter(‘woocommerce_get_price’, ‘return_custom_price’, 10, 2);

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