Jump to content

how can i remove "shipping " from the cart ?


Recommended Posts

hello,
i found this line :

" 'shipping_cost' => Tools::displayPrice($params['cart']->getOrderTotal(true, 5), $currency), " and i edited is like "

* 'shipping_cost' => Tools::displayPrice($params['cart']->getOrderTotal(true, 5), $currency),* "

but it doesnt work ?

Link to comment
Share on other sites

Well, I assume you don't charge shipping, thus make shipping cost..in backoffice>shipping tab ..free shipping starts at $0 or such.

but if you also don't want to show it in the cart like in your screenshot, do this:
/*

‘shipping_cost’ => Tools::displayPrice($params[‘cart’]->getOrderTotal(true, 5), $currency),

*/

but you may have to amend your invoice , if you do not want to show "shipping:$0" to customers.

Hope it helps.

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

I would like to remove the display of shipping costs as well. I want to show the total without shipping and tell the customer to continue the checkout process to see the real shipping cost. The reason is that I have several shipping carriers for different weight ranges. THe block cart only shows the carrier set as default carrier. When this is not in the weight range, it will display shipping cost = 0 (which is not correct).

Of course the best solution would be to get the block cart to find the correct carrier. However, I guess that will be a great deal of work to fix.

//PJ

Link to comment
Share on other sites

I found a way of removing the shipping cost from the block cart. You have to remove the shipping cost and replace the total with product total. The code should be like this:

