Posts

Showing posts from April, 2014

To add multiple store:

To add multiple store: create one root category name it as "magento2" and add subcategory into it. now go to system  manage stores create a new website example "magento" and add store name and store view name to the website create a sub-directory folder magento2. Copy the index.php file as well as the htaccess file from the magento folder over to the magento2 folder Open your index.php file and look for the following line "$mageFilename = ‘app/Mage.php’;" Change it to $mageFilename = ‘../app/Mage.php’; and in the last you will get this line,comment it //Mage::run($mageRunCode, $mageRunType); Mage::run("magento2", $mageRunType); //magento 2 is the name of the store make sure the name of $mageRunCode (here we using magento2) will be same as  the Code in store view (Code * :  "magento2" )

To call search bar in cms page

{{block type="core/template" name="top.search" as="topSearch" template="catalogsearch/form.mini.phtml"}}

top search,WELCOME message,contact form

<?php echo $this->getChildHtml('topSearch') ?> <?php echo $this->getWelcome()?> ( system->design->header. ) change message from backend.   {{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form.phtml"}}

My Account My Wishlist My Cart Checkout Log In

<?php echo $this->getChildHtml('topLinks') ?>

HOME PAGE HYPERLINK CODING

<a class="level-top" href="<?php echo $this->getUrl('')?>"><?php echo $this->__('Home') ?></a> <a href="{{store url=""}}about-magento-demo-store">About Us</a> <li><a href="{{store url='catalog/seo_sitemap/category/'}}">Site Map</a></li> <li><a href="{{store url='catalogsearch/term/popular/'}}">Search Terms</a></li> <li><a href="{{store url='catalogsearch/advanced/'}}">Advanced Search</a></li> <li><a href="{{store url='sales/guest/form/'}}">Orders and Returns</a></li> <li><a href="{{store url='customer/account/login/'}}">Sign In</a></li> <li><a href="{{store url='checkout/cart/'}}">View Cart</a></li> ...

LINKING OF STYLESHEET

<link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('carousel/css/bcarousel.css')?>" /> <script type="text/javascript" src="<?php echo $this->getSkinUrl('carousel/js/jquery.easing.1.3.js')?>"></script> <script type="text/javascript" src="<?php echo $this->getSkinUrl('carousel/js/bcarousel.js')?>"></script>

To call images

in file coding---: <img src=" <?php echo $this->getSkinUrl('images/anilee_logo.jpg');?> " alt="" /> in dashboard coding----: <img src="{{skin url='images/media/banners-22.png'}}" alt="" />

Show new products on home page

{{block type="catalog/product_new" column_count="6" products_count="3" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}} also add set date of the product . In manage products.

Show products on home page of particular category

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="3" template="catalog/product/list.phtml"}}

To delete order in magento

Create  a delete-order.php file in root folder and place this code <? require 'app/Mage.php'; Mage::app('admin')->setUseSessionInUrl(false);                                                                                                                 //replace your own orders numbers here: $test_order_ids=array(     '100000001',     '100000075',     '100000076',  ...

Magmi

Image
"value replacer"  magmi. http://magento.stackexchange.com/questions/8893/how-do-i-use-magmi-column-mapper-for-attributes-with-the-same-value As for value replacer, here is how it's done: Replaced attributes: small_image,thumbnail small_image: {{ '{item.small_image}' == '' ? '{item.image}' : '{item.small_image}'}} thumbnail: {{ '{item.thumbnail}' == '' ? '{item.image}' : '{item.thumbnail}'}} This will make small_image and thumbnail similar to "image" field unless explicitly assigned. to delete the product using magmi http://stackoverflow.com/questions/19333400/magmi-import-doesnt-remove-the-products http://sourceforge.net/apps/mediawiki/magmi/index.php?title=Product_Deleter how to import external url images using magmi http://sourceforge.net/apps/mediawiki/magmi/index.php?title=Image_attributes_processor#Remote_image_support csv format: sku;store;attribute_set;type;categories;root_category;pr...

Reindexing

