Skip to content

nf-shopify/bulk-pricing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shopify Function Template - Cart Transform Function (app with extensions only)

Use Case - Bulk Pricing

This is a template for building a Cart Transform Function that applies dynamic line item pricing based on the line item quantity added to the cart. This app does not include an app home UI.

It contains the basics for building a Shopify app that uses only app extensions.

(https://shopify.dev/docs/apps/getting-started)

(https://shopify.dev/docs/api/functions/reference/cart-transform)

Getting started

Requirements

  1. You must download and install Node.js if you don't already have it.
  2. You must create a Shopify partner account if you don’t have one.
  3. You must create a store for testing if you don't have one, either a development store or a Shopify Plus sandbox store.

Clone the project

git clone https://github.com/nf-shopify/bulk-pricing.git

You can find function within /extensions/bulk-pricing-function

Prerequisites

  1. Creation of a json metafield on the varirant object to contain bulk pricing - namespace: "custom", key: "bulk_prices"
{
   "bulkPrices":[
      {
         "quantity":1,
         "price":"399.99"
      },
      {
         "quantity":4,
         "price":"299.99"
      },
      {
         "quantity":6,
         "price":"199.99"
      },
      {
        "quantity":8,
        "price":"99.99"
      }
   ]
}

Local Development

The Shopify CLI connects to an app in your Partners dashboard. It provides environment variables and runs commands in parallel..

You can develop locally using your preferred package manager. Run one of the following commands from the root of your app.

Using npm:

npm run dev

Open the URL generated in your console. Once you grant permission to the app, you can start to to test the function in your store.

Developer resources

About

No description, website, or topics provided.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published