Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for price-indexer in Magento 1.7 #85

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix for price-indexer in Magento 1.7 #85

wants to merge 2 commits into from

Conversation

magdev
Copy link

@magdev magdev commented Apr 26, 2012

Added columns group_price and base_group_price to column-list to fix the price indexing error in Magento 1.7.x

@leiweke
Copy link

leiweke commented Apr 27, 2012

Hello magdev, i tried your commits in a new installed shop with the sample data and on our staging server. the price indexer did not work. out of the exeption.log :
2012-04-27T08:26:28+00:00 DEBUG (7): Exception message: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'pi.base_group_price' in 'field list'
Trace: #0 /home/doggieba/public_html/1620/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/doggieba/public_html/1620/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/doggieba/public_html/1620/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /home/doggieba/public_html/1620/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO ca...', Array) #4 /home/doggieba/public_html/1620/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTOca...', Array)
#5 /home/doggieba/public_html/1620/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php(137): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...')
#6 /home/doggieba/public_html/1620/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php(48): OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Price_Configurable->_prepareFinalPriceData()

the message :
DEBUG (7): Exception message: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'pi.base_group_price' in 'field list'

hopefully you can digg into it again.

Thanks a lot
Sebastian

@magdev
Copy link
Author

magdev commented Apr 27, 2012

Hi Sebastian,

you're right - in line 88 it should be pi.group_price instead of pi.base_group_price.

Greetings

Marco

@paales
Copy link

paales commented Jul 2, 2012

Working here as well, please integrate :)

@ChristianScottFaulder
Copy link

Bumped worked perfectly for me, (with the included adjustment to line 8)

@dmitryboruk
Copy link

I also have a problem: I can't reindex price.
Here is a log info:

2012-08-03T02:39:36+00:00 DEBUG (7): Exception message: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1
Trace: #0 /html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /html/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO ca...', Array) #4 /html/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTOca...', Array)
#5 /html/app/code/local/Innoexts/StorePricing/Model/Mysql4/Downloadable/Indexer/Price.php(127): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...')
#6 /html/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php(47): Innoexts_StorePricing_Model_Mysql4_Downloadable_Indexer_Price->_prepareFinalPriceData()
#7 /html/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php(385): Mage_Downloadable_Model_Resource_Indexer_Price->reindexAll()
#8 /html/app/code/core/Mage/Index/Model/Indexer/Abstract.php(143): Mage_Catalog_Model_Resource_Product_Indexer_Price->reindexAll()
#9 /html/app/code/core/Mage/Index/Model/Process.php(209): Mage_Index_Model_Indexer_Abstract->reindexAll()
#10 /html/app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
#11 /html/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php(124): Mage_Index_Model_Process->reindexEverything()
#12 /html/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Index_Adminhtml_ProcessController->reindexProcessAction()
#13 /html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('reindexProcess')
#14 /html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#15 /html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#16 /html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#17 /html/index.php(93): Mage::run('frenchshoretour...', 'website')
#18 {main}

Any thoughts how to fix it?

@yireo
Copy link

yireo commented Aug 29, 2012

Hi,

This fix also helped us out with a Magento 1.7 shop.

Regards,
Jisse

@uthannel
Copy link

I already tried that, and it did fix my product price index but not the error on the frontend

Annel van der Westhuizen

Cell: 083 483 5106

Email: mailto:annelvdw@uthgroup.co.za annelvdw@uthgroup.co.za

Description: http://www.uthgroup.co.za/images/logo_uth.jpg

