Articles on: Shopify
This article is also available in:

Shipit Now till Shopify - Logic in Checkout - Tips

Logic for shipping methods in Shipit Now - Checkout


Shipit Now har inbyggd fraktlogic som kan användas för att visa fraktmetoder baserat på regler som du själv kan konfigurera genom att gå till Shipit Now: Shipping Connector > Checkout.

Shipit Now has built-in shipping logic that can be used to display shipping methods based on rules that you can configure by going to Shipit Now: Shipping Connector > Checkout.

To use this feature in the app, you need to have Shopify Carrier Calculated Shipping (CCS) enabled in your store. CCS is included in Shopify Advanced and Shopify Plus. If you have Shopify "Standard," you can get CCS enabled by paying your Shopify subscription annually or for a fixed monthly fee. If you have Shopify Basic, you can still use the Shipit Now app with the Mapping feature along with Shopify's logic, but unfortunately, you won't be able to display pickup point options in your checkout or use the more advanced logic in Shipit Now.

Shipit Now - Checkout settings

Logic - Data types, variables, operators, and functions



Shipit Now has a highly flexible logic system.

Data type values: 'John Smith' (sträng), 5.25 (flyttal), 3,25 (flyttal), 7 (heltal), true (boolesk), false (boolesk)

Variables: $country, $zipCode, $state, $city, $phone, $email, $company, $isCompany,
$subtotal, $weight, $currency, $locale

Functions: allProductsInCollection($collection (sträng)): (boolesk), anyProductInCollection($collection (sträng)): (boolesk)

Operators: <, <=, >, >=, =, <>, &, |

Examples of logic for your checkout based on weight, country, and cart value


By combining variables, operators, and functions, you can configure rules in Shipit Now and determine when shipping methods should be available in your checkout. By using $weight, $subtotal, $country, $subtotal and $collection in the logic, you can create many popular rules.

If you want to create more advanced rules, you can add variables like $zipCode, $state, $city, $phone, $email, $company, $isCompany, $currency, $locale.


Show the shipping method in the checkout only when the total weight of items in the customer's cart is over 20 kg:

$weight > 20


Show the shipping method only if the total weight is between 10 - 20 kg:

$weight >= 10 & $weight <= 20


Total weight is over 100 kg, and the cart value is over 500:

$weight > 100 & $subtotal > 500


Weight over 100 kg, cart value over 500, only for delivery to Sweden or Finland:

$weight > 100 & $subtotal > 500 & $country = 'SE' | $country = 'FI'


Weight over 100 kg, cart value over 500, only for delivery to Sweden or Finland, and the cart contains any product from the Shopify Collection "Plants":

$weight > 100 & $subtotal > 500 & $country = 'SE' | $country = 'FI' & anyProductInCollection('plants') = true


Weight over 100 kg, cart value over 500, only for delivery to Sweden or Finland, and the cart contains any product from the Shopify Collection "Plants":

$weight > 100 & $subtotal > 500 & $country = 'SE' | $country = 'FI' & anyProductInCollection('plants') = true


Weight over 100 kg, cart value over 500, only for delivery to Sweden or Finland, and the cart contains only products from the Shopify Collection "Plants":

$weight > 100 & $subtotal > 500 & $country = 'SE' | $country = 'FI' & allProductsInCollection('plants') = true


Weight over 100 kg, cart value over 500, only for delivery to Sweden or Finland, and the cart contains any product from the Shopify Collection "Bulky":

$weight > 100 & $subtotal > 500 & $country = 'SE' | $country = 'FI' & anyProductInCollection('skrymmande') = true


Examples of logic for your checkout based on country and postal code



Show the shipping method only for Swedish customers with postal code 123 45:

$zipCode = '123 45' & $country = 'SE'


Show the shipping method only for Finnish customers in the postal code range 00170 to 00190:

$zipCode >= '00170' & $zipCode <= '00190' & $country = 'FI'


Examples of logic for B2B


To show selected shipping methods to business customers, you can use $company and $isCompany. `$company`is the company name, $isCompany represents all companies.

Show a selected shipping method to the company ACME AB:

$company = 'ACME AV'


Show a selected shipping method if customer is a company

$isCompany = true


Show a selected shipping method if customer is a company with address in Finland which has more than 500 EUR in cart.

$isCompany = true & $country = 'FI' & $subtotal > 500 & $currency = 'EUR'

Updated on: 14/11/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!