tags:

views:

41

answers:

1

I am having the following issue with my magento, custom unfortunately, development. The scenario is that the client wants the price of a configurable product to be calculated using a specific formula that involves multiplications, while magento has only sums. for example one of the attributes is "material" and the other one is number of occurrences so these two have to be multiplied.

I have programmed and created through scripting new products for every possible combination and assigned them to a configurable. But when I go to "add to cart" at the end the price that I have is not the one of the final product, but the one magento calculates.

Has any one been across a similar scenario? Any possible solutions?

Because I might have been to abstract, I will also write my usage example:

The store is about selling jewellery.

Attribute: stone material

Attribute: number of stones

Price: Base Value + (number of stones)x(price of stone material)

A: 

I have a strong suspicion that you are changing the price as the item goes into the cart. Is that right? Magento, for some reason which is probably justifiable but not less irritating, will recalculate the price of the item on every page load.

This means that, effectively, you must change the implementation so that the product's internal price calculation is modified to your needs, or the price will never stick.

Hope that helps.

Thanks! Joe

Joseph Mastey
Not exactly unfortunately. What happens is that except if I have understood wrong, I would suspect that at after the customer has selected the appropriate options, the **simple** product that corresponds to them would be added to the cart. This is not the case and something else is being added. What and how is what I'm trying to figure out.What I have to add is that magento in order to show the possible combinations requires a product with those to exist, so it was reasonable to assume that at the end this one would be added to the cart, which is not the case for some reason.
dimitris mistriotis
It's reasonable to assume, except that it's wrong. There are two items added to your cart in this case. The parent (configurable) product and the child (simple) product. The child product is used to decrement inventory, but the parent is used for calculations. So, as before, you have to edit the configurable product to support the price change.
Joseph Mastey
Depending on the real usage (e.g. how many stones can be added), you may want to try to use custom options to accomplish this. It won't allow you to change the cost per stone-type easily, but will allow a lot of the customization you're looking for without hacking models.
Joseph Mastey