0

Right when we click the cart icon we are taken to cart page where all product or products added to cart are shown.

On this page I want to add some custom text and icons below the cart summary by removing Estimated Shipping Tax and placing my text instead of Estimated Shipping Tax.

Please just tell where I can add these changes ?

1

3 Answers 3

0

In Magento CE 1.9.2.1 the Estimated Shipping Tax is loaded in the following template file.

[your magento install dir]/app/design/frontend/YOURPACKAGE/YOURTHEME/template/checkout/cart.phtml

If your theme does not contain this file then you can copy it from the /base/default/ theme and add it to your own theme.

Open this file and look for the following line of code

<?php if (!$this->getIsVirtual()): echo $this->getChildHtml('shipping'); endif; ?>

replace this line with the following lines of code

<!-- <?php if (!$this->getIsVirtual()): echo $this->getChildHtml('shipping'); endif; ?> -->
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?>

The first line comments the Estimated Shipping Tax preventing it from rendering. So it will no longer be displayed. The second line will insert a CMS Static block to the cart page with identifier block_identifier, but only if this static block is active.

In your Magento Admin Panel go to CMS > Static Block and click on the Add New Block button.

  1. Fill in your new block title
  2. Fill in your new block identifier (this is important and should match the identifier that you have used in the cart.phtml file)
  3. Choose the proper store view(s)
  4. Enable the block
  5. Add the code for the custom text and icons that you want to display
  6. Save the block

Now refresh all cache and go to your cart page. The Estimated Shipping Tax block should be replaced by your new text and icons.

1
  • That's great.You Rock. :)
    – Fufu Tulla
    Aug 22, 2015 at 9:48
0

Magento has something called template path hints. Template path hints are little tags which would lie on top of your shop frontend. These little tags enable you to view where exactly the code of a specific element is stored within your file structure.

To activate template path hints:

  1. Log into the magento back-end admin
  2. Go to System -> Configuration in the main menu
  3. Go to Developer on the bottom left under ADVANCED
  4. Switch to the store view on the top left to your current website or store view.
  5. Under the Debug tab of the same Developer config page you will see a new option appear that will allow you to turn on/off template path hints.

Source

1
  • I find it bit sarcastic :) but let me check
    – Fufu Tulla
    Aug 21, 2015 at 10:55
0

To remove Estimated Shipping
In File

app/design/frontend/[YOUR THEME]/[YOUR PACKAGE]/template/checkout/cart.phtml

Comment out below code

<?php //if (!$this->getIsVirtual()): echo $this->getChildHtml('shipping');
        endif;
        ?>

or In file

app/design/frontend/[YOUR THEME]/[YOUR PACKAGE]/layout/local.xml

add below code

<checkout_cart_index>
        <reference name="content">
            <remove name="checkout.cart.shipping" />
        </reference>
    </checkout_cart_index>

To Add custom cms static block at the same location as of shipping block

Create a CMS Static block and add below code in file app/design/frontend/[YOUR THEME]/[YOUR PACKAGE]/template/checkout/cart.phtml just before closing div class="cart-forms"

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('your_static_block_id')->toHtml(); ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.