vuestorefront / vue-storefront

Alokai is a Frontend as a Service solution that simplifies composable commerce. It connects all the technologies needed to build and deploy fast & scalable ecommerce frontends. It guides merchants to deliver exceptional customer experiences quickly and easily.
https://www.alokai.com
MIT License
10.59k stars 2.08k forks source link

Custom methods and cart update #6832

Open Annetastar opened 1 year ago

Annetastar commented 1 year ago

What is your question / Please describe your issue

Hello! We got a problem. On the project, we use the Recharge plugin in Shopify to create subscriptions.

Question one. We can write a custom method to get the sellingPlan for a product. However, I noticed that custom methods are only called in setup (onSSR). Can we call them, for example, by clicking on a button, and not when the page is first loaded?

Question two. We need a custom cart update method to push to a sellingPlan product to subscribe. If we use the custom method, will the cart update automatically or not? I know that the cart only changes state when using built-in hooks like addItem(), and we can't call the cart a second time ourselves. Thank you!

What version of Vue Storefront are you using?

2.3.4

Code of Conduct