Making the Commission Fee to be Added to the WooCommerce Product Dokan Multivendor WordPressMaking the Commission Fee to be Added to the WooCommerce Product Dokan Multivendor WordPress

Hello guys how are you? Welcome back to my channel. Today in this post I am going to show you Making the Commission Fee to be Added to the WooCommerce Product | Dokan Multivendor | WordPress.

Live demo

Guys if you are new in WordPress or in WooCommerce then please check the below links for some good tutorials:

  1. WooCommerce Hooks
  2. WordPress Tricks
  3. WordPress Hooks

Guys here is the working code snippet for Woocommerce – Hide a shipping method if cart total is higher than an amount and please use carefully:

1. Guys here is the code snippet and you need to add your theme’s functions.php file:

add_filter( 'woocommerce_get_price_html', 'therich_alter_price_display', 9999, 2 );
 
function therich_alter_price_display( $price_html, $product ) {
    
    // ONLY ON FRONTEND
    if ( is_admin() ) return $price_html;
    
    // ONLY IF PRICE NOT NULL
    if ( '' === $product->get_price() ) return $price_html;
    
   
  //  if ( wc_current_user_has_role( 'customer' ) ) {
        $orig_price = wc_get_price_to_display( $product );
        $price_html = wc_price( $orig_price * 1.80 );
 //   }
    
    return $price_html;
 
}

This is it guys and if you will have any kind of query, suggestion or requirement then feel free to comment below.

Jassa

Developer’s King

Thanks

By therichpost

Hello to all. Welcome to therichpost.com. Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know WordPress, Core php, Angularjs, Angular 19, MedusaJs, Next.js, Bootstrap 5, Nodejs, Laravel, Codeigniter, Shopify, Squarespace, jQuery, Google Map Api, Vuejs, Reactjs, Big commerce etc.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.