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 ...
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....
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....
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.
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 ...
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.
...
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
cart × 10plugin-craftcommerce × 7
plugin-craftcommerce2 × 3
craft3 × 2
ajax × 1
events × 1
custom-field × 1
ecommerce × 1
plugin-craftcommerce3 × 1
order × 1
session × 1
addresses × 1
craft4 × 1
commerce4 × 1
plugin-craftcommerce4 × 1