Shipit Now for Shopify - Logic
Shipit Now for Shopify - Logic
Use this to limit when a shipping method is available.
Data types
String, example value: 'Anders Johansson'
Float, example values: 3,25, 3.25
Integer, example value: 72
Boolean, example values: false, true
Cart Variables
$country, example value: 'SE' (String)
$zipCode, example value: '722 13' (String)
$state, example value: 'NY' (String)
$city, example value: 'Stockholm' (String)
$phone, example value: '123456-2' (String)
$email, example value: 'anders@johansson.com (String)
$company, example value: 'Anders AB' (String)
$isCompany, example value: true (Boolean)
$subtotal, example value: 12345.2 (Float)
$weight, example value: 100.2 (Float)
$currency, example value: 'SEK' (String)
$locale, example value: 'sv' (String)
Functions
allProductsInCollection, takes one String parameter which is the Production Collection Slug and returns a Boolean whether all products in request are in the product collection or not. Example usage: allProductsInCollection('plants')
anyProductInCollection , takes one String parameter which is the Product Collection Slug and returns a Boolean whether any product in request are in the production collection or not. Example usage: anyProductInCollection('plants')
Binary operators
<, LESSER THAN
<=, LESSER THAN OR EQUALS TO
>, GREATER THAN
>=, GREATER THAN OR EQUALS TO
=, EQUALS TO
<>, LESSER THAN OR GREATER THAN
&, LOGICAL AND
|, LOGICAL OR
!=, NOT EQUALS TO (In practice same as <> operator LESSER THAN OR GREATER THAN)
Unary operators
!, LOGICAL NEGATION, example expressions: !true, !$isCompany, !($zipCode = '722 13' | $zipCode = '722 15')
Other features
Parenthesized expressions, example value: (true | false) & (false | true)
When there are multiple lines lines will be evaluated using the LOGICAL OR operator
Examples
Example weight above 20kg: $weight > 20
Example weight above or equal 100 or subtotal above 500: $weight >= 100 | $subtotal > 500
Example at least one product in plants collection: anyProductInCollection('plants') = true
Updated on: 06/11/2024
Thank you!