Shopping: Prevent duplicate products on a page
See original GitHub issueFeature Description
Right now the idea is that a single product can only appear on a page once.
Currently, it’s possible to end up with multiple products by duplicating or pasting elements.
How can we avoid that?
Possible options:
- Do not add element and display a snackbar message
- Add the element but without the product attached
Not sure where’s the best place to do this.
Relevant code:
useCanvasCopyPaste
: handles keyboard cop/pasteuseCanvasKeys
: handles element duplication viamod+d
.duplicateElementsById
reduceruseAddPastedElements
hook
Alternatives Considered
Additional Context
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:8
Top Results From Across the Web
Google Advice: Duplicate Content on Product & Category Pages
John Mueller of Google offers insights on how Google handles duplicate content on product and category pages.
Read more >How to Handle Duplicate Product Content - Sales Layer Blog
Duplicate content can be damaging for ecommerce businesses. Discover how to identify any cases of duplication and the steps to take to fix ......
Read more >Hide duplicate product from shop page - WordPress.org
Hello, I need help to hide duplicate product. When different vendor add same product, it shows on shop page and other pages.
Read more >Multiple listings for the same product - how to avoid duplication?
Hi everyone, We are working on an e-commerce site that has three different physical stores that each hold different products in stock.
Read more >Prevent Duplicate Items from Being Added to a Shopping Cart ...
The old solution used JavaScript to store the items into a shopping cart cookie. Once done, the customer would be brought to the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I knew you were going to ask this 😃
AFAIK this is currently expected behavior since this is how our snackbars work. We would need to revisit this in a separate ticket.
To answer your question:
Oh I’m so predictable! haha Thanks @swissspidy Approving this one and creating a new one to cover the “multiple products selected” scenario, which is:
#11654