Skip to content

Instantly share code, notes, and snippets.

@johnbuck
Last active February 14, 2017 23:49
Show Gist options
  • Save johnbuck/e268713cfcc177aeb2fe914605a327a7 to your computer and use it in GitHub Desktop.
Save johnbuck/e268713cfcc177aeb2fe914605a327a7 to your computer and use it in GitHub Desktop.
Estimated Product Delivery Date Psuedocode
If [product] == (bed | furniture) & {
If [product inventory > 0] {
[Display the inventory message "2-3 Weeks Estimated Delivery"]
}
If [product variant.incoming == TRUE] {
[Display the inventory message "Product is available to ship from [Incoming arrival date + 7 days]"]
}
If [product inventory == 0 & product variant.incoming == FALSE & variant.inventory_policy == "continue" ] {
[Update button label to read "special order"]
[Display the inventory message "Product is available to preorder with an estimated delivery of 10-12 weeks.
}
// This is just a "sold out" product
// Here, we're looking to update the "Sold out" label to read "Unavailable"
If [product inventory == 0 & product variant.incoming == FALSE & variant.inventory_policy == "deny" ] {
[Update button label to read "Unavailable"]
Disable the button as well (Shopify default?)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment