We are doing custom Magento themes, Magento design, custom Magento extensions and creative services through Magento designers & developers for worldwide shop owners.

Last News

Author Archives: riadvanced

Magento add or get tracking number of particular shipment

track-ship

In magento, if you want add new tracking number to specific shipment , or if you have more than one tracking number assigned for any particular shipment, and you want showing that is the technique : How add new tracking numbers to specific shipment: 1 2 3 4 5 6 7 8 $shipment = Mage::getModel(sales/order_shipment)->load($id); $trackingDetail = array( 'carrier_code' => ... Read More »

Magento some code about rewrite model for SEO

rewrite

get instance of class url_rewrite model: 1 $coreRewrite = Mage::getModel('core/url_rewrite'); get collection request path by products ids and categories ids : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 $cat_id=2; $product_id=array(1,3); $select = $this->getConnection()->select() ->from($this->getTable('core/url_rewrite'), array('product_id', 'request_path')) ->where('store_id=?', Mage::app()->getStore()->getId()) ->where('is_system=?', 1) ->where('category_id=? OR category_id is NULL', 2) // HERE ASSIGNED ->where('product_id IN(?)', $product_id) ... Read More »

Magento : Complete list of events (observers) and few examples

observer

Complete list of events (observers) , with few examples of how using inside your magento module Exemples catalog_product_save_before catalog_product_save_after config.xml : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 <global> <events> <customer_address_save_before> <observers> <yourmodule> <type>singleton</type> <class>yourmodule/observer</class> <method>customer_address_save_before</method> </yourmodule> ... Read More »

Magento How to get current store id in admin

storeadmin

this very useful snippet for find the current store id in admin in Magento : 1 2 3 4 5 6 7 8 9 10 11 12 13 if (strlen($code = Mage::getSingleton('adminhtml/config_data')->getStore())) // store level { $store_id = Mage::getModel('core/store')->load($code)->getId(); } elseif (strlen($code = Mage::getSingleton('adminhtml/config_data')->getWebsite())) // website level { $website_id = Mage::getModel('core/website')->load($code)->getId(); $store_id = Mage::app()->getWebsite($website_id)->getDefaultStore()->getId(); } else // default level { ... Read More »

Magento : Edit Remove And Override Top Links

toplinks

Many developers want change the default structure of top links inside Magento , example you want remove my account link or edit URL of checkout link other play with label or title of log In log Out . This tutorial is for how done this work : 1- First go to app/design/frontend/default/yourtheme/layout 2- Edit Remove Override : – Edit top ... Read More »

Magento : display Best Selling products ,Most Viewed products , New products ,absolutely or by categories

most-viewed-product-

many developers want use the feature of showing Best Selling products Most Viewed products or New products in home page right column or left column , this tutorials of how create the query for this function ,display absolutely or by categories : Show Best Selling products : Step 1: Create this file app/code/local/YourCompany/YourModule/Block/Product/Bestseller.php in your module and add content : ... Read More »