在 Drupal 中乘以 Ubercart 中的对象重量选项
我正在使用 Ubercart 创建一家商店,销售按尺寸切割的金属。
一块金属的价格算法是(宽度*长度*厚度)*每磅成本。
我安装了自定义价格计算模块(uc_custom_price)将选项相乘(因为目前它只是将重量的重量相加)选项一起)。
我基本上想输出以下行 - 但我不确定语法是否正确? (我还使用了 uc_attribute_tokens 模块来帮助简化代码。)
$item->weight = [LengthFeet][weight] * [WidthFeet][weight] * [Gauge][weight];
$item->price = $item->cost * $item->weight;
这是开发的屏幕截图:
谢谢。
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 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
无法找到您在 jpg 中描述的所有元素。
对于正确的语法用户此逻辑:
如果您想访问权重,例如使用
那么您可以使用 $weight
Couldn't find all the elements you described at the jpg.
For the right syntax user this logic:
If you want to access weight for example use
Then you can work with $weight