Adding to cart on PHP7 throws notice error

Notice: Only variables should be passed by reference in commerce_cart_product_add() (line 1344 of /home/icam/public_html/sites/all/modules/commerce/modules/cart/commerce_cart.module).
when trying to add 2 items to the cart it shows the above warnings.

Now add
$tmp_line_item = clone($line_item);
drupal_alter(‘commerce_cart_product_comparison_properties’, $comparison_properties,
$tmp_line_item);

to line 1344 by commenting the line
(public_html/sites/all/modules/commerce/modules/cart/commerce_cart.module )

drupal_alter(‘commerce_cart_product_comparison_properties’, $comparison_properties,
clone($line_item));

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s