Jump to content

[Solved] Cart - Blockcart.tpl - Hide Shipping And Show Total Price Without Shipping


lucia15

Recommended Posts

Hey there!

 

I've been reading docens of posts and I cannot find what I am looking for.

 

I want my cart not to show the shipping costs. 

 

I tried to comment these lines on blockcart.tpl:

 

<!--
<span class="price cart_block_shipping_cost ajax_cart_shipping_cost">
{if $shipping_cost_float == 0}
{l s='Free shipping!' mod='blockcart'}
{else}
{$shipping_cost}
{/if}
</span>
<span>
{l s='Shipping' mod='blockcart'}
</span> -->
 
It works. However, the total price INCLUDES the shipping cost. 
 
I tried changing this line:
 
<span class="price cart_block_total ajax_block_cart_total">{$total}</span>
 
to
 
<span class="price cart_block_total ajax_block_cart_total">{$product.total}</span>
 
but then I get the total without taxes.
 
What I want is showing: PRICE OF THE PRODUCT TAXES INCLUDED.
 
I have already defined in Prestashop backend to show products with taxes included but it seems that "product.total" means "without taxes".
 
Could you please help me??
 
I would like to do the same in the next step, in the shopping resume, but let's start from the beginning...
 
THANK YOU!
 

 

Edited by lucia15 (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

Hello musicmaster, 

 

I didn't try that but I will and I will let you know. 

 

However, my theme totally crashed after doing this change on blockcart.tlp. The store seemed to be working ok, but Apache was launching hundreds of errors per hour...

Link to comment
Share on other sites

  • 1 month later...

Hi,

 

this thread is a bit old but i managed to remove shipping cost in blockcart doing the following changes :

 

In blockcart.php :

 

Replace this : $totalToPay = $params['cart']->getOrderTotal($useTax);

With this       : $totalToPay = $params['cart']->getOrderTotal($useTax, Cart::BOTH_WITHOUT_SHIPPING);

 

And this one : $totalToPayWithoutTaxes = $params['cart']->getOrderTotal(false);

With this       : $totalToPayWithoutTaxes = $params['cart']->getOrderTotal(false, Cart::BOTH_WITHOUT_SHIPPING);

 

The last statement is right under the first one in the condition.

 

And in blockcart.tpl, comment out this block:

 

<div class="cart-prices-line first-line">
<span class="price cart_block_shipping_cost ajax_cart_shipping_cost{if !($page_name == 'order-opc') && $shipping_cost_float == 0 && (!isset($cart->id_address_delivery) || !$cart->id_address_delivery)} unvisible{/if}">
{if $shipping_cost_float == 0}
{if !($page_name == 'order-opc') && (!isset($cart->id_address_delivery) || !$cart->id_address_delivery)}{l s='To be determined' mod='blockcart'}{else}{l s='Free shipping!' mod='blockcart'}{/if}
{else}
{$shipping_cost}
{/if}
</span>
<span{if !($page_name == 'order-opc') && $shipping_cost_float == 0 && (!isset($cart->id_address_delivery) || !$cart->id_address_delivery)} class="unvisible"{/if}>
{l s='Shipping' mod='blockcart'}
</span>
</div>
 
That's all to get the shipping cost removed from display and taxes well calculated without shipping cost.
 
PS : Only tested with PS 1.6.0.14
  • Like 3
  • Thanks 1
Link to comment
Share on other sites

 

Hi,

 

this thread is a bit old but i managed to remove shipping cost in blockcart doing the following changes :

 

In blockcart.php :

 

Replace this : $totalToPay = $params['cart']->getOrderTotal($useTax);

With this       : $totalToPay = $params['cart']->getOrderTotal($useTax, Cart::BOTH_WITHOUT_SHIPPING);

 

And this one : $totalToPayWithoutTaxes = $params['cart']->getOrderTotal(false);

With this       : $totalToPayWithoutTaxes = $params['cart']->getOrderTotal(false, Cart::BOTH_WITHOUT_SHIPPING);

 

The last statement is right under the first one in the condition.

 

And in blockcart.tpl, comment out this block:

 

<div class="cart-prices-line first-line">
<span class="price cart_block_shipping_cost ajax_cart_shipping_cost{if !($page_name == 'order-opc') && $shipping_cost_float == 0 && (!isset($cart->id_address_delivery) || !$cart->id_address_delivery)} unvisible{/if}">
{if $shipping_cost_float == 0}
{if !($page_name == 'order-opc') && (!isset($cart->id_address_delivery) || !$cart->id_address_delivery)}{l s='To be determined' mod='blockcart'}{else}{l s='Free shipping!' mod='blockcart'}{/if}
{else}
{$shipping_cost}
{/if}
</span>
<span{if !($page_name == 'order-opc') && $shipping_cost_float == 0 && (!isset($cart->id_address_delivery) || !$cart->id_address_delivery)} class="unvisible"{/if}>
{l s='Shipping' mod='blockcart'}
</span>
</div>
 
That's all to get the shipping cost removed from display and taxes well calculated without shipping cost.
 
PS : Only tested with PS 1.6.0.14

 

 

It worked perfectly!!!! THANK YOU!!!

Link to comment
Share on other sites

  • 7 months later...
  • 6 months later...

 

Hi,

 

this thread is a bit old but i managed to remove shipping cost in blockcart doing the following changes :

 

In blockcart.php :

 

Replace this : $totalToPay = $params['cart']->getOrderTotal($useTax);

With this       : $totalToPay = $params['cart']->getOrderTotal($useTax, Cart::BOTH_WITHOUT_SHIPPING);

 

And this one : $totalToPayWithoutTaxes = $params['cart']->getOrderTotal(false);

With this       : $totalToPayWithoutTaxes = $params['cart']->getOrderTotal(false, Cart::BOTH_WITHOUT_SHIPPING);

 

The last statement is right under the first one in the condition.

 

And in blockcart.tpl, comment out this block:

 

<div class="cart-prices-line first-line">
<span class="price cart_block_shipping_cost ajax_cart_shipping_cost{if !($page_name == 'order-opc') && $shipping_cost_float == 0 && (!isset($cart->id_address_delivery) || !$cart->id_address_delivery)} unvisible{/if}">
{if $shipping_cost_float == 0}
{if !($page_name == 'order-opc') && (!isset($cart->id_address_delivery) || !$cart->id_address_delivery)}{l s='To be determined' mod='blockcart'}{else}{l s='Free shipping!' mod='blockcart'}{/if}
{else}
{$shipping_cost}
{/if}
</span>
<span{if !($page_name == 'order-opc') && $shipping_cost_float == 0 && (!isset($cart->id_address_delivery) || !$cart->id_address_delivery)} class="unvisible"{/if}>
{l s='Shipping' mod='blockcart'}
</span>
</div>
 
That's all to get the shipping cost removed from display and taxes well calculated without shipping cost.
 
PS : Only tested with PS 1.6.0.14

 

Hi, I have a problem in which exact place should I comment in blockcart.tpl I add it in the end and didn't work for me.

Link to comment
Share on other sites

  • 8 months later...
On 1/13/2016 at 3:56 AM, jav974 said:

Hi,

 

this thread is a bit old but i managed to remove shipping cost in blockcart doing the following changes :

 

In blockcart.php :

 

Replace this : $totalToPay = $params['cart']->getOrderTotal($useTax);

With this       : $totalToPay = $params['cart']->getOrderTotal($useTax, Cart::BOTH_WITHOUT_SHIPPING);

 

And this one : $totalToPayWithoutTaxes = $params['cart']->getOrderTotal(false);

With this       : $totalToPayWithoutTaxes = $params['cart']->getOrderTotal(false, Cart::BOTH_WITHOUT_SHIPPING);

 

The last statement is right under the first one in the condition.

 

And in blockcart.tpl, comment out this block:

 

<div class="cart-prices-line first-line">
<span class="price cart_block_shipping_cost ajax_cart_shipping_cost{if !($page_name == 'order-opc') && $shipping_cost_float == 0 && (!isset($cart->id_address_delivery) || !$cart->id_address_delivery)} unvisible{/if}">
{if $shipping_cost_float == 0}
{if !($page_name == 'order-opc') && (!isset($cart->id_address_delivery) || !$cart->id_address_delivery)}{l s='To be determined' mod='blockcart'}{else}{l s='Free shipping!' mod='blockcart'}{/if}
{else}
{$shipping_cost}
{/if}
</span>
<span{if !($page_name == 'order-opc') && $shipping_cost_float == 0 && (!isset($cart->id_address_delivery) || !$cart->id_address_delivery)} class="unvisible"{/if}>
{l s='Shipping' mod='blockcart'}
</span>
</div>
 
That's all to get the shipping cost removed from display and taxes well calculated without shipping cost.
 
PS : Only tested with PS 1.6.0.14

 

 

This worked for me! I'm using PS 1.6.1.11

 

Thank you!

Link to comment
Share on other sites

  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...