Redirecting in Magento
Redirect to the list Action in the same Controller $this->getResponse()->setRedirect(Mage::getUrl(’*/*/list’));
Redirect to the list Action in the same Controller $this->getResponse()->setRedirect(Mage::getUrl(’*/*/list’));
Method 1: <?php … $this->getResource()->getTable(’catalog/category_product’); Method 2: … Mage::getSingleton(’core/resource’)->getTableName(’catalog/category_product’);
<?php … public function getCustomer() { $customerId = $this->_getCustomerId(); return Mage::getModel(’customer/customer’)->load($customerId); } private function _getCustomerId() { return Mage::getSingleton(’customer/session’)->getCustomerId(); } …
<?php // require_once ‘/var/www/magento/app/Mage.php’; // Mage::init(); function getSession() { return Mage::getSingleton(’customer/session’); } if (!getSession()->isLoggedIn()) { $this->_redirect(’customer/account/login’); return; } if (getSession()->isLoggedIn()) { echo ‘loggedIn’; $customerData = Mage::getSingleton(’customer/session’)->getCustomer(); printf("%s\n %s\n %s\n %s", $customerData->getId(), $customerData->getWebsiteId(), $customerData->getStoreId(), $customerData->getIsActive()); //Zend_Debug::dump($customerData); }
1) eav_attribute whenever you create a attribute this table gets entry which stores all important data which helps to make a relation, like entity_type_id,attribute_code,backend_type and many more but this are the important fields. 2) eav_entity_type Magento has 8 types of entity, by which, type of attribute is decided. in your case it is catalog_product 1) […]
EAV makes a lot of sense for a generic e-commerce solution. A store that sells laptops (which have a CPU speed, color, ram amount, etc) is going to have a different set of needs than a store that sells yarn (yarn has a color, but no CPU speed, etc.). Even within our hypothetical yarn store, […]
Place this function to Resource Model public FUNCTION getMarkers($lat, $lng) { /** * Search radius in km */ $searchRadius = 10; /** * Get the resource model */ $resource = Mage::getSingleton(’core/resource’); /** * Retrieve the read connection */ $readConnection = $resource->getConnection(’core_read’); /** * Retrieve our table name */ $table = $resource->getTableName(’storelocator/entity’); […]
<?php $collection = Mage::getResourceModel(’mybrands/orders’) ->addFieldToSelect(’name’) ->addFieldToSelect(’order_id’); echo ‘<pre>’; print_r($collection->getSelect()->__toString());
1. in phtml file do: <?php echo $this->__(’Stores found’)?> 2. In Vendor/Module/etc/config.xml do: … <frontend> <translate> <modules> <VisionDirect_Globalcollect> <files> <default>VisionDirect_Globalcollect.csv</default> </files> </VisionDirect_Globalcollect> </modules> </translate> <routers> … </routers> </frontend> … 3. app/locale/de_DE/VisionDirect_StoreLocator.csv “My name is Imran”,”Maine name ist Imran” “That is a wall”,”Dast ist fenster” 4. Switch domain name of your webstie from english to German […]
<?php echo Mage::getStoreConfig(’general/locale/code’) ?>