Combine similar products in one position in the basket

I have the same problem as described here , but the solutions below do not work. I have the option "Trading Product".

I also change the price using this 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 tried

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

Like in # 4, but it does not work.

+7
drupal drupal-7 drupal-hooks drupal-commerce
source share
1 answer

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

Use the hook_commerce_cart_product_comparison_properties_alter () function to disable the commerce_pricing_attributes property.

In case you need your positions to be highlighted by this property. I suggest you use the rule module.

+1
source share

All Articles