[Skip to main content](#vessel-content)

#   Free Shipping method without product weight

##

- **[rodrigo1425](/forum/user/224-rodrigo1425 "View rodrigo1425's Profile")**
- [![rodrigo1425's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/224-rodrigo1425 "View rodrigo1425's Profile") Topic Author
- [ Offline](/forum/user/224-rodrigo1425)

Less More

- Posts: 5
- Thank you received: 0
-
-

15 years 10 months ago [\#4079](#4079) by [rodrigo1425](/forum/user/224-rodrigo1425 "View rodrigo1425's Profile")  *[Free Shipping method without product weight](/forum/4-how-to/4079-free-shipping-method-without-product-weight#4079 "Hi, is it posible?  sorry for my english  Rodrigo")* was created by *[rodrigo1425](/forum/user/224-rodrigo1425 "View rodrigo1425's Profile")*

Hi, is it posible?

sorry for my english

Rodrigo

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQwNzktZnJlZS1zaGlwcGluZy1tZXRob2Qtd2l0aG91dC1wcm9kdWN0LXdlaWdodD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14280
-
-

15 years 10 months ago [\#4081](#4081) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Free Shipping method without product weight](/forum/4-how-to/4079-free-shipping-method-without-product-weight#4081 "Hi, is it posible?  sorry for my english  Rodrigo")*

Hi,
If you don't have a weight on a product, no shipping selection will be asked to the user.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQwNzktZnJlZS1zaGlwcGluZy1tZXRob2Qtd2l0aG91dC1wcm9kdWN0LXdlaWdodD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile")
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 9 months ago [\#4793](#4793) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  Replied by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")* on topic *[Re: Free Shipping method without product weight](/forum/4-how-to/4079-free-shipping-method-without-product-weight#4793 "Hi, is it posible?  sorry for my english  Rodrigo")*

Would it be possible to change the shipping plug-in API to include a *canDisplayShipping()* method?

If not defined then behaviour is as at present.
i.e. when no weight defined then treat product(s) as virtual.

If defined then the shipping plug-in will decide for itself (e.g. from product fields) whether it is valid to display or not.

Shipping methods will display if any *canDisplayShipping()* method returns true, but will only display those methods for which *canDisplayShipping()* is true.

This avoids the need to add dummy / meaningless weights to products just to get the shipping options to display.

We are looking at 'Local Delivery' and 'Local Delivery with Installation' shipping options and weight may not be the primary variable.
E.G. installation offered with some products, not relevant with others.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQwNzktZnJlZS1zaGlwcGluZy1tZXRob2Qtd2l0aG91dC1wcm9kdWN0LXdlaWdodD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14280
-
-

15 years 9 months ago [\#4797](#4797) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Free Shipping method without product weight](/forum/4-how-to/4079-free-shipping-method-without-product-weight#4797 "Hi, is it posible?  sorry for my english  Rodrigo")*

There is already the function onShippingDisplay which has this role.
The function onShippingDisplay is called with all the order information (in the variable $order) and the shipping methods (in the variable $dbrates) so that the shipping plugin can add the valid shipping methods (in the variable $usable_rates).

So in that function, you could parse the product information like this:
foreach($order-&gt;products as $k =&gt; $product){
//do something here
}

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQwNzktZnJlZS1zaGlwcGluZy1tZXRob2Qtd2l0aG91dC1wcm9kdWN0LXdlaWdodD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile")
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 9 months ago [\#4812](#4812) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  Replied by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")* on topic *[Re: Free Shipping method without product weight](/forum/4-how-to/4079-free-shipping-method-without-product-weight#4812 "Hi, is it posible?  sorry for my english  Rodrigo")*

From a further quick look at the code it still means that a weight must be specified somewhere in order to trigger a shipping method.
See *controllers/checkout.php* where you have code like this: Code:

$shipping = ( bccomp(@$this-&gt;cartData-&gt;weight,0,5)&gt;0 ? true : false ); if($shipping){ $class = hikashop::get('class.shipping'); $methods =&amp; $class-&gt;getShippings($this-&gt;cartData);

Could this be changed to something like: Code:

$class = hikashop::get('class.shipping'); $methods =&amp; $class-&gt;getShippings($this-&gt;cartData); $shipping = !empty($methods); if($shipping){

Taking the manual shipping plugin as an example the first line of *onShippingDisplay* in *manual/manual.php* could then be changed from: Code:

function onShippingDisplay(&amp;$order,&amp;$dbrates,&amp;$usable_rates,&amp;$messages){ if(empty($dbrates)){

to: Code:

function onShippingDisplay(&amp;$order,&amp;$dbrates,&amp;$usable_rates,&amp;$messages){ if (bccomp(@$order-&gt;weight,0,5)&gt;0 ? false : true) { return false; } if(empty($dbrates)){

This would maintain the existing behaviour while moving responsibility for the weight check into the shipping plug-in where it would be accessible to any developer writing a new shipping plug-in.

I notice this weight check occurs elsewhere in *controllers/checkout.php* so there might be other ramifications of this suggestion which would need investigation.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQwNzktZnJlZS1zaGlwcGluZy1tZXRob2Qtd2l0aG91dC1wcm9kdWN0LXdlaWdodD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14280
-
-

15 years 9 months ago [\#4824](#4824) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Free Shipping method without product weight](/forum/4-how-to/4079-free-shipping-method-without-product-weight#4824 "Hi, is it posible?  sorry for my english  Rodrigo")*

Yes, that could be possible. We will look at doing that for next release. As you pointed out, there is more to it than just those two places and we will need to review the checkout carefully when doing it.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQwNzktZnJlZS1zaGlwcGluZy1tZXRob2Qtd2l0aG91dC1wcm9kdWN0LXdlaWdodD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile")
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 9 months ago [\#4858](#4858) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  Replied by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")* on topic *[Re: Free Shipping method without product weight](/forum/4-how-to/4079-free-shipping-method-without-product-weight#4858 "Hi, is it posible?  sorry for my english  Rodrigo")*

Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzQwNzktZnJlZS1zaGlwcGluZy1tZXRob2Qtd2l0aG91dC1wcm9kdWN0LXdlaWdodD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.082 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
