Jump to content
hostricity

Cannot disable Free Shipping

Recommended Posts

The shopping cart is displaying "Free Shipping" even though free shipping is disabled.

 

It calculates the shipping correctly when we get to shipping in the checkout. In fact, if a customer logs in, it immediately calculates the shipping and displays the lowest shipping cost.

 

"Free Shipping" is disabled in the back office.

 

How do we stop PrestaShop from displaying "Free Shipping" before the shipping has been calculated? The shipping field should be blank or say something - anything except "Free Shipping"

 

See two images.

Order - Pendulum Charts by Xeonix - Free Shipping.pdf

Order - Pendulum Charts by Xeonix - shipping charges.pdf

Shipping - PrestaShop Free Shipping Settings.pdf

Share this post


Link to post
Share on other sites

PrestaShop™ 1.5.4.0 - It says this in the screenshot.

 

Sorry for the cheap shot, but I am extremely frustrated at the number of seemingly basic things in PrestaShop that don't work.

 

ALSO: It is NOT the template. When I switch back to the default template, I still have the same problem.

Edited by hostricity (see edit history)

Share this post


Link to post
Share on other sites

The shopping cart is displaying "Free Shipping" even though free shipping is disabled.

 

It calculates the shipping correctly when we get to shipping in the checkout. In fact, if a customer logs in, it immediately calculates the shipping and displays the lowest shipping cost.

 

"Free Shipping" is disabled in the back office.

 

How do we stop PrestaShop from displaying "Free Shipping" before the shipping has been calculated? The shipping field should be blank or say something - anything except "Free Shipping"

 

See two images.

 

 

 

 

Free Shipping! which appears in the cart block until the customer has added an address and shipping can be calculated. @ around line 598 in ajax-cart.js, change the script as below.

 

 

Change this:

 

if (parseFloat(jsonData.shippingCostFloat) > 0 || jsonData.nbTotalProducts < 1)

$('.ajax_cart_shipping_cost').text(jsonData.shippingCost);

else

if (typeof(freeShippingTranslation) != 'undefined')

$('.ajax_cart_shipping_cost').html(freeShippingTranslation);

 

 

To This:

if (parseFloat(jsonData.shippingCostFloat) == 0 && parseInt(jsonData.nbTotalProducts) >= 0)

$('.ajax_cart_shipping_cost').text(jsonData.shippingCost);

else

$('.ajax_cart_shipping_cost').text(jsonData.shippingCost);

 

Hello, what version of PrestaShop are you using?

 

 

Seem Familiar !!! LOL

Edited by tdr170 (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

Hi hostricity, no problem. I did overlook that. Try tdr170's solution, let us know if it works for you?

 

; Seem Familiar !!! LOL

 

I don't know what you mean Tod? I was just asking what version :blink:

Share this post


Link to post
Share on other sites

No, this did not fix it.

 

Even if it did, I'd be concerned about some other problem causing this which should concern me.

 

This isn't a known bug in Prestashop is it?

 

If the code has to be hacked, I can figure that out, but I want to understand what is going on that requires the code to be hacked - unless it is a known bug.

Edited by hostricity (see edit history)

Share this post


Link to post
Share on other sites

No, this did not fix it.

 

Even if it did, I'd be concerned about some other problem causing this which should concern me.

 

This isn't a known bug in Prestashop is it?

 

This does fix it as I can show in my site I applied this change and the Free shipping changed to $0.00.

If you applied this fix correctly and turned force compile on and cache off you should see the change.

If the cart still does not change use your FTP and clear all files form your smarty cache and compile folder with the exception of any index.php files you may find.

../cache/smarty/ cache & compile

I have a feeling that yours has not changed due to your browser loading a cahed page without the change.

Yes this is a known issue not not necessarily a bug.

I have used this for some time and there are no issues concerning this fix, and the ajax-cart lines are the cause.

 

 

 

Edited by tdr170 (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

This does fix it as I can show in my site I applied this change and the Free shipping changed to $0.00.

If you applied this fix correctly and turned force compile on and cache off you should see the change.

If the cart still does not change use your FTP and clear all files form your smarty cache and compile folder with the exception of any index.php files you may find.

../cache/smarty/ cache & compile

I have a feeling that yours has not changed due to your browser loading a cahed page without the change.

Yes this is a known issue not not necessarily a bug.

I have used this for some time and there are no issues concerning this fix, and the ajax-cart lines are the cause.

 

 

 

 

Thank you for your explicit response.

 

I'll look at it further and am sure I can get it working.

 

I do have caching off, etc., but...

 

OK. HERE'S The problem:

 

The ajax-cart.js file is over-ridden by another ajax-cart.js file in my theme. When I test with the default theme, it works correctly.

 

Patching the ajax-cart.js file in the theme now...

Edited by hostricity (see edit history)

Share this post


Link to post
Share on other sites

Just comment the line which shows the Shipping ;

 

File path: ~\themes\default\modules\blockcart\blockcart.tpl

 

  <p id="cart-prices">
 <!-- <span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">{$shipping_cost}</span>
  <span>{l s='Shipping' mod='blockcart'}</span>
  <br/>
  {if $show_wrapping}
   {assign var='cart_flag' value='Cart::ONLY_WRAPPING'|constant}
   <span id="cart_block_wrapping_cost" class="price cart_block_wrapping_cost">{if $priceDisplay == 1}{convertPrice price=$cart->getOrderTotal(false, $cart_flag)}{else}{convertPrice price=$cart->getOrderTotal(true, $cart_flag)}{/if}</span>
   <span>{l s='Wrapping' mod='blockcart'}</span>
   <br/>
  {/if} !-->

 

Then your cart will be...

no_shipping.png

 

Thanks,

 

 

Hanafi.

Share this post


Link to post
Share on other sites

Just comment the line which shows the Shipping ;

 

File path: ~\themes\default\modules\blockcart\blockcart.tpl

 

  <p id="cart-prices">
 <!-- <span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">{$shipping_cost}</span>
  <span>{l s='Shipping' mod='blockcart'}</span>
  <br/>
  {if $show_wrapping}
{assign var='cart_flag' value='Cart::ONLY_WRAPPING'|constant}
<span id="cart_block_wrapping_cost" class="price cart_block_wrapping_cost">{if $priceDisplay == 1}{convertPrice price=$cart->getOrderTotal(false, $cart_flag)}{else}{convertPrice price=$cart->getOrderTotal(true, $cart_flag)}{/if}</span>
<span>{l s='Wrapping' mod='blockcart'}</span>
<br/>
  {/if} !-->

 

Then your cart will be...

no_shipping.png

 

Thanks,

 

 

Hanafi.

 

We don't want to remove the shipping all together just don't want it to say Free shipping.

The fix I posted above does this.

Share this post


Link to post
Share on other sites

OK just doing some testing and found that you can change both the header cart and the cart summery Free shipping right in the BO.

Just go to localization, translations there are two areas that need to be translated.

First go to Front office translations click on your flag, scroll down and find shopping-cart and add the Free shipping! translation to your choice and then click Update translations.

$0.00 what I used.

Now go to Installed modules translations, scroll down and find Module: Blockcart and change the Free shipping! translation to your choice.

$0.00 what I used.

This works and no need to edit and change any files.

Edited by tdr170 (see edit history)

Share this post


Link to post
Share on other sites

The shopping cart is displaying "Free Shipping" even though free shipping is disabled.

 

It calculates the shipping correctly when we get to shipping in the checkout. In fact, if a customer logs in, it immediately calculates the shipping and displays the lowest shipping cost.

 

"Free Shipping" is disabled in the back office.

 

How do we stop PrestaShop from displaying "Free Shipping" before the shipping has been calculated? The shipping field should be blank or say something - anything except "Free Shipping"

 

See two images.

 

go to Carriers and make sure that all checkboxes are checked for Group Access especially Guest, Default and Visitor.

 

this then works fine for PS 1.5.4.1

Share this post


Link to post
Share on other sites

Hello

 

Unfortunately I am encountering the same issue here.

I have put the fix in place in ajax-cart.js but no luck. (I have forced compile)

I can't do the translations thing as I am over the limit and my host won't up the limit for security reasons.

 

I am just thinking of something. As you can see on my screenshots I have these two carrier appearing.

What about removing the "free" carrier in my db. Would that create a mess?

 

Thanks for your time

 

Guillaume

 

 

post-470973-0-48371000-1381915382_thumb.jpg

post-470973-0-54649300-1381915383_thumb.jpg

post-470973-0-65024500-1381915384_thumb.jpg

Share this post


Link to post
Share on other sites
Posted (edited)

This is the solution for PS 1.7 in relation to showing "Free"  when the shipping is not even yet calculated, that is,  we still don't know if we are gonna be able to offer free shipping (rules are not yet applied). So the solution was to check if there are any items in the cart. If there aren't, that means that shipping hasn't been calculated at all, so we can just show $0.00. (Notice the static dollar sign, not great but at least it works for single currency shops, just put the correct sign. Multi-currency carts should find a fix to dynamically change the sign, maybe adding variable in CartPresenter.php).

Edit this file:

themes/<your_theme>/templates/checkout/_partials/cart-detailed-totals.tpl

Replace:

<span class="value">{$subtotal.value}</span>

With:

{if $subtotal.type === 'shipping' && $cart.products_count==0}
  <span class="value">$0.00</span>
{else}
  <span class="value">{$subtotal.value}</span>
{/if}

 

Edited by mysticav (see edit history)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More