Price-Indexer Will Not Re-Index in Magento

Interface: SSH
Engine: Magento 1.8
Plugin: Organic Internet’s Simple Configurable Products

Organic Internet’s Simple Configurable Products is a handy Plugin if you’re creating Configurable Products, and wish to only have to set the price of the Simple Product, and not on every Configurable Product. This way, you can change your what-cha-ma-call-it from 4$ for the small to 5$ by only changing it on the Simple Product, not on every single Configurable Product in your store. If you have 100 configurable items (or even 5 for that matter) in your store, trust me, this is a good thing.

So, what I had done is first create my Simple Products that I was going to be associating with my Configurable Product, then I created my Configurable Product. All was good.

Then I added this handy Plugin: “Simple Configurable Products”, and changed a few things around, and noticed that I had to re-index a few things in the Index Manager (this was a warning at the top of the page). When I went to the Index Manager, my Price-Indexer wasn’t re-indexing for me.

Obviously this isn’t acceptable since prices do change.

I dug around a while, and there is already a lot of information out there on this solution, but it was still kind of hard to find the right solution.

The Solution

There is a GitHub forum around this exact issue. It has the solution I’ll be relaying here.

To solve this issue, go into the file located at:

../app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php

and add the following code:

line 87 ->      'group_price'       => new Zend_Db_Expr('pi.group_price'),
line 88 ->      'base_group_price'  => new Zend_Db_Expr('pi.group_price'),

line 131 ->     'group_price',
line 132 ->     'base_group_price',

Note: I always try to make my code align with the way it’s done in the file. This one was a bit tricky!

The Tools

I ran into a problem though when I was trying to access this file my usual ftp way (I use Notepad++). So, I ended up having to use SSH directly and alter the file using the command:

sudo vi [path to magento folder]/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php

The commands when using vi are fairly straight forward.

i = insert
esc = exit insert
:wq = save and quit

 

Hope this helps!

 

This article referenced:

22 Comments

  1. Rishi Khanna November 7, 2013 6:17 pm  Reply

    Hi,
    I tired with the above info and it didnt work.
    Can you send me your configuration.php file?

    • ned November 8, 2013 2:42 pm  Reply

      Rishi, please copy/paste your code in here and hopefully we can identify where the problem is.

  2. Thomas January 14, 2014 5:05 am  Reply

    Hey ned,
    i used the fixed github file (http://bit.ly/19rK4yl) which contained your changes already. I am hanging for days on this problem, but there is now way to reindex with the aktiv scp extension… Maybe you have even another advice?!

    • ned January 24, 2014 7:03 pm  Reply

      Dear Thomas, this is the solution that worked for me. As I mentioned, I did have some troubles with adding the code. Make sure it has all been added properly, as even a dot can make it not work, and saved.

  3. aaron January 22, 2014 8:14 am  Reply

    Ned thanks for posting this. Everything seems to work now, but when I try to reindex price data it goes to my host’s stock 404 page. Hitting the back button shows that the price data has been reindexed but the 404 error is still there any time I try to reindex. Have you had any luck getting this to work with community edition 1.8? I would appreciate any help with this as I am not a coder. Others seem to have this same issue but no website has pointed towards a fix yet.

    • ned January 24, 2014 7:04 pm  Reply

      Aaron, this does sound like an issue I’ve seen before, but I can’t recall why it happened. A 404 error should produce some kind of input into the error log in your server, perhaps looking in there is a good start?

  4. Mat February 28, 2014 5:04 am  Reply

    Thanks a lot.. This works. The necessity for these lines seems to depend on the Magento Version..

    • ned March 4, 2014 6:03 pm  Reply

      which version are you using and found it necessary for Mat?

  5. Giovanni June 24, 2014 2:26 am  Reply

    Hi,

    I applied your solution in my Magento 1.8.1 and everything now works fine.

    Thank you very much.

    • Ned June 24, 2014 7:59 am  Reply

      Hey Giovanni! Very glad it worked out!

  6. Claudia July 7, 2014 5:55 am  Reply

    I’m busy with testing a new webshop using Magento for the very first time. This one solved my problem! After installing the SCP Add on, Magento gave an error when I wanted to re-index the index product prices. I’ve looked around for ages and finally I found your solution. You are my hero!

    I did the same thing in Magento 1.9.1.

    • Ned July 8, 2014 4:04 pm  Reply

      Claudia, I’m so happy that this worked for you! Happy selling!

  7. Dzsidzsi August 29, 2014 4:25 pm  Reply

    Thank you very much!
    its work!

  8. PHil September 9, 2014 8:49 am  Reply

    That worked!!! Thank you very much — I was hoping it would be this simple

  9. Cheese Corn May 26, 2015 6:57 am  Reply

    I’ve been stuck on this issue for 4 days! thanks so much – RESOLVED 😉

    • Ned June 5, 2015 10:30 am  Reply

      So happy to hear it worked my man. If it’s still an option, I’d suggest migrating to a WordPress e-commerce store. So much easier and friendly and glitch free.

  10. Mage July 14, 2015 1:02 am  Reply

    Hey Mate,

    Thanks a lot!! It works for me in 1.9.1 version.

    Thanks Again!!

  11. Bhargav September 1, 2015 5:14 am  Reply

    Thanks code works for me……

  12. izzet December 11, 2015 12:31 am  Reply

    not works in 1.9.2.1

    • Ned December 27, 2015 6:34 pm  Reply

      Unfortunate.

  13. Khan May 25, 2017 8:30 am  Reply

    It worked with Magento 1.9.1.0.

    Thank you Ned

    • Ned May 27, 2017 3:55 pm  Reply

      Glad to hear Khan!

Leave a Reply

eighteen + 18 =