For the complete documentation index, see llms.txt. This page is also available as Markdown.
Shopify Installation
This guide covers the installation of Pixfizz to your Shopify store.
To make changes you will need to go to the "Online Store" and on your current theme, Edit Code. If you need to update your theme you will need to re-add these code changes.
Setup Product and Variant Metafields
In Shopify, go to Settings - Custom Data and create the following Product Metafields ensuring content type matches.
Product Metafields
Metafield Definitions
Create each of the following product metafield definitions in your Shopify admin under Settings > Custom data > Product. Each pasteable value has a copy button. Type is a dropdown selection in Shopify, so select it rather than pasting it.
Pixfizz Integration Type
Name
Namespace and key
Type: Single Line Text
Description
Regular expression
Pixfizz product SKU
Name
Namespace and key
Type: Single Line Text
Description
Pixfizz extra page addon
Name
Namespace and key
Type: Product Variant
Description
Pixfizz option addons
Name
Namespace and key
Type: Product
Description
Pixfizz option type code
Name
Namespace and key
Type: Single Line Text
Description
Adjust Cart QTY
Name
Namespace and key
Type: True or False
Description
SEO Hidden
Name
Namespace and key
Type: Integer
Description
Pixfizz Photo Prints Collection Path
Name
Namespace and key
Type: Single Line Text
Description
Pixfizz Static Product Code
Name
Namespace and key
Type: Single Line Text
Description
Now create the following Variant Metafields ensuring content type matches.
Variant Metafields
Metafield Definitions
Create each of the following metafield definitions in your Shopify admin. Each pasteable value has a copy button. Type is a dropdown selection in Shopify, so select it rather than pasting it.
Pixfizz product SKU
Name
Namespace and key
Type: Single Line Text
Description
Pixfizz extra page addon
Name
Namespace and key
Type: Product Variant
Description
Pixfizz option value code
Name
Namespace and key
Type: Single Line Text
Description
Pixfizz option addons
Name
Namespace and key
Type: Product
Description
Pixfizz Static Product Code
Name
Namespace and key
Type: Single Line Text
Description
Adding elements to you shopify code. Go to your theme and edit code:
The below is for medium to advanced technical users. If you are not confident to setup the below code in your Shopify admin, Pixfizz can support the implementation. Please contact support@pixfizz.com to request help.
Reference main integration snippet in Layout
Theme: Insert this line into your theme’s layout (typically called theme.liquid), just before the closing </head> tag:
Create Snippets
Create a new snippet called pixfizz-setup.liquid. Copy the following contents into it:
Replace design.myshop.com at the top of the snippet with the hostname of your pixfizz site. You must use a custom hostname (not the default something.pixfizz.com) that is a subdomain of your Shopify shop’s domain. An example would be create.myprintshop.com
Replace 123456 in line 2 of the snippet with the shared secret which you can find in your Pixfizz website's super admin panel under the API Settings.
pixfizz-launch-product-handler
pixfizz-orderline-preview-handler
pixfizz-edit-orderline-handler
pixfizz-orderline-quantity-handler
The code in this snippet may have to be adjusted if you are using a theme other than Dawn.
Create New Product Page Template
There are 2 options to add enable a "Customize" button to appear. The first one is the simplest and easiest. An alternative method may be more relevant when not using Dawn Theme or where the site needs to have additional functionality -> Disabling the customize button when there is zero stock.
On the product page for Pixfizz products, we’ll have to replace the buy buttons with a “Personalize” button. The cleanest way to do that is to create a dedicated product template for Pixfizz products.
This is for Shopify 2.0 compatible themes only. Older themes must go into the theme code and create a new Template from there.
Go to the theme editor in Shopify, and on the template selector dropdown, select “Products → Create template”.
The template should be based on your default product template. Name it “Pixfizz Product”.
Now select the block with the buy button(s) and remove it. We will add a “Custom liquid” block in its place.
Paste the following code into the liquid input field (Note you can change the word "Personalize" to any text you wish):
Another example:
Update Cart Page
Dawn Theme: main-cart-items section
After backing up your code please overwrite the main-cart-items.liquid with the following:
Dawn Version 14.0.0
Dawn Version 13.0.1
Dawn Version 11.0.0
Other Themes:
If you want to allow users to edit projects from the cart and/or show dynamic project previews instead of static product images, you will need to make some modifications to your cart page.
Order Edit
Locate the template that’s responsible for rendering the items in your cart page. If using the Dawn theme, you can find the code in the the main-cart-items.liquid section.
Locate the part of the template that loops through the items in the cart and renders line items. Decide where you want to put the edit link and add an edit link or button with an onclick handler that renders the snippet above, taking the line item object as a parameter. Example:
Note that we wrap the link in an if item.properties._pixfizz_project_id so that the link doesn’t get rendered for any non-pixfizz products in the cart. Instead of an <a> element you could use a <button> or whatever else looks good in your theme. The only important part is the onclick handler.
Orderline Image
Locate the part of the template that displays the image for each item in the cart. Place the following code right after the <img> element that renders the preview. It is safe to include this even for non-pixfizz products, since the code will not do anything if the line item doesn’t have an associated pixfizz project id:
You can replace 300 with your desired value for width . You can also use height instead (or in addition to) width.
Cut Prints
Pixfizz cut print mode is supported in Shopify, but quantities with cut prints work differently from other products.
The cut print product in Shopify should be set up with a price for a single print. The pixfizz integration will automatically set the orderline quantity to the total number of prints in the project when the user adds the prints to the cart.
That means that you will have to modify your Shopify template code to disable any quantity controls controls in Shopify (the quantity selection on the product page, orderline quantity selector on the cart page, …) in Shopify for cut print products.
There are several ways to do that and the location of the templates that need to be modified depends on the Shopify theme that you’re using. In our demo Shopify store, we set the “Product Type” field on cut print products to “Photo Prints” and we toggle the quantity selector in liquid templates based on that value. In the main-product.liquid template we wrapped the section under <div data-gb-custom-block data-tag="-" data-0='``quantity-selector'></div> into <div data-gb-custom-block data-tag="-" data-0='``Photo Prints``' data-1='``Photo Prints``'></div> ... <div data-gb-custom-block data-tag="-"></div> and on the main-cart-items.liquid template we located the <quantity-input> element and added it into and if/else block like this:
Setup Fulfillment Webhook
Whenever an order is placed on shopify (payment success) then that order need to be updated on Pixfizz.
First you need to create a Shopify webhook.
Go to ‘Settings > Notifications’ and scroll down to ‘create webhook’ button and click on it to create new webhook.
After clicking on create webhook, you will get a popup similar to the above image. Add the webhook detail and save. ‘Event’ select ‘Order payment’ ‘Format’ select ‘JSON’ ‘URL’ add an order endpoint as shown above screenshot, except use your Pixfizz store url.
Select ‘Webhook API version’ use ‘2022-04 (Latest)’ or use the (Latest webook)
Copy the webhook signed id (shown under the callback URL once you have created in the website superadmin shopify signing secret (see websites).
Storefront's Superadmin panel to copy & paste from Shopify.
Once above configuration is done then you can place a successful order and mark that as paid in shopify. In the Pixfizz admin order section the order status will be changed to “Confirmed” status.
To enable Fulfilled orders to be marked automatically in pixfizz (with a status of "Shipped") then add a webhook as per order webhook above but using the event in Shopify "Fulfiliment Creation"
Orders marked as Fullfilled in Shopify will be marked as shipped in Pixfizz