2

I need to add css file to shopping cart page. But it should only added to the that page. Is it possible to do this?

2 Answers 2

2

you can add this xml code in your local.xml it will add css only for cart page

<checkout_cart_index translate="label">

           <reference name="head">

                <action method="addCss">
                    <stylesheet>css/style.css</stylesheet>
                </action>
            </reference>
        </checkout_cart_index>
0
0

Magento is create a unique handler whenever the cart page is rendered.For cart page,the handler is checkout_cart_index. and the this handler a use of Mage_Page_Block_Html_Head class's addCss() function you can add css file.

How to use this at layout files ,you can try Qaisar Satti Answer

In each page,magento is create a handler which value is same as front Controller Full Action Name ( Mage::app()->getFrontController()->getAction()->getFullActionName()).

Format:

<'Handler_Name' translate="label">
<reference name="head">
<action method="addCss">
    <stylesheet>css/style.css</stylesheet>
</action>
</reference>
</'Handler_Name'>

Your Answer

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

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