I need to hack the “configurable product” so that the price reflects the price of the underlying “simple product.
I have ex. a configurable product with the following attributes:
size
paper type
fold
one of the simple products looks like this:
Size = 11 x 8 1/2”
Paper Type = 60#
Fold = None
The price for the simple product is $1,335
What I want to happen is if a costumers configures the “configurable product” with size=11 x 8 1/2”, Paper Type = 60# and Fold = None, the price of the configurable product should show $1,335
What’s the best / easiest way of doing this?
P.S.
The way “configurable product” pricing functions does not accomplish what I need.
In this case the most unclear part would be the calculation of price deltas in option dropdowns.
Currently it is simple, because the options themselves have explicit price change.
When you have dynamically calculated price deltas, they will need to be changed for all options each time you change any of them. And the numbers might not be logical to the customer.
If you remove the price deltas from dropdowns, then it becomes much simpler, you will need to keep the final prices for each SKU and update the price on frontend with javascript.
The javascript will need to generate the same add to cart url as it would be a simple product.
I don’t need any pricing information coming from the “configurable product” it self. All I really need is once the options are set, pull the price of the corresponding “simple product”.
Anyway to do this in core magento? All I know is some php. Javascript is black magic to me.
I don’t need any pricing information coming from the “configurable product” it self. All I really need is once the options are set, pull the price of the corresponding “simple product”.
I tried the solution suggested above, but without success. What I have done:
- added the new method to: app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php
- changed the template file: app/design/frontend/pool/default/template/catalog/product/view/type/options/configurable.phtml
In configurable.phtml I’m unsure where or in which context I have to add print_r($this->getAttributesInfo()) ?
First try in configurable.phtml:
Change line 38 to:
var spConfig = new Product.Config(<?php print_r($this->getAttributesInfo()) ?>);
I am also interested in how to get this working properly. Currently I am trying to find a way to use the price rules ( 10% site wide ) while having hte discount apply to the options in a configurable product as well. This seem like unjustified overhead for what Im looking to do, Im running out of options as I have been unsuccessful finding an alternative.
If we can get a solution that works properly Ill be happy to go to all the other threads Ive book marked and offer this solution
So it seems that if I uncomment _registerAdditionalJsPrice (protected function) I don’t get the error you guys are posting.
I put getAttributesInfo into here
var spConfig = new Product.Config(<?php echo $this->getJsonConfig() ?>);
So here is the good news and the bad news. By un-commenting that function (which Im sure was commented out for a reason) there is not thrown exception, but a softfail, the dropdown boxes do not have any options in them.
you can see that the calculations are not being done, the same information as the JsonConfig is put into an array, but into an array that is not parsed the same way as JsonConfig because of
return Zend_Json::encode($config)
which formats the data so it can be read in
Can anyone help me understand why keeping the data in unformatted array is closer to the desired objective then leaving it parsed correctly?
Im going to hack at it, but if someone has got this working please post!
I had thought once they fixed the inventory issue and simple product SKU not showing on the invoice, order info, etc., that they would’ve pulled the price and other product info at the same time.
Anybody submit this as a bug or feature request yet?