POS custom cart attributes

adotshop
New Member
2 0 0

I'm looking for a way to carry the attributes that ive added onto the checkout page online, to the POS system. Someone suggested a new POS app. Is there an easier way to do this? And if not, how would I go around creating the new POS app?

Thanks,

Asia

0 Likes
Greg_Kujawa
Shopify Partner
951 79 203

This is definitely possible. Here's an overview --> https://shopify.dev/tools/app-bridge

In our case I have a POS app that stores cart line item custom properties. In a nutshell, on my landing I reference the https://cdn.shopify.com/s/assets/external/pos_app.js source, and initialize the ShopifyPOS instance via:

ShopifyPOS.init({
      apiKey: {my-apps-api-key},
      shopOrigin: 'https://{my-shop}.myshopify.com'
    });

From there I can work with Edit Cart functionality by fetching it, iterating through the line items, adding properties, like this:

 

ShopifyPOS.fetchCart({
	success: function(cart) {
		if(!cart.line_items) {
		// There are no line items in the cart.
		}
		else
		{
			// There are line items in the cart, so you can add properties.
			for (var i in cart.line_items) {
				cart.addLineItemProperties(i.index, "Property Goes Here");
			}
		}
	}
});

 Hope this helps some!

adotshop
New Member
2 0 0

Thank you!I will try this out

0 Likes