• Anonymous User

    (@anonymized-16179842)


    Hi,

    I’m trying to use your plug-in in my woocommerce shop, quite easy to configure and all works fine except one thing. My shop is configured in grams instead of Kilograms and when a shipment is uploaded to packlink pro web site the weight is transferred as Kilograms instead of grams…. For example, if someone buys something in my woocommerce shop with a weight of 75 grams, the shipment in packlink pro is uploaded as 75 Kilograms and I have to change it each time in packlink pro site.

    Can you please do let me know how I can fix this?

    Regards.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Anonymous User

    (@anonymized-16179842)

    Hi,

    To be honest, a little bit disappointed with the support from packlink pro about this issue. As no one answered, and no update of the plugin to fix it, I’ve found my own fix. Not happy with this but at least I’ll help some others with the same issue.

    What I did to fix it, is modify directly the plugin files, the only thing to keep in mind is when you install an update of the plugin, you will have to do again the changes.

    FIX is:

    – edit file wp-content/plugins/packlink-pro-shipping/Components/Order/class-order-repository.php
    – Look for the function “private function get_order_items( WC_Order $wc_order )”
    – Inside this function there is a line like this:

    $item->setWeight( (float) $product->get_weight());

    – Replace this line by:

    $item->setWeight( (((float) $product->get_weight()) / 1000) + 0.400);

    – Dividing by 1000, I translate weight from grams to kilograms. The “0.400” at the end is basically to add the weight of my box.

    That’s all.

    Thread Starter Anonymous User

    (@anonymized-16179842)

    Hi,

    there is a mistake in the above code. Better to remove adding the wight of box (0.400) because in this way will be added for each item in the order. So the right code is just:

    $item->setWeight( (((float) $product->get_weight()) / 1000) );

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘wrong weight uploaded to packlinkpro’ is closed to new replies.