Multiplying object weight options in Ubercart in Drupal
I am creating a store using Ubercart that sells metal cut to size.
The algorithm for the price of a piece of metal is (Width * Length * Thickness) * cost per lb.
I installed the module of Custom Price Calculation (uc_custom_price) to multiply the options together (because currently it simply adds the weights of the weight options together).
I basically want to come开发者_JAVA百科 out with the following line - but I'm unsure of the correct syntax? (I also used the module of uc_attribute_tokens to help simplify the code.)
$item->weight = [LengthFeet][weight] * [WidthFeet][weight] * [Gauge][weight];
$item->price = $item->cost * $item->weight;
Here is a screenshot of the devel:
Thank you.
Couldn't find all the elements you described at the jpg. For the right syntax user this logic:
- for passing on object use -> for
- passing on array user ['key']
If you want to access weight for example use
$weight = $dev_var->options['115']->weight;
Then you can work with $weight
精彩评论