Check if there are any shipping methods available
public function haveShippingMethods() { if (count(Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingRatesCollection())) { return true; } return false; }
The Stonewall Inn
Cosimo Galluzzi

@theartofmadeline
occasionally subtle
Game of Thrones Daily
2025 on Tumblr: Trends That Defined the Year

Product Placement
"I'm Dorothy Gale from Kansas"

shark vs the universe

No title available

tannertan36
No title available
tumblr dot com
KIROKAZE
Fai_Ryy

PR's Tumblrdome
he wasn't even looking at me and he found me
Aqua Utopia|海の底で記憶を紡ぐ
The Bowery Presents
Not today Justin
seen from Spain
seen from United Kingdom

seen from Pakistan
seen from United States
seen from Bangladesh
seen from United Kingdom
seen from United States
seen from Israel
seen from United States
seen from United States
seen from France

seen from Czechia

seen from United States

seen from Malaysia

seen from Netherlands
seen from Pakistan
seen from United Kingdom
seen from Taiwan
seen from Tunisia
seen from Türkiye
@magento-code-snippets-blog
Check if there are any shipping methods available
public function haveShippingMethods() { if (count(Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingRatesCollection())) { return true; } return false; }
Get attribute set collection
$attributeSetCollection = Mage::getResourceModel('eav/entity_attribute_set_collection') ->load();
Get a categories products ordered by number of sales
$categoryId = 1; //Change this to whatever the category id is - duh :) //Lets load up that category $category = Mage::getModel('catalog/category')->load($categoryId); $products = Mage::getResourceModel('reports/product_collection') ->addOrderedQty() ->addAttributeToSelect('*') ->setOrder('ordered_qty', 'desc') ->addCategoryFilter($category);
Get all of the top level categories
//Usually, the first base category added will have the id of 2 $defaultCategoryId = 2; $topLevelCats = Mage::getModel('catalog/category') ->getCollection() ->addAttributeToSelect('path','name','id') ->addAttributeToFilter('parent_id', $defaultCategoryId) ->setOrder('position', 'ASC');
Set current store (pass the integer id)
$storeId = 1; Mage::app()->setCurrentStore($storeId);
Print the SQL queries performed when calling a product collection
$_productCollection->printLogQuery(true);
Get store contact number
Mage::getStoreConfig('general/store_information/phone');
Unsubscribe customer using email address
Mage::getModel('newsletter/subscriber') ->loadByEmail($emailAddress) ->unsubscribe();
Get Base Secure URL
Mage::getBaseUrl('web', true);
Check if Google Analytics is available
Mage::helper('googleanalytics')->isGoogleAnalyticsAvailable()
Get product collection
$collection = Mage::getModel('catalog/product')->getCollection();
Check if RSS is enabled
Mage::getStoreConfig('rss/catalog/category');
Get the current category name
Mage::registry('current_category')->getName();
How many items are there in the basket?
Mage::getSingleton('checkout/cart')->getSummaryQty();
Get a configurable product child products
$childProducts = Mage::getModel('catalog/product_type_configurable') ->getUsedProducts(null, $product);
Get the number of products shown in the sidebar
Mage::getStoreConfig('checkout/sidebar/count');
Check if a product is configurable
$product->isConfigurable();