- Posts: 49
- Thank you received: 1
How to display "Only X more to get free shipping"?
- ahacreative
-
Topic Author
- Offline
-- 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 or Create an account to join the conversation.
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>Views in order to add your custom code to display such dynamic message.
Please Log in or Create an account to join the conversation.
- ahacreative
-
Topic Author
- Offline
- Posts: 49
- Thank you received: 1
Thanks again!
Please Log in or Create an account to join the conversation.
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 or Create an account to join the conversation.
Link: businessbloomer.com/woocommerce-add-need...-shipping-cart-page/
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 or Create an account to join the conversation.
You can edit the view "checkout / shipping" and add that code at the beginning between PHP tags:
Then add this translation override in the language file:
Please Log in or Create an account to join the conversation.
In configuration=>checkout workflow I have the following settings:
Cart | Payment
Login
Fields
So I added the code at the top of checkout/cart.php after the first <?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 or Create an account to join the conversation.
My bad, I was thinking that you were talking about the quantity and not the price.
So here is the updated code:
You can use "$this->full_total->prices[0]->price_value_without_shipping" instead if you want to do the check on a price without tax.
Please Log in or Create an account to join the conversation.
It still ain't working.
I tried placing the code in both checkout / cart.php and shipping.php just below the first "<?php" like this:
....and now the message in the front-end says
Message:
"Get free shipping if you order 0 more!"
Any solution ?
Please Log in or Create an account to join the conversation.
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->full_total->prices[0]->price_value_without_shipping;
Please Log in or Create an account to join the conversation.
This is a good function. You should make it a standard function in Hikashop.
Please Log in or Create an account to join the conversation.
Joomla 3.4.8
Hi, I try to do this in my shop but I can`t. I customize the shipping view and my code is this:
$comanda = $this->full_total->prices[0]->price_value_without_shipping;
$preciomin = 200;
if($comanda < $preciomin){
$diffQty = $preciomin - $comanda;
echo "<h3>Te faltan " . $diffQty . "€ para conseguir el ENVÍO GRATIS!<h3>"
}
The variable $comanda is zero everytime, I don't know if $comanda = $this->full_total->prices[0]->price_value_without_shipping; is correct
Please Log in or Create an account to join the conversation.
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:
Please Log in or Create an account to join the conversation.
I do have code like this:
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 or Create an account to join the conversation.
Instead of:
Please Log in or Create an account to join the conversation.
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:
Am I on correct way?
Thanks
Please Log in or Create an account to join the conversation.
It's simpler. Just add such line at the beginning:
Please Log in or Create an account to join the conversation.
So added this and it does work:
I am learning from you everyday Nicolas.
Thank you
Regards
Please Log in or Create an account to join the conversation.
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 or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.