drupal - Combine like products on the same line item in the cart -


i having same issue outlined here solutions below not work. have "commerce product option" enabled.

i alter price using hook,

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); } 

i have tried

$entity->commerce_pricing_attributes[$set_id['set_id']][$field_name] = $price; 

as in #4 not work.

https://www.drupal.org/node/2056711#comment-9474069

use hook_commerce_cart_product_comparison_properties_alter() unset 'commerce_pricing_attributes' property.

in case, need line-items distinguished property. suggest utilise rules module.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -