Error Adding Shipping DIscount

Permalink Browser Info Environment
Attempting to add a free shipping discount results in this error:

Warning: Invalid argument supplied for foreach() in packages/core_commerce/models/shipping/method.php on line 19


when using V 2.0.8 of core commerce. This is because this addon does not set the $shippingMethods property.

Adding

protected $shippingMethods = array(
        'LOCALPICKUP' => 'Local Pickup'
        );


(which I stole from the native flat rate shipping) into the controller.php fixes the error

Type: Discussion
Status: New
jero
View Replies:
tbcrowe replied on at Permalink Reply
tbcrowe
Thank you for reporting this problem. The error you ran into is due to a known bug in the eCommerce add-on. It affects shipping methods that don't support free shipping discounts. I have added support for free shipping discounts to Local Pickup in version 1.1.1. The changes required for full support of the discount are a little more involved than your fix, so I suggest updating if you plan to use free shipping discounts.

Thanks again,
Todd
jero replied on at Permalink Reply
jero
Thanks, will do!
in2orbit replied on at Permalink Reply
in2orbit
Hi Todd

Are you able to share the fixes as i need to implement this urgently to the table-based shipping addon, which isn't supported thanks in advance.
tbcrowe replied on at Permalink Reply 1 Attachment
tbcrowe
Please try the attached version of TBS. It's much newer than the version available in the Marketplace and includes support for the free shipping discount.
in2orbit replied on at Permalink Reply
in2orbit
Hi Todd

Thanks for that, however before table based shipping allowed for price from and to now its just from and so i can no longer specify prices i.e. 0-50 is 5 and 51+ is free like i did before, please help, thanks
tbcrowe replied on at Permalink Reply
tbcrowe
You can specify ranges with TBS. The lower value is just implied. So, if the lowest "Up to" value you enter is 5 that "row" would include order with up to 5 products.

By the way, table based shipping is not a product I support. It was written by another developer. The only reason I have a newer version is because I have developed it for my own clients.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.