I just completed a fresh installation of commerce kickstart and when trying to add a product to cart, I get the following error.

Error: Cannot pass parameter 3 by reference in commerce_cart_product_add() (line 1344 of C:\xampp\htdocs\commerce\profiles\commerce_kickstart\modules\contrib\commerce\modules\cart\commerce_cart.module).

None of the products I have created can be added to the cart, including demo products.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

_deschant created an issue. See original summary.

mglaman’s picture

Title: Add To Cart Button not working » CK2 Throws notice on PHP7 for adding products to cart
Version: 7.x-2.45 » 7.x-2.x-dev
Assigned: _deschant » Unassigned
Priority: Major » Normal
Issue tags: -shopping cart add to cart +php7

Sounds like you're using PHP7. The problem is that a PHP7 fix was committed but not in a tagged Commerce release #2762907: Adding to cart on PHP7 throws notice error.

This is normal, as we have a full test suite that passes. We do not gurantee PHP7 support. If you write a patch for CK2 to use the patch from that issue, we can include it.

_deschant’s picture

Thank you! This worked for me. :)

jantoine’s picture

Component: User interface » Code
Status: Active » Needs review
FileSize
513 bytes

Attached is a patch for Commerce Kickstart 2.x-dev.

mglaman’s picture

Got tests up at this PR https://github.com/commerceguys/commerce_kickstart/pull/234

We'll see what happens, then merge for next quick release.

  • mglaman authored 636b63d on 7.x-2.x
    Issue #2860151 by jantoine, _deschant, mglaman: CK2 Throws notice on...
mglaman’s picture

Waiting for final tests to finish, then tagging release.

mglaman’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ibrahim_shah’s picture

Warning: A non-numeric value encountered in theme_pager() (line 329 of F:\xampp\htdocs\drupal\includes\pager.inc).

ibrahim_shah’s picture

can someone help what the problem