reindexing solution fixed using this extension(mainly getting problem with the catalog url rewrittes issue http://www.dnd.fr/2012/09/magento-patch-how-to-optimize-re-index-processing-time-for-url-rewrite/ http://inchoo.net/ecommerce/magento/executing-magento-indexer-from-shell/ using shell for reindexing ghrix@ghrix-pc11:~$ ssh alloutsh@alloutshopping.com alloutsh@alloutshopping.com's password: Last login: Tue Apr  1 23:57:50 2014 from 125.62.111.125 alloutsh@alloutshopping.com [~]# cd public_html/au/shell alloutsh@alloutshopping.com [~/public_html/au/shell]# php-cli -f indexer.php reindexall Product Attributes index was rebuilt successfully Product Prices index was rebuilt successfully Catalog URL Rewrites index was rebuilt successfully Category Products index was rebuilt successfully Catalog Search Index index was rebuilt successfully Stock Status index was rebuilt successfully Tag Aggregation Data index was rebuilt successfully Configurable Product Attributes index was rebuilt ...

how to hide the content of anchor

.footer a[title="Advanced Search"] {display:none;} .footer a[title="Site Map"] {display:none;}

Sort By Count Magento Layered Navigation -

find this line  in Mage/Catalog/Model/Layer/Filter/Abstract.php. and replace it public function getItems() {     if (is_null($this->_items)) {         $this->_initItems();                 return $items;     }     <--replace--> public function getItems() {     if (is_null($this->_items)) {         $this->_initItems();     }     //5-16-11 Custom sort     $items = $this->_items;     usort($items, array("Mage_Catalog_Model_Layer_Filter_Abstract", "sortByCount"));      return $items; } public static function sortByCount($a, $b) {     if ($a->getCount() == $b->getCount()) {         return 0;     }     retur...

to remove category section from layerd navigation

This is what I did to remove the “Category” section from my layered navigation so I wouldnt have any repeat information with the attributes I wanted in the layered navigation. go to app/design/frontend/default/default/template/catalog/layer and open up view.phtml for edit. This is the code I have within the “dl” tags: <dl id="narrow-by-list"> <?php $_filters = $this->getFilters() ?> <?php foreach ($_filters as $_filter): ?>  <?php if($_filter->getItemsCount()): ?> <?php if($_filter->getName() != "Category"){ ?> <dt><?php echo $this->__($_filter->getName()) ?></dt> <dd> <?php echo $_filter->getHtml() ?> </dd> <?php } endif; ?> <?php endforeach; ?> </dl>

To Determine if on product page or in category page

echo $this->getRequest()->getControllerName();

how to make stock availability in stock as default magento

In app/design/adminhtml/default/default/template/catalog/product/tab/inventory.phtml I have changed this: <?php foreach ($this->getStockOption() as $option): ?>         <?php $_selected = ($option['value'] == $this->getFieldValue('is_in_stock')) ? 'selected="selected"' : '' ?>         <option value="<?php echo $option['value'] ?>" <?php echo $_selected ?>><?php echo $option['label'] ?></option> <?php endforeach; ?> To this: <?php if( ($this->getFieldValue('qty')*1) > 0): ?>         <option selected="selected" value="1">In Stock</option> <?php else: ?>     <option selected="selected" value="0">Out of Stock</option> <?php endif; ?>

to update sku and price only

http://www.blog.magepsycho.com/updating-product-prices-in-magento-in-easier-faster-way/

to add customer group in registration form

make a copy of config.xml from app > code > core > Mage > Customer > etc > config.xml and add the following line of code into the customer account fieldset and save it to app > code >local>config.xml and in this file add the following line of code into the customer account fieldset: <fieldsets> <customer_account> ............ <group_id><create>1</create><update>1</update></group_id> ........... </customer_account> </fieldsets> add code to the frontend of the store, in the registration form. Open template/customer/form/register.phtml and add the following code somewhere in the form: <div class="input-box"> <label for="group_id"><?php echo $this->__('Group') ?><span class="required">*</span></label><br/> <select name="group_id" id="group_id" title="<?php echo $this->__('Group') ...

To add custom page

{{block type="core/template" name="a-name" template="page/addproduct.phtml"}}

how-to-remove-magento-footer-links-orders-and-returns

http://opensourcecmsinfo.com/how-to-remove-magento-footer-links-orders-and-returns/

to add a discount in Multishipping address checkout pag

place this In your layout/checkout.xml <block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/> before the <block type="checkout/multishipping_addresses" name="checkout_addresses" template="checkout/multishipping/addresses.phtml"> and <?php echo $this->getChildHtml('coupon') ?> in checkout/multishipping/addresses.phtml

to add a discount in checkout page

If you are using the one page checkout, you can add the coupon code template by defining it in your checkout.xml layout definition and then including it in the onepage.phtml template inside of template/checkout/onepage.phtml: <?php echo $this->getChildHtml('coupon') ?> In your layout/checkout.xml, locate the <checkout_onepage_index> definition and add the following line inside the <block type="checkout/onepage"...> tag: ... <block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/>

Increase Decrease qty button for product detail page in magento

http://www.magentocommerce.com/magento-connect/quantity-switcher-2061.html

Magento Module Creator

http://www.silksoftware.com/magento-module-creator http://www.magentocommerce.com/magento-connect/ultimate-modulecreator-8949.html (best one)

To change the language

     /app/design/frontend/YOUR PACKAGE/YOUR THEME/locale/YOUR LOCALE/translate.csv      for phrases in YOUR LOCALE language for YOUR THEME.      If you change theme this phrases will not be used      (translate.csv from new theme will be used).           example      <strong title="%s">%s item</strong>    <strong title="%s">%s item</strong> <strong title="%s">%s items</strong>    <strong title="%s">%s items</strong> 0 item(s)    0 item(s) Custom tab    Custom tab Video    Video Information    Information Shipping Information    Delivery Information Shipping Method    Delivery Method SHIPPING & HANDLING    DELIVERY & HANDLING

Add the Magento contact form to a CMS page as a static block

Magento has a built-in contact form that does the job, but isn't easy to edit. You may for example want to add your company address, contact details or even a Google Map. This can quite easily be done by creating a CMS page and including the contact form portion of the standard Magento contact form as a static block.     To achieve this, do the following:     1. Create your CMS page (Admin > Manage Pages)     2. Paste the following HTML where you would like the contact form to be  positioned in your CMS page:     {{block type="core/template" name="contactForm"     form_action="/contacts/index/post" template="contacts/form.phtml"}}

To call a static block content

echo $this->getLayout()->createBlock('cms/block')->setBlockId('Custom_tab')->toHtml(); in setblockId(use the name of Identifier used in blog) other way to call to call a static block content <div class="footer-columns-block"> <?php // Predefined Static Block  if ($static_html = $this->getChildHtml('custom_footer_2')):  echo $static_html;  endif; ?>  </div>

To get a child html eg static block

<?php echo $this->getChildHtml('custom_tab') ?>

To get a url

<li><a href="<?php echo $this->getUrl('about-us');?>"><span>About Us</span></a></li>

Multiple Select In Layered Navigation (Filters)

http://www.magentocommerce.com/magento-connect/multiple-select-in-layered-navigation-filters.html

Price slider

http://www.magentocommerce.com/magento-connect/daffodil-price-slider-8395.html magento connect key http://connect20.magentocommerce.com/community/DSLPS

Newsletter box:

<?php echo $this->getLayout()->createBlock('newsletter/subscribe')->setTemplate('newsletter/subscribe.phtml')->toHtml(); ?> to remove: comment the newsletter block in xml file

How does Layered Navigation work?

TO SET PRICE OR COLOR FILTER http://www.magentocommerce.com/knowledge-base/entry/how-does-layered-navigation-work

To place a new theme or template

GO TO the folder app-> design-> fronend ->default and  place ur theme or copy the default folder  from base folder and place in app-> design-> fronend ->default and rename the folder and do the integration, from backend goto system ->configuration -> design and type the template name which u have created and do the same to add css images or js go to app ->skin and same as above 

Magento installation:PHP Extensions "0" must be loaded.

Replace in file app/code/core/Mage/Install/etc/config.xml (near 71th string) this <extensions>     <pdo_mysql/> </extensions> with this <extensions>     <pdo_mysql>1</pdo_mysql> </extensions>