From: yireo [mailto:notifications@github.com]
Sent: 29 August 2012 12:10 PM
To: organicinternet/magento-configurable-simple
Subject: Re: [magento-configurable-simple] Fix for price-indexer in Magento 1.7 (#85)

Hi,

This fix also helped us out with a Magento 1.7 shop.

Regards,
Jisse


Reply to this email directly or view it on GitHub #85 (comment) .

Description: Image removed by sender.

@yireo
Copy link

yireo commented Aug 29, 2012

Hi,

This thread is not a forum-thread for support, it is a comment-thread on a specific pull request, to confirm or unconfirm that this pull request contains correct code. Looking at your error-dump, I can't see anything mentioning the OrganicInternet module. I do see the mentioning of "app/code/local/Innoexts/StorePricing" - perhaps this indicates that you should look in that direction instead of this module?

Regards,
Jisse

PS: Please note that my answer is not ment as a start of a wider discussion. That's not what GitHub is for. I don't think your problem is related to this pull request. But if you have any code to add to this pull request, this is definitely the place.

@raviramjit
Copy link

Can someone please give a detailed instruction on how to fix? I have same issue with 1.7.

Thanks

1 similar comment
@raviramjit
Copy link

Can someone please give a detailed instruction on how to fix? I have same issue with 1.7.

Thanks

@nithincninan
Copy link

$select->columns(array(
'entity_id' => new Zend_Db_Expr('e.entity_id'),
'customer_group_id' => new Zend_Db_Expr('pi.customer_group_id'),
'website_id' => new Zend_Db_Expr('cw.website_id'),
'tax_class_id' => new Zend_Db_Expr('pi.tax_class_id'),
'orig_price' => new Zend_Db_Expr('pi.price'),
'price' => new Zend_Db_Expr('pi.final_price'),
'min_price' => new Zend_Db_Expr('pi.final_price'),
'max_price' => new Zend_Db_Expr('pi.final_price'),
'tier_price' => new Zend_Db_Expr('pi.tier_price'),
'base_tier' => new Zend_Db_Expr('pi.tier_price'),
'group_price' => new Zend_Db_Expr('pi.group_price'),
'base_group_price' => new Zend_Db_Expr('pi.group_price'),
));

$outerSelect->columns(array(
'customer_group_id',
'website_id',
'tax_class_id',
'orig_price',
'price',
'min_price',
'max_price' => new Zend_Db_Expr('MAX(inner.max_price)'),
'tier_price',
'base_tier',
'group_price',
'base_group_price',
#'child_entity_id'
));

Please try this in /var/www/troemner/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php

'base_group_price' => new Zend_Db_Expr('pi.group_price'), this is the highlighted code in Configurable.php

For reference: https://github.com/magdev/magento-configurable-simple/blob/6d88e5e1846713f579f79905dc3ed35112772ebc/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php

thanks!
Nithin Chacko NInan
+919895382293
Magento Developer plus
nithincninan@gmail.com

@hallandellon
Copy link

For Magento 1.6 I just commented these 4 lines added here 6d88e5e and it reindex again and worked. Could this cause some problem in future?

@leiweke
Copy link

leiweke commented Jan 16, 2013

Hello Hallandellon,

for 1.6 this is correct, but if you upgrade to 1.7 you need this 4 lines !!

Sebastian

@WebDux
Copy link

WebDux commented Jul 12, 2013

Hi MagDev,

Glad to know your this methord. I am runing one Magento shop, which site is http://www.herawigs.com . After we upgrade from 1.6 -> 1.7, there is problem "products price re-index" and "tag re-index" can't work. We have tried many methods to fix that but can't work. We just notice that the price show error now so we have to fix that now,which all show save 100%.

When we want to try to add the columns what you said but we can't find the folder "OrganicInternet" under our server, so we wonder do we need to add new "OrganicInternet" folder and the correct path, please?

I have attached some pictures for your reference. Hope you can help us when you are convenient. Thanks in advance.
error
file-path

@WebDux
Copy link

WebDux commented Jul 15, 2013

Hi MagDev,

Hope your everything is fine.

Could you give us one tips how to fix this problem, please?

We can't find the folder OrganicInternet under community so we create every new folder as the path and uploade the Configurable.php but it still can't work and I attached the picture, could you help us, please?
still-error

@yireo
Copy link

yireo commented Jul 16, 2013

Hi WebDux,

If you could not find a folder OrganicInternet, it sounds like you didn't actually install the module itself. If the module itself is not existing, there's no point in fixing it. All the files that should exist are listed here:
https://github.com/organicinternet/magento-configurable-simple/tree/master/app/code/community/OrganicInternet/SimpleConfigurableProducts
If they don't exist, make sure to install the module first.

@WebDux
Copy link

WebDux commented Jul 17, 2013

Hi Yireo,

Many thanks for your answer.

We have installed the module now and changed the configurable.php for Magento 1.7 and we have cleared the cache but it still can't work, which problem is that it always show "Cannot initialize the indexer process." when I run "reindex data"; And you can see from http://www.herawigs.com/european-hand-tied-skin-weft-tape-hair.html, which there is not any change, no mattery you buy 2 or 3, it show save 100%;

Would you like to help us, please?

Thanks in advance.

@yireo
Copy link

yireo commented Jul 17, 2013

Dear WebDux,

Please note that this website - GitHub - is ment for developers to collaborate on code. It seems you are not a developer yourself, so my first suggestion is to hire a developer to make modifications to your site - before something really bad happens. Magento is complicated, and it assumes you know what you are doing. The module this entire project is about, is simply mentioned on the MagentoConnect site. If you have end-user questions, not developer-questions, GitHub is not the place, MagentoConnect is. For using third party modules in Magento, refer to the Magento Users Guide first.
http://www.magentocommerce.com/magento-connect/simple-configurable-products.html

If you have any code-suggestions regarding SimpleConfigurableProducts, please do use this thread. If you have an issue with Magento itself, please post on the Magento Forums.

@samkohli
Copy link

Awesome!!! This works perfectly in 1.7

@awhitelaw
Copy link

Superb, thanks

@ntk42
Copy link

ntk42 commented Oct 29, 2013

Hey thanks. I'm using 1.8 and this worked like a charm. How come this isn't changed in the code I just downloaded?

@JTielemans
Copy link

This fix messes up magento 1.5.1 and probably previous versions as it tries to import 12 rows in the database while there are only 10 available. Just remove the adjustments made in this fix and index and product saving works again.

obigroup pushed a commit to obigroup/magento-configurable-simple that referenced this pull request Apr 18, 2014
obigroup pushed a commit to obigroup/magento-configurable-simple that referenced this pull request Apr 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet