Suggestion
-
Hi,
I already have 3000 products registered. They dont have HxWxL.So, I made some modifications in your script and everything is working fine. I am justing using the Weight of the products.
Sharing the solution (maybe you can add to the core)
First adding a new function into the wc-correios.phpprotected function is_virtual_order($package) { foreach ( $package['contents'] as $item_id => $values ) { $product = $values['data']; if (!$product->is_virtual()) { return false; } } return true; }
Then replace inside correios_connect( $package ) function the following code:
if ( !empty( $measures['height'] ) && !empty( $measures['width'] ) && !empty( $measures['length'] ) ) {
with:
if ( !$this->is_virtual_order($package) ) {
Warnings may be shown at max() functions calls inside Correios/Cubage.php… Just add a @ to ignore those warnings …
You could add a setting ‘Ignore product cubage (just use weight)’
Thank you.
https://www.ads-software.com/extend/plugins/woocommerce-correios/
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Suggestion’ is closed to new replies.