> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://helpdesk.oktagon.se/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Shipit Now for Shopify - Logic


# Shipit Now for Shopify - Checkout Options - Logic

Use this to limit when a shipping method is available in checkout.

### 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

* `$address1`, example value: `'Sturegatan 13'` (String)
* `$city`, example value: `'Stockholm'` (String)
* `$company`, example value: `'Anders AB'` (String)
* `$country`, example value: `'SE'` (String)
* `$currency`, example value: `'SEK'` (String)
* `$date`, example value: '`2025-02-07` (String) (Europe/Stockholm timezone)
* `$email`, example value: `'anders@johansson.com` (String)
* `$fromAddress1`, example value: '`Storgata 1`' (String)
* `$fromCity`, example value: '`Västerås`' (String)
* `$fromCompany`, example value: '`Varasto 2` (String)
* `$fromCountry`, example value: `'FI'`
* `$fromEmail`, example value: `'varasto2@mycompany.com'` (String)
* `$fromIsCompany`, example value: `false` (Boolean)
* `$fromPhone`, example value: `0701231234` (String)
* `$fromState`, example value: 'Stockholms Län' (String)
* `$fromZipCode`, example value: `'722 13'` (String)
* `$isCompany`, example value: `true` (Boolean)
* `$itemCount`, example value: `5` (Integer) (Number of distinct items, quantity ignored)
* `$locale`, example value: `'sv'` (String)
* `$phone`, example value: `'123456-2'` (String)
* `$quantitySum`, example value: `25` (Integer) (Sum of all item quantity sums)
* `$state`, example value: `'NY'` (String)
* `$subtotal`, example value: `12345.2` (Float)
* `$time`, example value: `'14:25'` (String) (Europe/Stockholm 24h format)
* `$weekday`, example value: `1` (Integer) (1 = Monday, 2 = Tuesday, ..., 7 = Sunday)
* `$weight`, example value: `100.2` (Float)
* `$zipCode`, example value: `'722 13'` (String)

### Functions

* `allProductsInCollection`, takes one String parameter which is the Production Collection Title or URL Handle 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 Title or URL Handle and returns a Boolean whether any product in request are in the production collection or not. Example usage: `anyProductInCollection('plants')`
* `countProductsInCollection`, takes on String parameter which is the Product Collection Title or URL Handle and returns a Integer for the count of products in the request that are in the product collection. Example usage: `countProductsInCollection('plants) = 3`
* `toZone` takes on String parameter which is the Shipping Zone name and returns a Boolean whether customers country is in the zone or not. Example usage: `toZone('EU')`

### 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')`
