Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for creating list and adding items to it immediately #100

Closed
engram-design opened this issue Jan 31, 2022 · 4 comments
Closed

Comments

@engram-design
Copy link
Member

Similar to #93 and #81 and will likely require some centralised mechanism to keep these things organised

@jckvnr
Copy link

jckvnr commented Mar 4, 2022

This would be awesome - I have a lot of clients requesting this functionality

@martyspain
Copy link
Contributor

I've done this with Wishlist using JS and Promises with the existing endpoints and that works well enough, but it would be nice to have official support for creating a list and adding an item to it in one go.

@engram-design engram-design added this to the 3.0 milestone Nov 13, 2022
@estebancastro
Copy link
Contributor

@martyspain Can you please show me an example of how you do create the list and add the item it immediately with JS and Promises? Thank You.

note: I don't use the form element to Add, Remove, Update or Toggle items, simply I use the URL, like:

{% for entry in craft.entries.section('news').all() %}
    {% set item = craft.wishlist.item(entry.id) %}
    <a href="{{ item.addUrl() }}">Add to List</a>
{% endfor %}

so I don't know how trigger the actions through JavaScript like this example: https://verbb.io/craft-plugins/wishlist/docs/template-guides/managing-items#submit-with-javaScript

@engram-design
Copy link
Member Author

Added in 3.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants