How to add css only for checkout page of rwd theme in Magento 1.9.0
-
13-12-2020 - |
سؤال
I need to add a custom css in checkout.xml
file like this
<checkout_cart_index translate="label">
<reference name="head">
<action method="addCss">
<stylesheet>css/new.css</stylesheet>
</action>
</reference>
</checkout_cart_index>
and its not working. I have changed my theme like this
I have created local.xml file at \app\design\frontend\rwd\default\layout\local.xml
I am thinking that local.xml file is not loading.
المحلول
You can add this xml code in your local.xml it will add css only for cart page
create a local.xml file in
app/design/frontend/theme/default/layout/local.xml
Paste below code in local.xml
<?xml version="1.0"?>
<layout version="0.1.0">
<checkout_cart_index> translate="label">
<reference name="head">
<action method="addCss">
<stylesheet>css/new.css</stylesheet>
</action>
</reference>
</checkout_cart_index>
</layout>
OR
<?xml version="1.0"?>
<layout version="0.1.0">
<checkout_cart_index> translate="label">
<reference name="head">
<action method="addItem">
<type>skin_css</type>
<name>css/new.css</name>
</action>
</reference>
</checkout_cart_index>
</layout>
نصائح أخرى
You are using the wrong handler
<checkout_cart_index>
Will add css to cart page not in check out page
replace with
<checkout_onepage_index>
this will add content to checkout page
لا تنتمي إلى magento.stackexchange