Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 464 Vote(s) - 3.55 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Combine like products on the same line item in the cart

#1
I am having the same issue as outlined [here][1] but the solutions below do not work. I do have "Commerce Product Option" enabled.

I also alter 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 have tried

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

As in #4 but it does not work.


[1]:

[To see links please register here]

Reply

#2

[To see links please register here]


Use hook_commerce_cart_product_comparison_properties_alter() to unset 'commerce_pricing_attributes' property.

In case, your need your line-items to be distinguished by this property. I suggest you to utilise Rules module.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through