Skip to main content
Share Your Experience: Take the 2024 Developer Survey
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); $...
Jaimin Sutariya's 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 ...
KA9's user avatar
  • 531
5 votes

Wrong URL returned by WYSIWYG editor for images

the error is due to Mage::getBaseUrl('media') does not pass the store parameter ! To solve this bug, change in : app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php Find function : ...
Flo69's user avatar
  • 161
4 votes

Demac Canada Post Plugin - "Cannot connect to host"

Demac has posted their own solution here: https://www.demacmedia.com/important-new-patch-magento-canada-post-application/ I have not tested it, but do plan to install it later today (deployment on ...
Kalvin Klien's user avatar
2 votes

Magento generate coupon codes programmatically

the options for data array can be, $generator = Mage::getModel('salesrule/coupon_massgenerator'); $data = array( 'uses_per_customer' => 1, 'uses_per_coupon' => 1, 'qty' ...
manokarthick karthick's user avatar
2 votes

Manual triggered event does not work

Came across the same problem where the event wasn't fired in my external script. Depending on the scope of your observer in the config.xml you have to set the Event Area. require_once 'app/Mage....
pbaldauf's user avatar
  • 237
2 votes
Accepted

Magento : “index” append to email template url

Following has done the job. {{config path="web/unsecure/base_url"}} <a href="{{config path="web/unsecure/base_url"}}service"
Kaushal Suthar's user avatar
2 votes

Magento : “index” append to email template url

Usually it's a simple configuration issue under System > Configuration > Web and set Use Web Server Rewrites to Yes For further explanations I suggest you check out this great SO post: https://...
Raphael at Digital Pianism's user avatar
2 votes
Accepted

Patch 8788 - Average Time to Deploy

Not really at technical question with a definite answer, but it's entirely dependent on how custom your magento build is. It sounds like your developer needs to be a bit more clear with you as to what ...
Luke Rodgers's user avatar
  • 4,452
2 votes
Accepted

can not apply security patch 8788 v2 on magento 1.7.0.2

If you are trying with Magento 1.9 or more, most of the SUPEE patches released are included by default. Since you are trying 1.7.0.2, you need to install all those patches manually and then try ...
Shyam Krishna Sreekumar's user avatar
2 votes
Accepted

Is it possible to run Elasticsearch and Magento on the same server?

You can, as @PiTheNumber said you can check out the requirements here. Still I would recommend using a second server to host it. Elastic Search can be rather resource heavy and you don't want to ...
Sander Mangel's user avatar
2 votes
Accepted

Demac Canada Post Plugin - "Cannot connect to host"

Due to lack of rep, I can't comment on Kalvin Klien's solution. Demac has released an update that unpins the SSL Certificate. This update can be acquired from Canada Post, or if you're a developer (...
Stoyvo's user avatar
  • 36
1 vote
Accepted

Hunks failed in Mage/Catalog/Block/Product/Abstract.php SUPEE 8788

Well I tried something which worked.. hope it will help others who run into the same problem: -Download the Abstract.php file -Add some comment lines -Upload -Try patch -> it will fail this time ...
Robin's user avatar
  • 507
1 vote
Accepted

Look at my code... How do expand to multiple categories?

Simplest thing would be adding another comparison to the condition: <?php $showStartingAt = !$_product->isConfigurable() && $_product->getAttributeSetId() == 9 && $_product-&...
Langley's user avatar
  • 940
1 vote

How to Add additional Sort by?

You can achieve it by doing some custom coding because sort by popularity or sort by Rating is not included in Magento default sort by options. You can refer to the article below for all the steps and ...
Henry Roger's user avatar
1 vote
Accepted

PATCH_SUPEE-8788 and full page caching (magento 1.7.0.2)

3 years ago Gordon (Author of Lest_Fpc) created a fix for the form_key: https://github.com/GordonLesti/Lesti_Fpc/commit/e3725928fcac1924ed663c33bd4067e99b3e7eb1 So, you can use <!-- fpc ...
Pawel's user avatar
  • 1,096
1 vote

get result count for a search word

you can get it with $query->num_results if anyone needs this info in the future..
Robin's user avatar
  • 507
1 vote
Accepted

Which function compares edit bundle with bundle in cart

Take a look at Mage_Sales_Model_Quote_Item::representProduct($product). It compares a quote item with a configured product (i.e. custom options, bundle options etc. are set) that would be added to ...
Fabian Schmengler's user avatar
1 vote

Change store switcher select list into buttons

copy stores.phtml from app\design\frontend\base\default\template\page\switch to app\design\frontend\themepackage\theme\template\page\switch and replace with following code; <?php if(count($this-...
Arunendra's user avatar
  • 7,448
1 vote

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

app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php Make a custom module or put that file in local directory 1) line # 94 change if ($product->isSaleable() || $...
Ahsan's user avatar
  • 161
1 vote

All indexing are stuck at `processing`

I have solved this issue at my end successfully :) First you delete locks folder under var directory: var/locks make sure 777 permission is var/locks and all files under locks directory. Take a ...
KSM's user avatar
  • 61
1 vote

Overriding price.phtml template using addPriceBlockType in Magento CE 1.7.0.2

If you want to change the template on the product detail page, here is an example of a simple product: <PRODUCT_TYPE_simple> <reference name="product.info.simple"> <action ...
Tobias Hartmann's user avatar
1 vote

Magento MySQL Has Gone Away Error

Experienced the same error when migrating a large database between 2 servers. Temporarily adding the following in the mysql configuration file (/etc/mysql/my.cnf) on my local (destination) server &...
Michael's user avatar
  • 502
1 vote

Manage number of address lines

Go in magento admin -> configuration-> Customer -> Customer Configuration-> Name and Address Options (TAB) ->Number of Lines in a Street Address and type number of streets must be 1-4
SURENDER SINGH's user avatar
1 vote

How to list products in descending order?

Go to /app/code/core/Mage/Catalog/Model/ path and add the below code in Product.php public function getRelatedProductCollection() { $collection = $this->getLinkInstance()->useRelatedLinks() ...
Sumit Mohanty's user avatar
1 vote

Warning: include(File.php) failed in Autoload.php on line 93

I had this same issue and turns out flushing the redis cache fix it for me. From command line: echo 'flushall' | redis-cli -s /path/to/sock Heres the documentation incase you're not using a socket: ...
Hector's user avatar
  • 299
1 vote

Warning: include(File.php) failed in Autoload.php on line 93

This error while creating an object from class like $obj = new GoogleClient(); in Magento it try to find out the class file using Autoload.php
manish's user avatar
  • 11
1 vote

sales_order_save_commit_after event triggered twice?

public function sendEmail(Varien_Event_Observer $observer) { if(!Mage::registry('varien_event')){ //your code here... Mage::register('varien_event',true); } } The Bove code ...
Anandan Dart's user avatar
1 vote

Mass change product URL keys to match product names

Here is the improved code from the original question and taking into account the comments from @Tim Bezhashvyly regarding multiple store views. <?php error_reporting(E_ALL); ini_set('...
TheWebsiteGuy's user avatar

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