• Hello.

    Your plugin is perfect to my solution, thank you for that!

    But I’m integrating my site with a payment gateway called Pagar.Me, and I need to pass the shipping cost in a JSON.

    Pagar.me allow me to pass the value of the seller, and the value of the admin. And, in some cases, the shipping is responsibility of the vendor, and some cases, the shipping is responsibility of the admin.

    To do that, I tried to get the shipping informations of the order:
    $order_shippings = $order->get_items('shipping');

    But I don’t the information about the vendor:

    [data:protected] => Array ( 
    	[order_id] => 1064 
    	[name] => Taxa fixa 
    	[method_title] => Taxa fixa 
    	[method_id] => flat_rate 
    	[instance_id] => 1 
    	[total] => 7.00 
    	[total_tax] => 0 
    	[taxes] => Array ( 
    		[total] => Array ( ) 
    	) 
    ) 
    [meta_data:protected] => Array ( 
    	[0] => WC_Meta_Data Object ( 
    		[current_data:protected] => Array ( 
    			[id] => 4536 
    			[key] => Itens 
    			[value] => Produto de Teste 1 × 1 
    		) 
    		[data:protected] => Array ( 
    			[id] => 4536 
    			[key] => Itens 
    			[value] => Produto de Teste 1 × 1 
    		) 
    	) 
    )
    

    How can I get the vendor of each shipping item?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author oneteamsoftware

    (@oneteamsoftware)

    You will have to get the list of the products and then get post_author property of the post

    Thread Starter bomelindo

    (@bomelindo)

    Ok, but I need a way to know what shipping belongs to each product. And, I just have the product name, in json.

    If I have two products with the same name, how I will know what product is the correct?

    The plugin needs offer a way to get the vendor, or the product id.

    Plugin Author oneteamsoftware

    (@oneteamsoftware)

    We don’t specifically add anything to the order for that.

    You can try this: https://stackoverflow.com/questions/46102428/get-orders-shipping-items-details-in-woocommerce-3

    Thread Starter bomelindo

    (@bomelindo)

    I’m doing exactly that.

    And by this way, It isn’t possible to know what shipping item is equivalent for each product.

    Plugin Author oneteamsoftware

    (@oneteamsoftware)

    Yes, if woocommerce does not store it then it won’t be possible. Our plugin is mainly handling grouping of the products and does not reach into orders.

    Thread Starter bomelindo

    (@bomelindo)

    Before I tried your plugin, I was using WCFM to do my multi-vendor. But, I change WCFM by Dokan.

    With WCFM, when I consulting the shipping order ($order->get_items(‘shipping’)), it was returning the product id, in meta_data, and not the product name, like your plugin.

    So, I thing is possible you alter your plugin to return the product id too. Please, study this possible to a next version. It will help me, and others.

    Thank you.

    • This reply was modified 10 months, 1 week ago by bomelindo.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Package splited by vendor’ is closed to new replies.