Skip to main content
2 votes
Accepted

How to make a curl request with a session to an action url?

You don't want to use a separate web request to call the controller action of Craft Commerce. This has numerous downsides beyond your current problem with the missing session. It will negatively ...
MoritzLost's user avatar
  • 11.9k
2 votes
Accepted

How to add a 'Share Cart' button to send email to customer with cart link

To inject the button into the order edit page, you can use the cp.commerce.order.edit.order-actions template hook via a custom plugin/module. use Craft; Craft::$app->getView()->hook('cp....
Ben Croker's user avatar
  • 7,796
2 votes
Accepted

Displaying coupon error messages on front end commerce 4

If a coupon triggers an error, that error is part of the cart element. It's accessed as couponCode This is from a Craft 3 project (4 i believe is same): {% set firstCouponCodeNotice = cart....
cherrykoda's user avatar
  • 1,114
2 votes

Update Craft Commerce cart with ajax

The behaviour with ajax responses changed significantly with Craft 4 / Commerce 4 - I have updated my answer to that original question: Update Commerce Cart using Ajax ...to cover both scenarios.
Jeremy Daalder's user avatar
2 votes

Update Craft Commerce cart with ajax

Forgive me for perhaps answering a substitute question but it seems to me as though what you really need to know is how to do basic debugging in JavaScript, since it only requires a quick bit of ...
James Smith's user avatar
  • 5,689
1 vote

How to persist modified order of cart line items?

Can you try using EVENT_POPULATE_LINE_ITEM? Not sure, but it fired AFTER the product & variant snapshot event. Here you can take any necessary fields & data, including one from the snapshot. ...
RomanAvr's user avatar
  • 712
1 vote

Empty cart should remove coupon discounts in commerce

I think this one is debatable from a functional perspective. On first glance, it feels like if a cart is emptied then the coupon should be removed, but on the flip side, if they are simply changing ...
Jeremy Daalder's user avatar
1 vote
Accepted

Craft Commerce "state" dropdown field fails to populate with states for new customer addresses

This is caused by the model.countryId not being defined on first page load, which means the options defaults to an empty array. Once the address is saved, the selected country that is saved will ...
Martin Spain's user avatar
  • 1,624
1 vote
Accepted

Commerce 2 Sales Not Present In Cart lineItems

After further testing and debugging, it turns out these issues are related to this bug in Commerce: https://github.com/craftcms/commerce/issues/1206 As per that github issue, it was a Discount with ...
Mike's user avatar
  • 719

Only top scored, non community-wiki answers of a minimum length are eligible