3

I have 2 products one is configurable and has a special price of 100 and the associated product has no special price assigned and Final Price is not being returned on the associated product.

I am programmatically loading these...

How do I get the typical "cart" behavior that would assign the associated product the final price value of 100?

$configurable_product = Mage::getModel('catalog/product')->load(1);

$configurable_product->getFinalPrice(); // returns 100

$associated_product = Mage::getModel('catalog/product')->load(2);

$associated_product->getFinalPrice(); // returns 200
3

I actually figured this out by looking at the source and you can pass an associated child product into getFinalPrice:

$qty = 1
$configurable_product->getFinalPrice( $qty, $associated_product );
  • Go ahead and mark this as the answer. – Michael Yaeger Sep 7 '16 at 4:28
  • can't seem to accept my own answer... maybe another mod can? – Steve Ross Sep 7 '16 at 16:18
  • Maybe this was true for old versions, but as of Magento 1.9.2.1, Mage::getModel('catalog/product')->getFinalPrice() accepts a single argument only: s1.postimg.org/3ryhhtqszj/… – Dr. Gianluigi Zane Zanettini Oct 19 '17 at 10:04
0

There is no simple way to have associated child products "inherit" pricing from their parents. This model would not really even work, because a product can be the child of multiple complex container types.

My suggestion: Set a special price on the simple product. I.e. don't try to hack this behavior into the system, but manage it on the data level. If you need them both to have the same sale price, then set that same price value on both products.

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.