cancel
Showing results for 
Search instead for 
Did you mean: 

Update pricing of Super Attributes

SOLVED

Update pricing of Super Attributes

I'd like to programatically modify this pricing:

 

 

Unfortunately, I'm not able to find any resources online on doing this. I've looked at $product->getAttributes(); and a possible setPrice()/save() method call, but that isn't doing what I want.

 

Any ideas?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Update pricing of Super Attributes

Hi,

I don't have a full code solution..but if you wanted to go down the raw SQL route all the information is stored in the table: catalog_product_super_attribute_pricing

 

The 'super attribute' (or configurable attribute) is linked too in the table: catalog_product_super_attribute

 

 

Problem solved? Click Accept as Solution!
Magento Certified Developer Plus | www.iwebsolutions.co.uk | Magento Small Business Partner

View solution in original post

4 REPLIES 4

Re: Update pricing of Super Attributes

Hi,

I don't have a full code solution..but if you wanted to go down the raw SQL route all the information is stored in the table: catalog_product_super_attribute_pricing

 

The 'super attribute' (or configurable attribute) is linked too in the table: catalog_product_super_attribute

 

 

Problem solved? Click Accept as Solution!
Magento Certified Developer Plus | www.iwebsolutions.co.uk | Magento Small Business Partner

Re: Update pricing of Super Attributes

With no other apparent option, this will have to do. Thank you!

Re: Update pricing of Super Attributes

I have one more question. Does updating that pricing column require a refresh of any cache or indexes? If so, is there a way to manually trigger the yellow notice in the admin panel to do so?

Re: Update pricing of Super Attributes

Hi,

I think it's just the catalog_price_index (if any) that would need updating after manually adjusting configurable prices via SQL.

 

Something like the below should do it programatically:

<?php
$process = Mage::getModel('index/indexer')->getProcessByCode('catalog_product_price');
$process->reindexAll();

The catalog_product_price can also be replaced by the following if you need to reindex something else programatically

catalog_product_attribute     Product Attributes
catalog_product_price         Product Prices
catalog_url                   Catalog URL Rewrites
catalog_product_flat          Product Flat Data
catalog_category_flat         Category Flat Data
catalog_category_product      Category Products
catalogsearch_fulltext        Catalog Search Index
cataloginventory_stock        Stock Status
tag_summary                   Tag Aggregation Data
targetrule                    Target Rules

Or you can do them all with something like:

<?php
$indexCollection = Mage::getModel('index/process')->getCollection();
foreach ($indexCollection as $index) {
    $index->reindexAll();
}
Problem solved? Click Accept as Solution!
Magento Certified Developer Plus | www.iwebsolutions.co.uk | Magento Small Business Partner