cancel
Showing results for 
Search instead for 
Did you mean: 

Free Shipping data not send

SOLVED

Free Shipping data not send

Hey,

 

I'm using Magento 2 with Moloni plugin, and I need that the invoice have the free value but if I'm not wrong when it's free it does not send the data so it does no appear in the invoice, if I define a value it works just fine but when it's free or 0.00 it does not appear.

Any way to work around this?

 

Thanks in advance!

Regard

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Free Shipping data not send

Hey good news

 

The support didn't reply but I figured it out, it was easy now I feel dumb ahah
If ever anyone have this problem it is from the plugin as @theMageComp and thanks for the tip it helped a lot!

It is in vendor/moloni/magento2/Libraries/MoloniLibrary/Controllers/Documents.php

 

it has this line

if ($this->order->getShippingAmount() > 0) {
  $this->document['products'][] = $this->products->create()->setShippingFromOrder($this->order);
}
making that it never reaches the code that write in the invoice if it is 0, just remove the if or put it to >=
 
Thanks for all the help and hope it helps someone Smiley Very Happy

View solution in original post

3 REPLIES 3

Re: Free Shipping data not send

Hello @rui_silva1 

That shouldn't happen, did you try contacting extension developer?

Was my answer helpful? You can accept it as a solution.
175+ Professional Extensions for M1 & M2
Need a developer?Just visit Contact Us Now

Re: Free Shipping data not send

Hey @theMageComp,

 

I did, I'm waiting on their response, I tried to check the code of the plugin but didn't find what made that the shipping when 0.00 don't send.

 

Thanks for the reply Smiley Very Happy

Re: Free Shipping data not send

Hey good news

 

The support didn't reply but I figured it out, it was easy now I feel dumb ahah
If ever anyone have this problem it is from the plugin as @theMageComp and thanks for the tip it helped a lot!

It is in vendor/moloni/magento2/Libraries/MoloniLibrary/Controllers/Documents.php

 

it has this line

if ($this->order->getShippingAmount() > 0) {
  $this->document['products'][] = $this->products->create()->setShippingFromOrder($this->order);
}
making that it never reaches the code that write in the invoice if it is 0, just remove the if or put it to >=
 
Thanks for all the help and hope it helps someone Smiley Very Happy