0

I want To set auto pricing configurable(Parent) Products At backend Parent Price should be come lowest price from simple(child)Products. except $0 price product.
Thanks

1

Use this to show the lowest price simple price on the front end:

https://github.com/organicinternet/magento-configurable-simple

You can then run a script to update configurable prices from lowest price simple with this:

<?php
require '/fullpath/httpdocs/app/Mage.php';
Mage::app();
$collectionConfigurable = Mage::getResourceModel('catalog/product_collection')->addAttributeToFilter('type_id', array('eq' => 'configurable'));
foreach ($collectionConfigurable as $_configurableproduct) {    
$product = Mage::getModel('catalog/product')->load($_configurableproduct->getId());
$original_price = $product->getData('price');
$new_price = $product->getPrice();
if ($original_price != $new_price){
$product->setPrice($new_price);
$product->save();
echo "\n\n" . $product->getName() . ' updated price from: ' . $original_price . ' to: ' . $new_price;
}
}
?>

Done.

  • @Mike Tim Turner Thanks for reply How can I run This script I am new in magento Thanks – Grace Mar 7 '17 at 14:46
  • Create a Cron to run this script. this will be done on your server outside of Magento. Or you can put the file path in your browser to run if you have the correct permissions – Mike Tim Turner Mar 7 '17 at 14:50
  • Yes i have permission I am running via Browser But I am Gtting Error This Fatal error: Call to a member function getResourceModelInstance() on a non-object in C:\xampp\htdocs\magento-1.9.2.4\app\Mage.php on line 491 – Grace Mar 7 '17 at 14:55
  • First I create file At Root Folder OF FTP by name price_update And And Include include_once 'app/Mage.php'; And Past Your Script – Grace Mar 7 '17 at 14:57
  • I've updated it. Try now – Mike Tim Turner Mar 7 '17 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.