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

#   How to display "Only X more to get free shipping"?

##

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

Less More

- Posts: 49
- Thank you received: 1
-
-

11 years 7 months ago [\#197497](#197497) by [ahacreative](/forum/user/36037-ahacreative "View ahacreative's Profile")  *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#197497 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")* was created by *[ahacreative](/forum/user/36037-ahacreative "View ahacreative's Profile")*

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.4.27
-- Browser(s) name and version -- : Firefox 36.0.4
-- Error-message(debug-mod must be tuned on) -- : N/A

Hi,

Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.

Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

11 years 7 months ago [\#197510](#197510) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#197510 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")*

Hi,

When you have free shipping over a certain amount, you have ( at least ) two different shipping methods.
One which is free for above the threshold, and one paying for below it. In the later, you could enter a static message to tell the user that he could get free shipping if purchasing at least $75 of goods.
That's the best you can do with the options available by default without any coding.
Then, if you want something closer to your needs, you can edit the file "step" of the view "checkout" via the menu Display&gt;Views in order to add your custom code to display such dynamic message.

The following user(s) said Thank You: [ahacreative](/forum/user/36037-ahacreative "View ahacreative's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

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

Less More

- Posts: 49
- Thank you received: 1
-
-

11 years 7 months ago [\#197618](#197618) by [ahacreative](/forum/user/36037-ahacreative "View ahacreative's Profile")  Replied by *[ahacreative](/forum/user/36037-ahacreative "View ahacreative's Profile")* on topic *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#197618 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")*

Thank you for your reply. I actually have the static message set up already. This will work fine for the time being. I will check out the Views to try and get something more dynamic going on.

Thanks again!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[river](/forum/user/9591-river "View river's Profile")**
- [![river's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar9591.gif)](/forum/user/9591-river "View river's Profile")
- [ Offline](/forum/user/9591-river)

Less More

- Posts: 344
- Thank you received: 3
-
-

11 years 2 weeks ago [\#218407](#218407) by [river](/forum/user/9591-river "View river's Profile")  Replied by *[river](/forum/user/9591-river "View river's Profile")* on topic *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#218407 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")*

> ahacreative wrote: Thank you for your reply. I actually have the static message set up already. This will work fine for the time being. I will check out the Views to try and get something more dynamic going on.
>
> Thanks again!

Did you manage to create this dynamic message ? I would love to have this function too.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[river](/forum/user/9591-river "View river's Profile")**
- [![river's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar9591.gif)](/forum/user/9591-river "View river's Profile")
- [ Offline](/forum/user/9591-river)

Less More

- Posts: 344
- Thank you received: 3
-
-

11 years 2 weeks ago [\#218410](#218410) by [river](/forum/user/9591-river "View river's Profile")  Replied by *[river](/forum/user/9591-river "View river's Profile")* on topic *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#218410 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")*

I found this code snippet from woocommere and how they did it there.

Link: [ businessbloomer.com/woocommerce-add-need...-shipping-cart-page/](http://businessbloomer.com/woocommerce-add-need-spend-x-get-free-shipping-cart-page/)
Code:

// If your free shipping threshold is 1500 as per Woocommerce settings... // ...show a cart notice if order subtotal is less than 1500 function cart_notice() { $maximum = 1500; $current = WC()-&gt;cart-&gt;subtotal; if ( $current &lt; $maximum ) { echo '&lt;div class="woocommerce-message"&gt;Get free shipping if you order $' . ($maximum - $current) . ' more!&lt;/div&gt;'; } } add_action( 'woocommerce_before_cart', 'cart_notice' );

Any suggestion on how we can modify it to use in Hikashop
To get free shipping in my store you have to buy for NOK 900 +++

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 2 weeks ago [\#218435](#218435) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#218435 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")*

Hi,

You can edit the view "checkout / shipping" and add that code at the beginning between PHP tags: Code:

$minQtyForFree = 900; $productQty = 0; foreach($this-&gt;order-&gt;products as $product){ $productQty += $product-&gt;cart_product_quantity; } if($productQty &lt; $minQtyForFree){ $diffQty = $minQtyForFree - $productQty; $app = JFactory::getApplication(); $app-&gt;enqueueMessage(JText::sprintf('MISSING_QTY_FOR_FREE_SHIPPING',$diffQty)); }

Then add this translation override in the language file: Code:

MISSING_QTY_FOR_FREE_SHIPPING="Get free shipping if you order %s more!"

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[river](/forum/user/9591-river "View river's Profile")**
- [![river's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar9591.gif)](/forum/user/9591-river "View river's Profile")
- [ Offline](/forum/user/9591-river)

Less More

- Posts: 344
- Thank you received: 3
-
-

11 years 2 weeks ago [\#218653](#218653) by [river](/forum/user/9591-river "View river's Profile")  Replied by *[river](/forum/user/9591-river "View river's Profile")* on topic *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#218653 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")*

Tnx for reply

In configuration=&gt;checkout workflow I have the following settings:

Cart &#124; Payment
Login
Fields

So I added the code at the top of checkout/cart.php after the first &lt;?php

Now the new message in the front-end is displaying just fine(at the top)

But it only removes 1 NOK for each product that I add to the cart.

I.e: I have added three products to my cart with a total amount of 698 NOK, and the message at the top says:

"Get free shipping if you order 897 more!"

The correct would be:

"Get free shipping if you order 222 more!"

Any soution ? Hope my explenation make sense.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 2 weeks ago [\#218717](#218717) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#218717 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")*

Hi,

My bad, I was thinking that you were talking about the quantity and not the price.
So here is the updated code: Code:

if($this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_shipping_with_tax &lt; 900){ $diffQty = $minPriceForFree - $fullPrice; $app = JFactory::getApplication(); $app-&gt;enqueueMessage(JText::sprintf('MISSING_QTY_FOR_FREE_SHIPPING',$diffQty)); }

You can use "$this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_shipping" instead if you want to do the check on a price without tax.

The following user(s) said Thank You: [river](/forum/user/9591-river "View river's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[river](/forum/user/9591-river "View river's Profile")**
- [![river's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar9591.gif)](/forum/user/9591-river "View river's Profile")
- [ Offline](/forum/user/9591-river)

Less More

- Posts: 344
- Thank you received: 3
-
-

11 years 2 weeks ago [\#218750](#218750) by [river](/forum/user/9591-river "View river's Profile")  Replied by *[river](/forum/user/9591-river "View river's Profile")* on topic *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#218750 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")*

Tnx for reply.
It still ain't working.

I tried placing the code in both checkout / cart.php and shipping.php just below the first "&lt;?php" like this:
Code:

&lt;?php if($this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_shipping &lt; 900){ $diffQty = $minPriceForFree - $fullPrice; $app = JFactory::getApplication(); $app-&gt;enqueueMessage(JText::sprintf('MISSING_QTY_FOR_FREE_SHIPPING',$diffQty)); } /** * @package HikaShop for Joomla! * @version 2.5.0 * @author hikashop.com * @copyright (C) 2010-2015 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */

....and now the message in the front-end says

Message:
"Get free shipping if you order 0 more!"

Any solution ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

11 years 2 weeks ago [\#218783](#218783) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#218783 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")*

Hi,

Of course, in the code Xavier provided, you need to replace $minPriceForFree by the minimum price you want for the message to appear, and $fullPrice by the variable where the price is stored
So the line:
$diffQty = $minPriceForFree - $fullPrice;
should actually be:
$diffQty = 900 - $this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_shipping;

The following user(s) said Thank You: [river](/forum/user/9591-river "View river's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[river](/forum/user/9591-river "View river's Profile")**
- [![river's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar9591.gif)](/forum/user/9591-river "View river's Profile")
- [ Offline](/forum/user/9591-river)

Less More

- Posts: 344
- Thank you received: 3
-
-

11 years 2 weeks ago [\#218814](#218814) by [river](/forum/user/9591-river "View river's Profile")  Replied by *[river](/forum/user/9591-river "View river's Profile")* on topic *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#218814 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")*

Perfect ! it works !

This is a good function. You should make it a standard function in Hikashop.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

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

Less More

- Posts: 21
- Thank you received: 0
-
- [](http://cesarlabadia.com)
-

10 years 6 months ago [\#237924](#237924) by [cesarlab69](/forum/user/7417-cesarlab69 "View cesarlab69's Profile")  Replied by *[cesarlab69](/forum/user/7417-cesarlab69 "View cesarlab69's Profile")* on topic *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#237924 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")*

Hikashop 2.6.2
Joomla 3.4.8

Hi, I try to do this in my shop but I can&#96;t. I customize the shipping view and my code is this:

$comanda = $this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_shipping;
$preciomin = 200;

if($comanda &lt; $preciomin){
$diffQty = $preciomin - $comanda;
echo "&lt;h3&gt;Te faltan " . $diffQty . "€ para conseguir el ENVÍO GRATIS!&lt;h3&gt;"
}

The variable $comanda is zero everytime, I don't know if $comanda = $this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_shipping; is correct

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

10 years 6 months ago [\#237926](#237926) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#237926 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")*

Hi,

The value price_value_without_shipping will only be available if there is already shipping applied to the cart.
So you can use price_value instead: Code:

$comanda = $this-&gt;full_total-&gt;prices[0]-&gt;price_value; $preciomin = 200; if($comanda &lt; $preciomin){ $diffQty = $preciomin - $comanda; echo "&lt;h3&gt;Te faltan " . $diffQty . "€ para conseguir el ENVÍO GRATIS!&lt;h3&gt;" }

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile")
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 6 months ago [\#238153](#238153) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#238153 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")*

Hi,

I do have code like this:
Code:

&lt;?php if($this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_shipping &lt; 20){ $diffQty = 20 - $this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_shipping; $text = JText::sprintf('MISSING_QTY_FOR_FREE_SHIPPING',$diffQty); echo '&lt;td colspan="3" class="hidden-phone hikashop_cart_empty_footer"&gt;&lt;span class="free_shipping_alert"&gt;'.$text.'&lt;/span&gt;&lt;/td&gt;'; } else echo $td; ?&gt;

It works fine but how to have coupon not applied to this? I mean if someone has in cart product for 21eur and enter coupon for discount -10eur it would give message. I do have free shipping on orders over 20eur...

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

10 years 6 months ago [\#238175](#238175) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#238175 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")*

Hi,

Instead of: Code:

$this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_shipping

you can try using: Code:

$this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_discount

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile")
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 6 months ago -  10 years 6 months ago [\#238363](#238363) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#238363 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")*

Hi,

Well it didn't work. Code would work as expected only if discount is entered...else it shows u need to add 20eur.....
So I tried to add something like this but it didn't work too:
Code:

&lt;?php if($this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_shipping &lt; 20){ $diffQty = 20 - $this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_shipping; $diffQtydisc = 20 - $this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_discount; $text = JText::sprintf('MISSING_QTY_FOR_FREE_SHIPPING',$diffQty); $text2 = JText::sprintf('MISSING_QTY_FOR_FREE_SHIPPING',$diffQtydisc); echo '&lt;td colspan="3" class="hidden-phone hikashop_cart_empty_footer"&gt;&lt;span class="free_shipping_alert"&gt;'.$text.'&lt;/span&gt;&lt;/td&gt;'; } elseif ($this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_discount &lt; 20){ echo '&lt;td colspan="3" class="hidden-phone hikashop_cart_empty_footer"&gt;&lt;span class="free_shipping_alert"&gt;'.$text2.'&lt;/span&gt;&lt;/td&gt;'; } else echo $td; ?&gt;

Am I on correct way?

Thanks

Last edit: 10 years 6 months ago by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

10 years 6 months ago [\#238378](#238378) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#238378 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")*

Hi,

It's simpler. Just add such line at the beginning: Code:

if(empty($this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_discount)) $this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_discount = $this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_shipping;

And that way, when price_value_without_discount is missing, it will be filled with the value from price_value_without_shipping so that you can do your test on price_value_without_discount like before.

The following user(s) said Thank You: [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile")
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 6 months ago [\#238558](#238558) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#238558 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")*

Hi,

So added this and it does work:
Code:

&lt;?php if(empty($this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_discount)) $this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_discount = $this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_shipping; if($this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_discount &lt; 20){ $diffQty = 20 - $this-&gt;full_total-&gt;prices[0]-&gt;price_value_without_discount; $text = JText::sprintf('MISSING_QTY_FOR_FREE_SHIPPING',$diffQty); echo '&lt;td colspan="3" class="hidden-phone hikashop_cart_empty_footer"&gt;&lt;span class="free_shipping_alert"&gt;'.$text.'&lt;/span&gt;&lt;/td&gt;'; } else echo $td; ?&gt;

I am learning from you everyday Nicolas.
Thank you

Regards

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile")
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 6 months ago [\#239756](#239756) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#239756 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")*

Hi,

One more thing. How can i round price_value?
Now if product added to cart has 19.99 it will display something like this: 0.010000000000002 €. Would be good to have 0.01 only

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

10 years 6 months ago [\#239757](#239757) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to display "Only X more to get free shipping"?](/forum/25-install-update/876200-how-to-display-only-x-more-to-get-free-shipping#239757 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.4.27 -- Browser(s) name and version -- : Firefox 36.0.4 -- Error-message(debug-mod must be tuned on) -- : N/A  Hi,  Is there a built-in function in HikaShop to display how much more a customer needs to spend in order to receive free shipping? All of our products are charged shipping according to weight. However, once they spend $75.00 or more, they receive free shipping.  Is there a way to add a status / progress bar that will alert customers they only have to spend X more to qualify for free shipping?")*

Hi,

You can use the PHP round function:
[ php.net/manual/en/function.round.php](http://php.net/manual/en/function.round.php)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzg3NjIwMC1ob3ctdG8tZGlzcGxheS1vbmx5LXgtbW9yZS10by1nZXQtZnJlZS1zaGlwcGluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) 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.104 seconds

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