After Variant Save, Update The Price In StoreFront Shopify
I have a Ruby on Rails Heroku APP that Update the price using an external API, that works perfectly!
After I update the price with:
@variant.price = xx @vatiant.save
The variant Price Update, but to see the price in the Product Page, I have to completely refresh the Page.
I want to know if there's a way to Update the Price with Jquery or Something.
Right now I have an Iframe that shows the Price from the View/Controller in the APP.
You can see it on any product on: www.lovegigio.com
Thanks! Cesar Rodriguez
You will need to have some mechanism to bind the price in the view to model so it updates when it changes.
I would poll your service for changes in the model, something that compares the existing price in the UI to the price in the server (maybe every 10 seconds)
and after it identifies the change, it calls to update the iframe:
- → Trigger a click with jQuery using link_to of rails 4
- → Adding html data attribute to simple_forms input
- → How to remove parameters from the root URL if it does I18n
- → passing parameters to rails back end from an ajax call
- → Blocking ?page= in robots.txt
- → react js and rails Updating state on a component with active record relationship
- → State not passed into prop
- → Cannot read property 'modalIsOpen' of undefined
- → Objects not valid issue
- → How to map API params to model
- → Consuming webhooks shopify-api
- → How to add ScriptTag on shopify_api gem?