Blockcart.php:

        $smarty->assign(array(
           'products'=> $products,
           'customizedDatas' => Product::getAllCustomizedDatas(intval($params['cart']->id)),
           'CUSTOMIZE_FILE' => _CUSTOMIZE_FILE_,
           'CUSTOMIZE_TEXTFIELD' => _CUSTOMIZE_TEXTFIELD_,
           'discounts' => $params['cart']->getDiscounts(false, true),
           'nb_total_products' =>$params['cart']->nbProducts(),
           'show_wrapping' => floatval($params['cart']->getOrderTotal(true, 6)) > 0 ? true : false,
           'wrapping_cost' => Tools::displayPrice($params['cart']->getOrderTotal(intval(Configuration::get('PS_PRICE_DISPLAY')) == 1 ? false : true, 6), $currency),
           'total' => Tools::displayPrice($params['cart']->getOrderTotal(intval(Configuration::get('PS_PRICE_DISPLAY')) == 1 ? false : true, 4), $currency),
           'id_carrier' => $params['cart']->id_carrier,
           'ajax_allowed' => intval(Configuration::get('PS_BLOCK_CART_AJAX')) == 1 ? true : false



to remove the text you will have to remove the following code in blockcart.tpl:

{l s='Shipping' mod='blockcart'}



You still have to deal with the shipping cost in the shoppingcart though... I'm thinking of using a great module written by Aaron @ Geocachestore: http://www.prestashop.com/forums/viewthread/22423/modules___code_contributions/module_display_shipping_feescarriers_prior_to_checkout__ajax

//PJ

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 7 months later...
  • 2 months later...
  • 1 year later...

This is how I removed all the informations about shipping:

 

1. Go to "blockcart.tpl" and comment out these lines:

<span>{l s='Shipping' mod='blockcart'}</span>
<span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">{$shipping_cost}</span>
<br/>

 

2. In the same file, find this line:

<span id="cart_block_total" class="price ajax_block_cart_total">{$total}</span>

and replace {$total} with {$product_total}:

<span id="cart_block_total" class="price ajax_block_cart_total">{$product_total}</span>

 

3. probably the "AJAX mode" is on so you "must" edit also the "ajax-cart.js" file which exists in "blockcart" folder in "modules" folder. Open it and go to line 560. Replace:

$('.ajax_block_cart_total').text(jsonData.total);

with this

$('.ajax_block_cart_total').text(jsonData.productTotal);

 

This worked for me. I guess it should work for you too.

  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

This is how I removed all the informations about shipping:

 

1. Go to "blockcart.tpl" and comment out these lines:

<span>{l s='Shipping' mod='blockcart'}</span>
<span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">{$shipping_cost}</span>
<br/>

 

2. In the same file, find this line:

<span id="cart_block_total" class="price ajax_block_cart_total">{$total}</span>

and replace {$total} with {$product_total}:

<span id="cart_block_total" class="price ajax_block_cart_total">{$product_total}</span>

 

3. probably the "AJAX mode" is on so you "must" edit also the "ajax-cart.js" file which exists in "blockcart" folder in "modules" folder. Open it and go to line 560. Replace:

$('.ajax_block_cart_total').text(jsonData.total);

with this

$('.ajax_block_cart_total').text(jsonData.productTotal);

 

This worked for me. I guess it should work for you too.

 

 

Hi, What is the version your are looking at? Seems like I can't find the word inside the TPL file. Please help..

Link to comment
Share on other sites

Ok, I found it!

I had to delete the line

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

in the "ajax-cart.js" file.

 

I do not recommend you to delete any code in prestashop ever. Because you never know when you will need that code in the future. Commenting out the code you don't need is always the best option. Deleting codes may cause problems.

Link to comment
Share on other sites

 

 

Hi, What is the version your are looking at? Seems like I can't find the word inside the TPL file. Please help..

 

My version is 1.4.2.5. Oh, I'm sorry I forgot to mention that my theme was prestashop alternative theme. You should go to your "theme" folder first and find your theme that you are currently using. Go to "themes->your theme-> modules -> blockcart" folder and search for those lines I mentioned before in blockcart.tpl file.

 

The class names or id attributes may be different depending on your theme. If you still can't find them, go to "prestashop root folder ->modules->blockcart" folder.

Link to comment
Share on other sites

  • 3 months later...

This is how I removed all the informations about shipping:

 

1. Go to "blockcart.tpl" and comment out these lines:

<span>{l s='Shipping' mod='blockcart'}</span>
<span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">{$shipping_cost}</span>
<br/>

 

2. In the same file, find this line:

<span id="cart_block_total" class="price ajax_block_cart_total">{$total}</span>

and replace {$total} with {$product_total}:

<span id="cart_block_total" class="price ajax_block_cart_total">{$product_total}</span>

 

3. probably the "AJAX mode" is on so you "must" edit also the "ajax-cart.js" file which exists in "blockcart" folder in "modules" folder. Open it and go to line 560. Replace:

$('.ajax_block_cart_total').text(jsonData.total);

with this

$('.ajax_block_cart_total').text(jsonData.productTotal);

 

This worked for me. I guess it should work for you too.

 

Great post alprmtlu. This worked for me on 1.4.6.2, to remove the additional table row I commented out as follows:

<!--  
   <div class="cart-prices-block">
   <span>{l s='Shipping' mod='blockcart'}</span>
   <span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">{$shipping_cost}</span>
  </div>
-->

  • Like 1
Link to comment
Share on other sites

 

Great post alprmtlu. This worked for me on 1.4.6.2, to remove the additional table row I commented out as follows:

<!--  
<div class="cart-prices-block">
<span>{l s='Shipping' mod='blockcart'}</span>
<span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">{$shipping_cost}</span>
  </div>
-->

 

I'm glad I could help :)

Link to comment
Share on other sites

  • 2 weeks later...

Hi. The solution works - kinda. Needs one more rectification :)

 

If you are in collapsed mode, than at each refresh, for a split second your cart will display the total of products + shipping, as first this is handled by PHP. Than when the JS kicks in, will rectificatem and update the contents of span with class "ajax_cart_total" with the normal price, without shipping. This looks pretty bad, specially on slow load and brosers, as everytime user is faced with 2 prices. We need to do this:

 

Open blockcart.tpl fromt he module directory and find:

<span class="ajax_cart_total" {if $cart_qties <= 0}style="display:none"{/if}>{if $priceDisplay == 1}{convertPrice price=$cart->getOrderTotal(false)}{else}{convertPrice price=$cart->getOrderTotal(true)}{/if}</span>

 

Replace with:

<span class="ajax_cart_total" {if $cart_qties <= 0}style="display:none"{/if}>{$product_total}</span>

 

This presumes, that you don't want to include wrapping price either.

 

Of course, on checkout page the shipping is there as it should, as this affects the collapsed cart box only :)

  • Like 1
Link to comment
Share on other sites

  • 7 months later...

This is how I removed all the informations about shipping:

 

1. Go to "blockcart.tpl" and comment out these lines:

