Free Shipping on Orders
Select one of the following methods to create orders with a zero shipping fee:
Method 1: Update the Shopify template
Navigate to the product-template.liquid file in your Shopify theme.
within the {% form 'product' ... %} block, insert the following code snippet adjusting the internal logic as needed for your implementation:
{% assign property='someValue' %} <input class="input" type="hidden" name="properties[{{ property }}" value='{{ property }}' />Add the product to the cart to submit the form.
The property is now available on cart.js.
Method 2: Update the cart via API
Insert or update the cart with one of the following APIs:
Insert
curl -X POST \
https://{store_name}.myshopify.com/api/2024-10/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Storefront-Access-Token: {storefront_access_token}' \
-d '{
"query": "mutation cartLinesAdd($cartId: ID!, $lines: [CartLineInput!]!) {
cartLinesAdd(cartId: $cartId, lines: $lines) {
cart {
# Cart fields
}
userErrors {
field
message
}
warnings {
# CartWarning fields
}
}
}",
"variables": {
"cartId": "gid://shopify/Cart/123",
"lines": [
{
"attributes": [
{
"key": "<your-key>",
"value": "<your-value>"
}
],
"merchandiseId": "gid://shopify/ProductVariant/123",
"quantity": 1,
"sellingPlanId": "gid://shopify/SellingPlan/123"
}
]
}
}'
Update
curl -X POST \
https://{store_name}.myshopify.com/api/2024-10/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Storefront-Access-Token: {storefront_access_token}' \
-d '{
"query": "mutation cartLinesUpdate($cartId: ID!, $lines: [CartLineUpdateInput!]!) {
cartLinesUpdate(cartId: $cartId, lines: $lines) {
cart {
# Cart fields
}
userErrors {
field
message
}
warnings {
# CartWarning fields
}
}
}",
"variables": {
"cartId": "gid://shopify/Cart/123",
"lines": [
{
"attributes": [
{
"key": "<your-key>",
"value": "<your-value>"
}
],
"id": "gid://shopify/CartLine/111",
"merchandiseId": "gid://shopify/ProductVariant/123",
"quantity": 1,
"sellingPlanId": "gid://shopify/SellingPlan/123"
}
]
}
}'