Page 1 of 1

Can I set free shipping to certain products only?

Posted: Thu Nov 11, 2010 9:58 pm
by world-of-satellite
As the title, I need to set free shipping to certain products only. I've seen this thread http://forum.opencart.com/viewtopic.php?f=114&t=19450 but nothing seems to have moved on.

I'm willing to pay for a module if there is one.

Re: Can I set free shipping to certain products only?

Posted: Thu Nov 11, 2010 10:08 pm
by world-of-satellite
Could this module be used http://theqdomain.com/ocstore/opencart_ ... by_product

Say for instance set the shipping price on certain products to zero to just UK shipping zones?

Re: Can I set free shipping to certain products only?

Posted: Fri Nov 12, 2010 11:02 am
by Qphoria
I am working on supporting geozones but at the moment it does not support them. Additionally, if you wanted to make some items free, then you would have to set prices for all other items. Not sure of the best way to handle this

Re: Can I set free shipping to certain products only?

Posted: Sun Nov 14, 2010 11:54 pm
by JAY6390
Yeah, it's a bit of a tricky one really, no easy way to do it except set prices specifically like Q says

Re: Can I set free shipping to certain products only?

Posted: Tue Nov 30, 2010 6:17 pm
by world-of-satellite
Qphoria wrote:I am working on supporting geozones but at the moment it does not support them. Additionally, if you wanted to make some items free, then you would have to set prices for all other items. Not sure of the best way to handle this
Is there anyway a product can be set to free shipping in Product > Data > Requires shipping? So you could have yes, no and free shipping.

Re: Can I set free shipping to certain products only?

Posted: Tue Nov 30, 2010 6:49 pm
by world-of-satellite
Just had a thought. Could one way round this be as follows: -

1. Set product weight to Zero.
2. In weight based shipping for the zone where free shipping will apply add a 0:0.00 shipping cost for goods set to zero weight.

So with the above in place all items will get a shipping charge unless weight is set to zero.

What do you guys think?

Re: Can I set free shipping to certain products only?

Posted: Tue Nov 30, 2010 10:01 pm
by Johnathan
Seems like a clever solution, unless you need to know the weight (or display it to the customer) for some reason.

Re: Can I set free shipping to certain products only?

Posted: Sun Dec 05, 2010 4:05 am
by tvieira24
On my old oscommerce cart I used to do free shipping per product using "0" as the weight value. It seems like this can be done pretty easily by modifying the existing free shipping module to pull weight rather than price.

Re: Can I set free shipping to certain products only?

Posted: Wed Dec 08, 2010 2:35 pm
by cashman9
An option is to create a module that would have a checkbox in the product page and asking, eligible for free shipping, and then a user chooses shippings, he can choose free shippings. It should be on specific items only.

Another option is create a module that will require a selection of items from the module itselfs that eligible for free shipping and will show up for that items in the check out.

Can anyone create this module?

Re: Can I set free shipping to certain products only?

Posted: Thu Dec 09, 2010 4:42 am
by cashman9
Thanks to Q, module has been updated to allow this:
http://forum.opencart.com/viewtopic.php?f=24&t=23895

Re: Can I set free shipping to certain products only?

Posted: Wed Jan 09, 2013 10:34 am
by sebastienpilon
This is what I did and it works just fine. (opencart Version 1.5.4)

First of all, you'll need to modify the query who fetch the datas in the product page because no shipping field is returned from the mysql request . As you probably have seen, their is a radio button "Shipping required"
in catalog/model/product.php
add p.shipping to the query on line 14

$query = $this->db->query("SELECT DISTINCT *, p.shipping AS shipping_applicable, pd.name AS name, [...]

after you need to assign the result in the (in construction array)
ex;
[...]
'viewed' => $query->row['viewed'],
'shipping_applicable' => $query->row['shipping_applicable'] // you can choose the name you want
[...]

now locate : catalog/controller/product/product.php

and add this

$this->data['text_free_shipping'] = $this->language->get('text_free_shipping');

Add the text in respective language files
ex: $_['text_free_shipping'] = 'Livraison gratuite!';
-----------------------
Finally modify you template to show the new vars
/view/theme/template/product/product.tpl

this is what I did, you can decide to place it anywhere you want
<?php if($shipping_applicable == 0){ ?><span class="free_shipping"><?php echo $text_free_shipping; ?></span></div><?php } ?>

edit your stylesheel to style your <span> by adding a class
.free_shipping {
color: #FFFFFF;

}

Re: Can I set free shipping to certain products only?

Posted: Thu Aug 21, 2014 12:26 pm
by thegeekz
Digging up old thread as I think I may need this for my cart and my friend's cart.. Using OC 1.5.6.+

Sebastienpilon: possible to show the screenshot here of how your modding below ---- the results in the cart?


Also as I understand this is for free shipping for certain products that has the free shipping enabled in product page, what if customer orders this item and another item that is not eligible for free shipping?

Will the shipping fee be still charged for the other item?


If my friend requires that since customer ordered both, free shipping will apply to both instead of having to charge the shipping fee for the non-eligible item?

Thank you.

sebastienpilon wrote:This is what I did and it works just fine. (opencart Version 1.5.4)

First of all, you'll need to modify the query who fetch the datas in the product page because no shipping field is returned from the mysql request . As you probably have seen, their is a radio button "Shipping required"
in catalog/model/product.php
add p.shipping to the query on line 14

$query = $this->db->query("SELECT DISTINCT *, p.shipping AS shipping_applicable, pd.name AS name, [...]

after you need to assign the result in the (in construction array)
ex;
[...]
'viewed' => $query->row['viewed'],
'shipping_applicable' => $query->row['shipping_applicable'] // you can choose the name you want
[...]

now locate : catalog/controller/product/product.php

and add this

$this->data['text_free_shipping'] = $this->language->get('text_free_shipping');

Add the text in respective language files
ex: $_['text_free_shipping'] = 'Livraison gratuite!';
-----------------------
Finally modify you template to show the new vars
/view/theme/template/product/product.tpl

this is what I did, you can decide to place it anywhere you want
<?php if($shipping_applicable == 0){ ?><span class="free_shipping"><?php echo $text_free_shipping; ?></span></div><?php } ?>

edit your stylesheel to style your <span> by adding a class
.free_shipping {
color: #FFFFFF;

}

Re: Can I set free shipping to certain products only?

Posted: Mon Jun 29, 2015 4:04 pm
by Nikolauz
For the weight based solution: in case you can assign a specific unique weight to each product, the ones that you'd like to have a selective free shipping for, just assign $0 shipping cost to that specific weight amount in the admin shipping and then add this line to function getQuote() in catalog/model/shipping/weight.php:

Find:

Code: Select all

$weight = $this->cart->getWeight();
Insert:

Code: Select all

if($weight>140) $weight=$weight-140;
as the next line (assuming that your specific weight was 140), and so for all the unique weights should there be more.

This will work correctly with any combination of your free shipping product with any other product via the weight based shipping option, as well as if it's just the free product in the cart. Weight amount in the shopping cart will be the correct one. You may want to remove the weight amount in the popup modal, however, as there the "140" amount will be subtracted and the total therefore will not correspond to the real weight.

For this, find this in template/chackout/shipping.tpl (in my system, which is 2.0.2.0)

Code: Select all

html += json['shipping_method'][i]['quote'][j]['title'] + ' - ' + json['shipping_method'][i]['quote'][j]['text'] + '</label></div>';
and remove

Code: Select all

['quote'][j]
which will result into

Code: Select all

html += json['shipping_method'][i]['title'] + ' - ' + json['shipping_method'][i]['quote'][j]['text'] + '</label></div>';
You may also find some more elegant solution for this last one.

P.S. Perhaps there are better solutions in form of extensions or else out there, I just dun't know. It's kinda overdue, isn't? We are already at 2.0.