Disable Shipping Options on Region Select
Create a Javascript code that disables Shipping Methods depending on the selected Region
With javascript you can easily add new components to the store and you can add or change the HTML/CSS without touching the store theme.
You need to have a general Jumpseller App created to be able to add a javascript tag to a store. Make sure you read the article on how to create a general Jumpseller App.
To install the javascript tag on a Jumpseller store, a POST request must be performed:
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -X POST "https://api.jumpseller.com/v1/jsapps"
with the following JSON content:
{ app :
{
url: "https://example/test.js",
template: "see the options below",
element: "see the options below"
}
}
Let’s understand each key-value option:
head
or body
)category
: Products lists by categorycheckout
: All checkout pageshome
: Home pagelayout
: All pages of the storepage
: Custom pagesproduct
: Product DetailsExample : To embed https://example/test.js into the body of all pages use:
{ app :
{
url: "https://example/test.js",
template: "layout",
element: "body"
}
}
A Jumpseller App can include several javascript tags on the same store. If you add a javascript for a Jumpseller App on the same template and element where one already exists, the previous one is replaced.
If you need to include several javascripts on the same location or need to include CSS or any assets with the script, you can easily use a package manager like Webpack and bundle everything together for fast loading times.
To list all the javascript installed on the store by a Jumpseller App use the GET request below:
GET "https://api.jumpseller.com/v1/jsapps/:code"
where code is the code field available at the App edition page after the App was created in the Jumpseller Admin.
This is the cURL version of this request:
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -X GET "https://api.jumpseller.com/v1/jsapps/:code"
To destroy a javascript tag installed on the store by a Jumpseller App, perform this DELETE request:
DELETE "https://api.jumpseller.com/v1/jsapps/:id"
where id is the id returned from the request used to list all installed javascripts above.
This is the cURL version of this request:
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -X DELETE "https://api.jumpseller.com/v1/jsapps/:id"
Free trial for 14 days. No credit card required.