【发布时间】:2015-07-13 15:29:19
【问题描述】:
我遇到了与here 相同的问题,但以下解决方案不起作用。我确实启用了“商务产品选项”。
我也用这个钩子改变价格,
function mectronic_get_amount_qty($price, $length) {
//print '<pre>P ' . print_r($price, 1) . '</pre>';
//print '<pre>L ' . print_r($length, 1) . '</pre>';
if ($length >= 1 && $length <= 5) return $price;
elseif ($length >= 6 && $length <= 10) return $price * (1 - 0.166666667);
elseif ($length > 10) return $price * (1 - 0.285714286);
}
我试过了
$entity->commerce_pricing_attributes[$set_id['set_id']][$field_name] = $price;
与 #4 一样,但它不起作用。
【问题讨论】:
-
抱歉添加了链接
标签: drupal drupal-7 drupal-commerce drupal-hooks