<span>{l s='Shipping' mod='blockcart'}</span>
<span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">{$shipping_cost}</span>
<br/>

 

2. In the same file, find this line:

<span id="cart_block_total" class="price ajax_block_cart_total">{$total}</span>

and replace {$total} with {$product_total}:

<span id="cart_block_total" class="price ajax_block_cart_total">{$product_total}</span>

 

3. probably the "AJAX mode" is on so you "must" edit also the "ajax-cart.js" file which exists in "blockcart" folder in "modules" folder. Open it and go to line 560. Replace:

$('.ajax_block_cart_total').text(jsonData.total);

with this

$('.ajax_block_cart_total').text(jsonData.productTotal);

 

This worked for me. I guess it should work for you too.

 

hi! thank you for your information. i am a newbie in these prestashop things :) i want to erase the shipping from the cart and erasing the shipping step in the checkout process. i've already do all u've write above, but the shipping word is still there :( nothing change. i'm using the latest prestashop version 1.4.9.0 :) please help me, i spend 2 days to remove the shipping things haha, thanks! :)

Link to comment
Share on other sites

  • 5 months later...

This is how I removed all the informations about shipping:

 

1. Go to "blockcart.tpl" and comment out these lines:

<span>{l s='Shipping' mod='blockcart'}</span>
<span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">{$shipping_cost}</span>
<br/>

 

2. In the same file, find this line:

<span id="cart_block_total" class="price ajax_block_cart_total">{$total}</span>

and replace {$total} with {$product_total}:

<span id="cart_block_total" class="price ajax_block_cart_total">{$product_total}</span>

 

3. probably the "AJAX mode" is on so you "must" edit also the "ajax-cart.js" file which exists in "blockcart" folder in "modules" folder. Open it and go to line 560. Replace:

$('.ajax_block_cart_total').text(jsonData.total);

with this

$('.ajax_block_cart_total').text(jsonData.productTotal);

 

This worked for me. I guess it should work for you too.

 

Ive done everything that was explained here too but I still have the shipping cost showing in the total? How do I remove the shipping cost from the total? Im using 1.5.2

 

Aaaah I realised what it is, I didnt see the underscore in product_total :)

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

  • 11 months later...
  • 1 month later...

for presta 1.5.5.. 
 

 

Thankyou very much !!.. 

 

i'm using presta 1.5.5 and it's works like a charm !.. 

it's only for cart at the right page.. not cart summary

after several times i'm trying.. finally.. 

 

FYI, 

 

1st. open blockcart.tpl at your /modules/blockcart and also your /themes/nameofthemes/modules/blockcart and edit this line, make it inactive with comment tag or delete

 

<div class="cart-prices-block">
<span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">{$shipping_cost}</span>
<span>{l s='Shipping' mod='blockcart'}</span>
</div>

 

 

2nd. find this line in the same files, 

 

<span id="cart_block_total" class="price ajax_block_cart_total">{$total}</span>

and edit to

<span id="cart_block_total" class="price ajax_block_cart_total">{$product_total}</span>

 

 

3rd.  find this line

 

<span class="ajax_cart_total" {if $cart_qties == 0}style="display:none"{/if}>
{if $cart_qties > 0}
{if $priceDisplay == 1}
{convertPrice price=$cart->getOrderTotal(false)}
    {else}
{convertPrice price=$cart->getOrderTotal(true)}
{/if}
{/if}
</span>

 

 and change to

 

<span class="ajax_cart_total" {if $cart_qties == 0}style="display:none"{/if}>
            {$product_total}
</span>
 

 

 

4th. edit ajax-cart.js in /modules/blockcart and find this line

 

$('.ajax_block_cart_total').text(jsonData.total);

 

change to

 

$('.ajax_block_cart_total').text(jsonData.productTotal);

 

 

and incording to Arieswie and bbboos, open blockcart.php replace this

 

'total' => Tools::displayPrice($totalToPay, $currency),

 

to

 

'total' => Tools::displayPrice($params['cart']->getOrderTotal($useTax, Cart::BOTH_WITHOUT_SHIPPING), $currency),

 

 

and voila.. try to reload the page or clear smartycache and cart module doesn't include shipping anymore..    :)

 
  • Like 1
Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...
  • 8 months later...
  • 1 year 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...