CAT | design
17
How to add category description under category
2 Comments · Posted by admin in design, magento
Here is the example:
You can see the example of this menu at http://www.cortevents.com, under furniture catalog. On a left hand side each category item has small text that is being pulled from category description field.
STEP1:
/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Tree.php
I’ve inserted following code on the line 234 (_getDefaultCollection function, after addAttributeToSelect(‘name’))
1 | ->addAttributeToSelect('description') |
15
Creating Magento Landing Pages – Video Guide
No comments · Posted by leo in administration, design, development, magento, video
Landing Page is the most important part of your website – it is the page your prospective customers see first, and having it designed well is essential. This video guide will show you exactly how to do that.
5
How to determine Store ID for multi-type Magento site
2 Comments · Posted by leo in design, development, magento, module
Here is a quick reference for you, if you run Magento under Multi-language, Multi-Currency or Multi-Domain (Multi-Website).
Sometime you need pick up the Store ID do some (IF…ELSE…) work. Here is the code:
1 | <?php $store_id = $this->helper('core')->getStoreId(); echo $store_id; ?> |
17
Remove Estimate Shipping and Tax box from Magento checkout
No comments · Posted by leo in design, development, magento
Open the file /app/design/frontend/default/default/layout/checkout.xml
Remember if you are using a different theme the path to that file will be slightly different.
Remove this line:
1 | <block type=”checkout/cart_shipping” name=”checkout.cart.shipping” as=”shipping” template=”checkout/cart/shipping.phtml”/> |
9
How to do a Best Seller Blocks
No comments · Posted by leo in cms, design, development, magento
Here are codes which you can put on the block to show your best seller products.
Bestseller.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <?php //bestseller module - grabs from all products, returns in order of total quantity ordered class Mage_Catalog_Block_Product_Bestseller extends Mage_Catalog_Block_Product_Abstract { public function __construct() { parent::__construct(); $storeId = Mage::app()->getStore()->getId(); $products = Mage::getResourceModel(’reports/product_collection’) ->addOrderedQty() ->addAttributeToSelect(array(’name’, ‘price’, ’small_image’, ’short_description’, ‘description’, ‘author’)) ->setStoreId($storeId) ->addStoreFilter($storeId) ->setOrder(’ordered_qty’, ‘desc’); Mage::getSingleton(’catalog/product_status’)->addVisibleFilterToCollection($products); Mage::getSingleton(’catalog/product_visibility’)->addVisibleInCatalogFilterToCollection($products); //$products->setPageSize(6)->setCurPage(1); $this->setProductCollection($products); } } ?> |
These blocks do not represent all there is to making use of them. These should all work with “List.phtml” in the Catalog module design files, but you might want to create your own template.
The easiest way to implement these and make them usable is to add them to a Mage folder within the Local code folder (rather than core):
app/code/local/Mage/Catalog/Block/Product/Bestseller.php
This lets you skip the step of creating a custom module in order to use a simple block who’s only purpose is to list a category of products (or bestsellers in this case).
Codes from http://www.exploremagento.com
9
How to move/remover Callouts on the left/right columns
1 Comment · Posted by leo in administration, cms, design, development, magento, module
From the default MAGENTO template, you always can see the call out images on the left/right side.
We can easily turn on Template Path hints in the admin section:
1.Admin > System > Configuration
2.Switch your “Current Configuration Scope” to your store
3.Click on the Developer Tab (bottom left) and find the Debug area
4.Template Path Hints: Yes
5.Then refresh your debugging page, you will see all the paths on the screen
(more…)
5
How to change column layout of search results page
No comments · Posted by leo in cms, design, development, magento
You need to edit the following file:
/app/design/your_interface/your_theme/layout/catalogsearch.xml
Search for setTemplate. It’s located in 4 places in the page. (catalogsearch_result_index, catalogsearch_advanced_index, catalogsearch_advanced_result and catalogsearch_term_popular)
For example:
1 | <action method="setTemplate"><template>page/2columns-left.phtml</template></action> |
Update the name of the template you wish to use in between the tags
After update:
1 | <action method="setTemplate"><template>page/newtemplate.phtml</template></action> |
All Done!
3
How to add or remove Javascript / CSS on Magento
5 Comments · Posted by leo in administration, cms, design, development, magento
Adding and removing javascript / css when and where you need it
Adding and removing Javascript and CSS is handled separately within Magento.
CSS is added in the usual like . But any included javascript (unless linked to “by hand” from a theme’s skin) is pulled via a php files which reads through the “js” folder in the root directory (root/js/index.php is responsible for this).
That is all well and good for Magento. The real question is how we, as developers, add these items when we need them.
In this post, we will show how to add and remove Javascript and CSS to a CMS page (and anywhere else) that you may need.
(more…)
CSS · design · JAVASCRIPT · magento
31
How to use different header on same layout
4 Comments · Posted by leo in administration, cms, design, development, magento
Here it goes.
1. Step One
/app/design/frontend/default/default/template/page/html
copy header.phtml to something like header2.html
2. Step Two
/app/design/frontend/default/default/layout
edit page.xml
you can just copy existing Block and change type and name only.
1 2 3 4 5 | <block type="page/html_header2" name="header2" as="header2"> <block type="page/template_links" name="top.links" as="topLinks"/> <block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/> <block type="core/text_list" name="top.menu" as="topMenu"/> </block> |
No tags
28
How to Edit MAGENTO Contact Form
No comments · Posted by leo in administration, cms, design, development, magento
Magento already had a built-in contact form that can be used for general contacts.
But we can not find this form on the ADMIN => CMS section. So if we want to edit text in that default contact form, we will need to edit back-end file.
If you are a developer, editing your contact form HTML is a piece cake, the path for the file is:
app/design/frontend/default/[yourtheme]/template/contacts/form.phtml
But, if there are cases when you would like to let your client/customer to edit some intro text, phone numbers, edit text behind the form.
(more…)
development · form · magento
