user3042 Developer Từ United Kingdom Thành viên kể từ thg 5 2016 user3042 24 thg 5 2016 12:11 Hi everyone, Is there a way to set free shipping on certain products? I did think to set the product weight to 999 to trigger that effect but rather not, or if you can point me in the right direction to which files to edit that would be great. Fantastic script by the way! Thanks.
tim Founder Từ Sweden Thành viên kể từ thg 5 2013 tim 24 thg 5 2016 12:37 One way could be to set the weight to 0. And don't return a shipping option if cart total weight is 0. Other than that you would need to write a custom shipping module with conditions for e.g. the product IDs.
user3042 Developer Từ United Kingdom Thành viên kể từ thg 5 2016 user3042 24 thg 5 2016 13:02 Aha yes, that's opposite to the 999 but better idea, thanks a lot for that.
s22_tech Moderator Từ United States Thành viên kể từ thg 10 2019 s22_tech 24 thg 10 2020 02:06 [quote]Other than that you would need to write a custom shipping module with conditions for e.g. the product IDs.[/quote] Would you give us an example of using products ID's in a shipping module? Were you just talking about hard-coding certain ID's in the module, or is there a more elaborate way?
tim Founder Từ Sweden Thành viên kể từ thg 5 2013 tim 24 thg 10 2020 02:20 @s22_tech if (!in_array($item['product_id'], preg_split('#\s*,\s*#', $this->settings['product_ids']))) continue; ... code here for matched product ... }