Requirement : Some times you may run into situation where you want to override the core functionality of Magento core…
Useful Tricks
To create the related product programmatically in Magento <?phpset_time_limit(0);ini_set(‘memory_limit’,’1024M’);require_once ‘../../app/Mage.php’;Mage::app(); $sku=’12345’; //some Sku$product = Mage::getModel(‘catalog/product’)->loadByAttribute(‘sku’,$sku); if($product){$sRelatedProducts = “123456,123”;$aRelatedProducts = explode(‘,’,…
<?php $helper = $this->helper(‘catalog/category’) ?> <?php foreach ($helper->getStoreCategories() as $_category): ?> <a href=”<?php echo Mage::getModel(‘catalog/category’) …
<?php $fieldset->addField(‘country’, ‘select’, array( ‘name’ => ‘country’, ‘label’ => ‘Country’, ‘values’ => Mage::getModel (‘adminhtml/system_config_source_country’) ->toOptionArray(), ));?>
<?php$countryList = Mage::getResourceModel (‘directory/country_collection’) ->loadData() ->toOptionArray(false); echo ‘<pre>’; print_r( $countryList); exit(‘</pre>’);?>
<?php$_countries= Mage::getResourceModel(‘directory/country_collection’) ->loadData() ->toOptionArray(false) ?><?php if (count($_countries) > 0): ?> <select name=”country” id=”country”> <option value=””>– Please Select –</option> <?php foreach($_countries as…
<div id=”leftnav”><?php $helper = $this->helper(‘catalog/category’) ?><?php $categories = $this->getStoreCategories() ?><?php if (count($categories) > 0): ?><ul id=”leftnav-tree” class=”level0″><?php foreach($categories as $category):…
<?php// $_GET$productId = Mage::app()->getRequest()->getParam(‘product_id’);// The second parameter to getParam allows you to// set a default value //which is returned if…
<?php echo Zend_Debug::dump($thing_to_debug, ‘debug’); ?>
<?php echo Mage::helper(‘core/url’)->getCurrentUrl(); ?>