• Resolved tom

    (@klickchoice)


    Hi, Please help to solve this issue . I need to add extra shipping charge for one product .

    i have a product1 with id =1 I need to add extra shipping charge for product with id=1

    Current Shipping settings :

    Flate rate is enable cost is 20
    Freeshipping is enable with minimum order amount 400

    So to add specific shipping charge i add a new shipping class name special-cost. Then i go to flate rate and add 15*[qty] under “special-cost” Shipping Class Cost .It work good but the problem is

    When i add product1 only it work as expected .

    When i add product1 and other product :

    (1) if total cost less than 400 working good
    (2)if total cost more than 400 it showing two radio button in checkout page for
    (1) Flat: 15 :
    (2)Free Shipping`

    How to solve this , because i need to add extra 15 charge for this product .

    Please help .

    https://www.ads-software.com/plugins/woocommerce/

Viewing 15 replies - 1 through 15 (of 20 total)
  • Thread Starter tom

    (@klickchoice)

    How can i add extra shipping charge for a specific product in woocommerce ?

    This shipping charge must be added to that product without depending any other condition .

    or

    could you please tell how to remove free shipping for a product via code.?

    Thank you .

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Possibly https://www.woothemes.com/products/per-product-shipping/

    Flat rate should work if you set this though https://dl.dropboxusercontent.com/s/w4n8lga2kqysbmh/2016-03-02%20at%2012.28.png?dl=0

    However, free shipping will still be available.

    Thread Starter tom

    (@klickchoice)

    could you please tell how to remove free shipping for a specific product via code.?

    i see this code ,https://docs.woothemes.com/document/hide-other-shipping-methods-when-free-shipping-is-available/ .. But it didn’t help

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    This is advanced example but will move the special-class item into a new package.

    https://gist.github.com/mikejolley/347b8f162257f6736c4d

    Free shipping is not enabled for this new package, just flat rate.

    Thread Starter tom

    (@klickchoice)

    Really thank you Mike . ??

    but it showing this error

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in /../../../../test/wp-includes/plugin.php on line 235

    also could you please explain this also$special_class = 'special-class';

    What i need to put in special class? , name,id or slug ?

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Updated, try again.

    Thread Starter tom

    (@klickchoice)

    Thank you ?? .

    $special_class = 'special-class';

    What i need to put in special class? , name,id or slug ?

    add_filter( 'woocommerce_cart_shipping_packages', 'split_special_shipping_class_items' ); i already try this .

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    if you see the updated snippet, it says in the comment.

    Thread Starter tom

    (@klickchoice)

    Really thank you Mike .It is working perfectly.

    I have a doubt . Prdoduct1 addeded to the cart and it’s special shipping price 15 added with it .Product one price is 500$ . When i add product one , and product 2(price: 30) it showing two shipping rate

    shipping1 :flat 20[shipping for product 2] (this is no need because price>400)
    shipping2 : Flat: AED15 [shipping charge for product1] correct

    Here what i need only shipping charge for product1 . Because the entire cost is more than 400$ so , no need to add extra shipping charge for other item .

    Thread Starter tom

    (@klickchoice)

    I need only one condition . -> if special-shipping-class product in the cart then only it’s shipping charge is calculated irrespective of other items in the cart .

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    This snippet won’t help then – this is to force a fee of 15, even if free shipping is allowed for your other items. This snippet doesn’t change free shipping at all.

    Thread Starter tom

    (@klickchoice)

    is there any way to change this ? With the help of any condition like if special-shipping is present in the cart then only take special shipping cost and don't consider other shipping cost.

    if ( isset( $rates['special_shipping'] ) ) {
    
      		$special_shipping         = $rates['special_shipping'];
      		$rates                  = array();
      		$rates['special_shipping'] = $special_shipping ;
    	}
    
    	return $rates;

    Please help to complete this code .

    But anyway very much thanks for your support .

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    I guess I’m just not clear on your needs. The snippet I gave does this:

    Special Item – must use flat rate
    Non Special Item – flat rate or free shipping

    Each is costed separately.

    If you just want flat rate 15 extra, use the classes and flat rate only (no snippet).

    Cost = 20 (?)
    Special class cost = 15 * [qty]

    Free shipping is still available based on minimum spending options.

    Thread Starter tom

    (@klickchoice)

    if some one order product1[special-shipping-class] and other products ,only the product1 shipping charge is taken , other shipping charge no need to take .

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    So:

    Special = 15
    Normal = 20
    Special + Normal = 15 (not times quantity)

    ?

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Woocommerce extra shipping charge for specific product’ is closed to new replies.