Showing posts with label cms. Show all posts
Showing posts with label cms. Show all posts

Thursday, October 6, 2011

Tips to use home page url, custom page url and pass query string in Magento CMS Page

{{store url=""}} -> Used to get Store's home page URL.
Resulting in a URL like "http://yourstore.com/"

{{store url="contacts"}} -> Used to get contact us page URL.
Resulting in a URL like "http://yourstore.com/contacts/"

If you want to show custom URL Use direct_url
{{store direct_url="category/subcategory.html"}} -> Used to get custom URL.
Resulting in a URL like "http://yourstore.com/category/subcategory.html"

If you want to pass parameters in query string use _query
{{store direct_url="category/subcategory.html" _query="a=param_a&b=param_b"}} -> Used to Pass query string
Resulting in a URL like "http://yourstore.com/category/subcategory.html?a=param_a&b=param_b"

{{skin url='images/homepageimage.jpg'}} -> Used to get image url

Wednesday, October 5, 2011

How to remove a block from just one page cart, cms or product page?

For page specific layout updates, either you can use backend layout updates sections(category, product, cms pages) or the following code in the "app/etc/local.xml"

    

for instance, use this code to remove the sidebar cart from the product view page.

     

Tuesday, September 20, 2011

Add a custom "add to cart" button on Magento CMS pages

Sometimes you'll want to show your products or introduce it on a CMS page for some reason. If you want to do that it's actually not so complicated, in your cms page editor, just add the following HTML code where you want it to appear in the page.
<button onclick="location.href ='{{config path="web/unsecure/base_url"}}/checkout/cart/add?product=1&qty=1′">Buy It Now</button> 
Save the page and refresh the cache. Now if you open the page in you should be able to see "Buy It Now" button. When clicked it adds 1 product with ID=1 to your shopping cart.
To make it a little more advanced, you can add the quantity of products you want to let the customers add, in that case use this code (example for five products).
<button onclick="location.href ='{{config path="web/unsecure/base_url"}}/checkout/cart/add?product=1&qty=5'">Buy 4 Get 1 Free</button> 

Tuesday, September 13, 2011

How to Add CMS page link to top links or footer links in Magento?

Use "<prepare>true</prepare>" to get correct url path.
customer-serviceCustomer Servicetrue1000