What are the Slack Archives?
It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hello, does anybody know how we can detect any cart change (add/remove) on spryker? We found the `Ca
Hello,
does anybody know how we can detect any cart change (add/remove) on spryker? We found theCartOperationPostSavePluginInterface
which is described as
- Specification:
- This plugin stack is executed after add and remove operations.
- Returned modified quote is ready to be stored on Client side.
Unfortunately this doesn’t seem to be true since on Operation
class beside removeFromCart()
and addToCart()
it is also called in reloadItemsInQuote()
which does not match the promised behaviour in the specification of the interface. reloadItemsInQuote()
therefore is also called when there was no change on quote (like on login).
public function reloadItemsInQuote(QuoteTransfer $quoteTransfer):
QuoteResponseTransfer
{
...
$quoteTransfer = $this->executePostSavePlugins($quoteTransfer);
...
}
However we found also a QuoteChangeObserverPluginInterface
where we could compare the new and the old QuoteTransfer by ourself but this becomes really unnecessary overhead since in our case we would have to compare all existing items against each other to detect a quantity change for example …
Do we miss something here? So basically we want to react whenever a new item was added, an existing was removed or the quantity of any item was changed.
Best regards
Comments
-
Maybe a
CartTerminationPlugin
configured for theadd
andremove
events?0 -
the
ConfiguredBundleQuantityCartTerminationPlugin
does something like you want, I think0 -
Seems exactly what we want … i didn’t suppose something useful when i read “termination” … we would just register ADD and REMOVE and it should work … many thanks 😉 have a nice weekend
0 -
Just be careful that automatic changes like removing the item from the cart because it does not have stock anymore will not be detected by this approach.
0 -
Yeah thats okay … we want just to detect any change of the cart the user has made
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random