I am not sure if this approach would work well. For example, take the case where the addToCart() function fails. In this case, using Promise.all(), wixLocation.tio() is going to run and the user will get redirected even though the addToCart() function failed. So, this approach would leave no space for error handling.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| wix-stores: API inconsistencies creating bad mobile experience | 8 | 909 | December 15, 2020 | |
| Hide Mini Cart when using addToCart( ) | 7 | 945 | January 6, 2020 | |
| How do i configure an add to cart button that redirects to another page | 1 | 1006 | August 25, 2020 | |
| Hide Mini-Cart side panel | 8 | 242 | February 13, 2021 | |
| Dynamic "Add to cart" button, stay this page after click? | 9 | 2187 | October 8, 2021 |