Hi,

I'm using the module Commerce Shipping 7.x-2.x-dev that allows customized display_title for shipping services.

I'm from Brazil and I'm using the module Commerce Correios --dev as a shipping method, with two shipping services enabled, SEDEX and PAC. I also applied this patch to show delivery estimates.

Is working well, but when I use this module to enable free shipping to one of my services (PAC), the price is changed to 0 as expected, but the delivery estimate is not working to this service and I'm getting this error:

Notice: Undefined index: delivery_estimates em commerce_correios_commerce_shipping_line_item_new_alter() (linha 159 de /home/brunorios/www/cmc.dev/sites/all/modules/commerce_correios/commerce_correios.module).

Screenshot:
delivery estimates problem

Thank you!

CommentFileSizeAuthor
#7 free-shipping-with-estimate.jpg49.96 KBbrunorios1

Comments

delta’s picture

do you need delivery_estimates ? can you explain to me what is it ?
I believe that the price data array is supposed to contain sub-prices components only.

And to avoid this error i think you simply need to check in the module commerce_correios the existent of the key 'delivery_estimate' and then assume maybe the price has been overidded somewhere, the shipping line item must be "create-able" with a total price with or without components.

brunorios1’s picture

yes i need.
the delivery estimate is the estimated time that the service will need to deliver the order to the client.
you can see in the image that is working to the service SEDEX.
is showed like this: "2 dias úteis" ("2 business days" in brazilian portuguese).

the number of days are not being displayed in the service PAC because of the free shipping, if i remove the "free shipping" that is causing the conflict, the number of days are displayed correctly and I get no error.

delta’s picture

Assigned: Unassigned » delta
Status: Active » Needs work

oh ok i understand that commerce correios (with the patch applied) use the data array to pass info for display.
I can restore the data array without the price components array. so you got back the delivery estimate or whatever a shipping service module want to pass through the data array.

brunorios1’s picture

Great! I will be very grateful!

delta’s picture

Please give a try with the latest dev release and let us know if it's work in here.

If you like it. please post a word on our blog post, and let us know if you have some idea to make it more useful.

Thanks !

delta’s picture

Status: Needs work » Needs review
brunorios1’s picture

Status: Needs review » Closed (fixed)
StatusFileSize
new49.96 KB

Great!!! Working perfectly!

free shipping with delivery estimates working ok

Thanks for the quick support!