2022 Developer Survey is open! Take survey.
29 votes

Change product image for configurable products

The question is tagged with ce-1.7.0.2 but for future reference, if you are using ce-1.9.1.0 ee-1.14.1 or higher, the feature is already built in, with the so-called Configurable Swatches which allow "...
user avatar
21 votes
Accepted

How can I tell if a corrupt image file is being used for credit card skimming?

For the specific answer to your question see, https://magento.stackexchange.com/a/72700/361 Background Firstly, there is no specific exploit - there are a series of articles doing the rounds at the ...
user avatar
  • 17.5k
15 votes
Accepted

How to get customer phone from order shipping data?

$order->getShippingAddress()->getTelephone();
user avatar
  • 1,649
15 votes
Accepted

Why does PATCH_SUPEE-6788 appear to have no effect on a 1.7.0.2 installation?

It appears that changes to my .htaccess as well as a missing .htaccess.sample are the culprit. After restoring a stock copy of both files (both were required) the patch appears to apply successfully. ...
user avatar
  • 2,047
14 votes
Accepted

Magento - Please specify the product required option(s) Error

I don't know exactly how you can solve this but I can explain the problem, maybe it helps. I see that the product page is on https but when you click on the add to cart button the form is submitted ...
user avatar
  • 195k
12 votes

Move out of stock products to the end of the catalog product list

Solution 1 This moves out of stock products to the end of the list on page, not all over the pagination: 1.Add event observer: <frontend> <events> <...
user avatar
  • 6,214
12 votes
Accepted

How to set the default value of "Is Active" to "yes" on a new category

I would advise never editing core code as it will create issues for you down the road. This is a database change. 0 comes before 1 and no default value is set for that attribute so 0 will always be ...
user avatar
  • 3,363
10 votes
Accepted

How to read CSV with multi columns and reside in magento root dir?

You can use it in this way to get data from csv file: public function getCsvData($file){ $csvObject = new Varien_File_Csv(); try { return $csvObject->getData($file); } catch (...
user avatar
9 votes
Accepted

How to Add additional Sort by?

There are two ways to do it 1) Using Magento Admin Panel 2) Using Custom Coding 1) To add using Magento Backend you need to follow below steps a) Goto Catalog->Attributes->Manage Attributes b) ...
user avatar
  • 3,554
9 votes

How can I tell if a corrupt image file is being used for credit card skimming?

I'm adding another answer just because my other one didn't actually answer the question - and it certainly doesn't need to be any longer! How can I verify if an image contains CC information ...
user avatar
  • 17.5k
8 votes

Magento Limit number of products displayed in grid on homepage

I have run into the same issue during a site I am managing. The proposed solutions do not appeal to me, as they require creating blocks to extend the core product list class, or as proposed to ...
user avatar
  • 9,796
8 votes
Accepted

Add new custom CMS template directive {{cdnmedia}}

This is how I've done it right now. Overriding CMS template filter The CMS Helper contains two methods called getPageTemplateProcessor() and getBlockTemplateProcessor() which will do Mage::getModel(....
user avatar
  • 7,342
8 votes
Accepted

Security: Patched 1.7.0.2 versus 1.9.2.2

First of all: Nice question! I'd say a fully patched 1.7.0.2 is as secure as a new 1.9.2.2. As long as there are still security patches released for 1.7.0.2 you're good to go with it. So I think it ...
user avatar
  • 17.2k
7 votes

Product pages displaying 404 page

Looks like the table report_event_types is empty. If yes, run the following query and it will work. CREATE TABLE IF NOT EXISTS `report_event_types` ( `event_type_id` smallint(5) unsigned NOT ...
user avatar
  • 926
7 votes

sales_order_save_commit_after event triggered twice?

If anyone is still having problem with this, I found out how magento deals with this. In the called method you can take the order and set a flag on it. Ex: public function export(...
user avatar
  • 347
7 votes

How to show "Out of Stock" text in dropdown option?

To show out of stock products go to System > Configuration > Catalog > Inventory and set Display Out of Stock Products to yes. Now we'll need to rewrite the class ...
user avatar
  • 37.4k
7 votes
Accepted

What is purpose of blank.html in js directory?

It's used by some Magento modules like Authorizenet as a fallback page for iframes. Other uses I have't found for it yet. The actual URL will be set with javascript most likely, the blank html page ...
user avatar
  • 37.4k
6 votes

layout handle not working in custom email

I had the exact same problem, but was able to fix it by using store emulation. It turned out the design package was incorrect. The email was being built using the adminhtml package instead of the ...
user avatar
  • 380
6 votes

How to list products in descending order?

Question is tagged CE 1.7.0.2 but this solution is useful for those on 1.9.1.1 so I'm adding it here. We had an opposite problem where we needed to show the cheapest products first when sorted by ...
user avatar
6 votes
Accepted

Why is the link to 'proceed to checkout' a button type?

There may be a canonical answer, but my best guess is for the following reasons: Semantics. The button is displayed as a clickable button, therefore the logical HTML element to use is a button. ...
user avatar
  • 35.6k
6 votes

Invalid URI error after migrating Magento and no underscore in URL

Check any whitespace or new line character on core_config_data table entries for base_url fields (web/unsecure/base_url, web/secure/base_url, web/unsecure/base_url, web/secure/base_url). I encountered ...
user avatar
  • 509
6 votes
Accepted

Edit category in admin issue

Try adding the parameter clear to your urls. There is a function isClearEdit that is in the class Mage_Adminhtml_Block_Catalog_Category_Tree This appears to stop the second load or at least load the ...
user avatar
6 votes

Magento admin password reset using md5, why?

The encryption key is used for encryption and decryption, not for hashing. The user and admin passwords are just hashed. See how Mage_Admin_Model_User::_beforeSave works. $data['password'] = $this-&...
user avatar
  • 195k
6 votes
Accepted

How to Get core_config_data using Magento soap api?

Create A Custommodule: Api File(Api.php) <?php class Amit_Customapi_Model_Api extends Mage_Api_Model_Resource_Abstract { public function myregion() { $...
user avatar
  • 75.5k
6 votes

Magento 2 migration tool MySQL server has gone away

I had the same problem and solved it by increasing the following value in the /etc/mysql/my.cnf mysql configuration file: max_allowed_packet=4000M # just set it to 4000M because on my dev machine i ...
user avatar
  • 743
6 votes
Accepted

Assign Products created in last 45 days to specific category

You can use below code to assign products created in last 45 days to your category. $categoryId = 41; // Your category Id $category = Mage::getModel('catalog/category')->load($categoryId); $...
user avatar
5 votes

Permanent solution for the common indexing issue

In most of the heavy Magento webshops it's mostly been so hard to get the Magento backend Index Management working. I have had this issue often. Running the shell script all the time by the developer ...
user avatar
  • 509
5 votes

Magento Limit number of products displayed in grid on homepage

Just ran into this problem myself. I wanted to display multiple selected categories on a cms page (in this case home page) with a limit of 4 products using the grid mode to have the products appear ...
user avatar
  • 5,169
5 votes
Accepted

Set Magento Config Data For Script Duration Only

The problem with setNode() is that it does not refresh the config cache in Mage_Core_Model_Store. This is not the Magento cache but a PHP array, populated at runtime on store initialization for store ...
user avatar
5 votes

Remove blank option from country dropdown list

This might be late but I think very short & sweet solution :- The file is this - app/code/core/Mage/Directory/Block/Data.php and the function is this - getCountryHtmlSelect If you want to ...
user avatar
  • 521

Only top scored, non community-wiki answers of a minimum length are eligible