How do I get attribute set name?

Whenever you have a product object, you can access its attribute set like this: $attributeSetModel = Mage::getModel(“eav/entity_attribute_set”); $attributeSetModel->load($product->getAttributeSetId()); $attributeSetName = $attributeSetModel->getAttributeSetName(); This will give you the name of the attribute set, which you can then compare using strcmp: if(0 == strcmp($attributeSetName, ‘My Attribute Set’)) { print $product->getAttributeText(‘attribute’); }

Magento: Get store contact telephone

That’s a Core configuration, so it’s saved in core_config_data table, and the phone information is the field: general/store_information/phone So, all you need is to read the configuration data as $storePhone = Mage::getStoreConfig(‘general/store_information/phone’); For CMS pages insert the following variable: {{config path=”general/store_information/phone”}} You can find more info on this here, and you can always do the … Read more

Magento system.xml and 404 error when trying to access the configuration panel

If it’s the 404 in the Admin Console chrome, then your problem is a missing ACL role. Read this article on how to set one up. (self link) Also, after setting up your ACL role, you’ll need to clear out your Magento sessions. Magento caches specific roles in the session, and new sessions won’t be … Read more

Magento admin login not working in chrome but works fine for firefox

I think there is the problem with session cookie with the chrome browser. So just go through this directory /app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file and comment out the line from 85 to 92 in magento (1.7.2 for my case). Like this // session cookie params /* $cookieParams = array( ‘lifetime’ => $cookie->getLifetime(), ‘path’ => $cookie->getPath(), ‘domain’ => $cookie->getConfigDomain(), … Read more

Magento: Set LIMIT on collection

There are several ways to do this: $collection = Mage::getModel(‘…’) ->getCollection() ->setPageSize(20) ->setCurPage(1); Will get first 20 records. Here is the alternative and maybe more readable way: $collection = Mage::getModel(‘…’)->getCollection(); $collection->getSelect()->limit(20); This will call Zend Db limit. You can set offset as second parameter.

Please enter a valid URL. Protocol is required (http://, https:// or ftp://) in Magento 1.9.2 installing?

Resolve this issue by the following methods (from good to worse): 1) Inspect the url field and delete the class ‘validate-url’ to stop validation from the field and proceed the process. have a good Luck guys. OR 2) just mark the “Skip Base URL Validation Before the Next Step” checkbox. OR 3) use 127.0.0.1 instead … Read more

Fatal error: Uncaught Error: Function name must be a string in C:\xampp\htdocs\em0126\app\code\core\Mage\Core\Model\Layout.php:555 Stack trace: #0

Your solution Fatal error: Uncaught Error: Function name must be a string in … app\code\core\Mage\Core\Model\Layout.php:555 … This error was easy to fix because the problem was in the following line: $out .= $this->getBlock($callback[0])->$callback[1](); Instead it should be: $out .= $this->getBlock($callback[0])->{$callback[1]}(); find your detail solution here on below given link http://www.code007.ro/making-work-magento-with-php-7-rc1/

tech