Hi all,
I have content with computation in an Admin form that has a field which
is variable changeable in an another admin form, when a user updates the variable
value it should change the results of the computation automatically to then
render the correct value without having to go into each record to run it to
then save the new calculated value.
So in a sense every time the Gold price field is updated it
needs to re-run the computation or formula below on each record that has the id
of the Gold rate to then update to give a new price.
- 1.Have a content type called products
- 2.Have a content type Gold Rates
Products Content Type has the following fields:
- -Gold Rate Type (Select Dynamic Gold Rate CCK using Gold Price as Value in calculation but ID in Store Value)
- -Weight
- -Value 1 (computation: Gold Rate * Weight)
- -Item Markup
- -Value 2 (computation: Item markup * Value 1 /
100)
- -Price (computation: Value 1 + Value 2)
Gold Rates Content Type has the following fields:
- -ID
- -Title
- -Gold Price
- -Last Updated
Example Data:
Product 1 ( product Admin Form)
Gold Rate = Rate 1, Weight = 60, Value 1 = 960, Item Markup = 30, Value 2 = 288, PRICE = £1,248
Gold Rate Type 1 (Gold Rate Admin Form)
ID = 1, Title = Gold Rate 1, Gold Price = 16
I am not sure which way round or the best way to get the
result I need, should I be using a script that when the page loads on the
front-end it runs the above formula to always give a live price, or should it
be mass updated to then give a fixed static price in the DB column price?
The user will be able to update the Gold price in gold rates
for it to then render a new correct calculated price in the content view on the
front-end through products content type.
So if the user updated the Gold Rate Type 1, Gold Price field to 20, the new Price in Product content should be: £1,560 on the front-end without having to go into every product that has that gold rate to re-run the computation and save.
Any help would be much appreciated