Hi,
Thanks for using our plugin and reaching out to us.
Our plugin can only add shipping costs to Google Shopping feeds when those have been configured using the normal WooCommerce shipping feature. Adding it any other way is not possible (indeed because of the complex nature of the Shipping XML).
Perhaps you can add the shipping costs directly in your Google Merchant Center instead of your feed? (using the shipping_label construction)?
I tried to enter directly to google shopping, but since it is static and not dynamic per product, there is data inconsistency.
Are there any filters I could use to pass this information to the feed?
When you have static shipping costs that are the same for all your products it should be really easy to add those directly in your Google Merchant Center. Make sure though to add the correct shipping labels to your feed like described in the second part of this blog post: https://adtribes.io/add-shipping-costs-google-shopping-feed/
I mean, the shipping costs added through google are static, My shipping costs are dynamic per product, and we would like to hook or use filter to get these when creating the feed.
Is this possible?
No, that unfortunately will not be possible with our plugin.
We’ve managed to come up a with temp solution, editing your plugin, but it won’t last with updates.
Maybe we can solve this together? it would make your plugin be compatible with some marketplaces solutions out there and dynamically take shipping prices for each product ( we’ve managed to make it work!)
If there’s an option to develop it together and come up with a solution, i will be more than happy to
Sure, by all means, show us what you changed so we can see if we can add it to the plugin source code.
Here it is, on behalf of the great Martins:
https://drive.google.com/file/d/1PYQ7uth2n05ZdvetKsOTemNlEyfVhs5X/view?usp=sharing
Note:
Its currently set to work with dokan multivendor, specific to our site, where it takes dynamically from each product, its lowest shipping cost, and adds it to the feed.
-
This reply was modified 4 years, 2 months ago by
tomeryatir.
Also, if its possible to integrate some kind of filters, like these (just an example):
<?php
$custom = apply_filter('custom_shipping', false);
if(!$custom){
$ship = explode("||", $v);
foreach ($ship as $kk => $vv){
$sub_count = substr_count($vv, '##');
$shipping = $product->addChild($k, '',htmlspecialchars($namespace['g']));
$ship_split = explode(":", $vv);
foreach($ship_split as $ship_piece){
$piece_value = explode("##", $ship_piece);
if (preg_match("/WOOSEA_COUNTRY/", $ship_piece)){
$shipping_country = $shipping->addChild('g:country', $piece_value[1], $namespace['g']);
} elseif (preg_match("/WOOSEA_REGION/", $ship_piece)){
$shipping_region = $shipping->addChild('g:region', $piece_value[1], $namespace['g']);
} elseif (preg_match("/WOOSEA_POSTAL_CODE/", $ship_piece)){
$shipping_price = $shipping->addChild('g:postal_code', $piece_value[1], $namespace['g']);
} elseif (preg_match("/WOOSEA_SERVICE/", $ship_piece)){
$shipping_service = $shipping->addChild('g:service', $piece_value[1], $namespace['g']);
} elseif (preg_match("/WOOSEA_PRICE/", $ship_piece)){
$shipping_price = $shipping->addChild('g:price',trim($piece_value[1]),$namespace['g']);
} else {
// DO NOT ADD ANYTHING
}
}
}
}else{
add_action('custom_feed_shipping', $product);
}
?>
-
This reply was modified 4 years, 2 months ago by
tomeryatir.
We’ve well tested the changes, and they seem to work pretty well with dokan.
We manually marked to each user, its relevant country-wide shipping method, and google managed to read it properly.