Progressus-io / postnl-for-woocommerce

GNU General Public License v3.0
3 stars 0 forks source link

Can't print a label for a shipment outside the EU that includes a free item #164

Closed marcelabovio closed 5 days ago

marcelabovio commented 2 months ago

Because of the validation of an order item value not being 0 when printing a label for a shipment outside the EU, it's not possible to print a label for an order that includes a free item. Could it be an option to fetch the product's regular price from the products table when the order item line has a value of 0?

JorisPostNL commented 2 months ago

Hi @marcelabovio, thank you for your inquiry. The reason you are unable to print these labels actually is not a restriction of our plug-in or WooCommerce in general, but of the PostNL API used to create the labels. One of the business rules concerning non-EU shipments states that the value noted on the label should reflect the regular value of the items, rather than the value after applying a 100% discount as is the case with free items. The PostNL API call for non-EU shipments contains a line "Value" corresponding with the value of the product as noted in the product catalog and our API expects any number higher than 0 (with a minimum of 1 cent). It will return an error when it is lower than this. To solve this issue you could consider changing the price to 1 cent. I also believe some customers solve this issue by having their webshop automatically apply a 100% discount on a product which would otherwise have a normal price above 0 cents. So in that case the item would still have a regular price in the catalog, which should feed the Value line in the API call, but the customer would not have to pay anything. Since this is a feature either provided by native WooCommerce functions or through the use of another plug-in we cannot give in depth instructions about this method. However, if during this process you reach a point where our plug-in seems to be restrictive in, or incompatible with your desired method please let us know and we will do our best to assist you.

Kind regards Joris - PostNL

JorisPostNL commented 2 months ago

Hi @marcelabovio , my apologies, upon rereading your message I seem to have misinterpreted a part. I believe what you are saying is that you are already applying a 100% discount by using the Sale Price function in the product settings? Because I have just been able to reproduce this problem by using this function. I will note on our backlog to develop a fix for this in the (near) future - most likely indeed by fetching the regular price as you have suggested. In the meantime I'm afraid I have no other quick fix or solution other than setting the price to 1 cent or looking for any discount plug-ins available that work in a different way. If you do happen to find a fix yourself (for instance through the use of other plug-ins) or have any other questions about this or other matters concerning the plug-in please don't hesitate and let us know.

Kind regards Joris - PostNL

marcelabovio commented 2 months ago

Hi Joris, The situation you sketch is correct, I am applying a 100% discount using a plugin (FunnelKit). I will look for an alternative in the meantime. Thanks for your reply and for adding this issue to your backlog.

JorisPostNL commented 1 month ago

Hi @marcelabovio,

We are glad to inform you that we have finished developing and testing a fix for the issue concerning products with 100% discount. It might be a little while before we can release it, as we are bundling it with several other features and fixes, some of which are in the last stage of development.

Kind regards Joris - PostNL

marcelabovio commented 1 month ago

Thanks for including this fix, Joris! Will keep an eye for the release.

JorisPostNL commented 2 weeks ago

Hi @marcelabovio, this update has now been released. If there are any further issues or if you have other feature requests please don't hesitate to contact us at https://developer.postnl.nl/support/form/

Kind regards Joris - PostNL