ShapeDiver Help Center

Shopify - Theme Setup - Advanced

The ShapeDiver App for Shopify allows you to sell truly bespoke products, having limitless variations. To that end, the app includes a so-called cart transform function that can replace the price, title, and image of line items at the moment they are being added to the cart. Some parts of this feature require a Shopify Plus subscription. Depending on your shop’s theme, it may also be necessary to edit the theme’s liquid code to display the custom title and image.

The following table provides an overview.

Line item property

Shopify Plus

The cart transform function uses a lineUpdate operation.

Other subscription

The cart transform function uses a lineExpand operation. This creates a bundle consisting of a single item.

Price

No changes are necessary to the theme. The price is set directly for the line item.

No changes are necessary to the theme. The price is set for the bundle.

Title

A custom title is set directly for the line item, if your Add To Cart action specifies a title.

If you do not specify a title, a default title will be used for the updated line item, which includes the product title and the line item’s model state ID.

Example: Product name (Ntc06FJi9W5Hxc12)

A custom title is set for the bundle, if your Add To Cart action specifies a title.

If you do not specify a title, a default title will be used for the bundle, which includes the product title and the line item’s model state ID.

Example: Product name (Ntc06FJi9W5Hxc12)

Image

A custom image is set directly for the line item, if your Add To Cart action specifies an image.

Custom images are uploaded to Shopify’s CDN, and will be visible in your store’s admin panel (Content → Files). The naming scheme of these images follows this pattern: shapediver-line-item-{MODEL_STATE_ID}

Please note that the image upload and processing by Shopify might take a few seconds, and therefore prolongs the time it takes to add a custom item to the cart.

No custom image can be set for the bundle.

If your Add To Cart action specifies an image, it will be ignored.

The custom title and image are shown in various places, including the cart, checkout, and order notification emails. Please see Shopify’s docs for details.

Depending on your theme, it may still be necessary to adapt the theme’s liquid code to display the custom title and image. See the further sections of this help page for details.


Updating the theme to render custom line item titles

Your theme’s liquid code for rendering the cart might render the product’s default title, regardless of whether a custom title has been set for the line item. If this is the case, you need to edit the code of your theme: https://help.shopify.com/en/manual/online-store/themes/customizing-themes/edit-code/edit-theme-code

These are the required steps:

  1. Locate the code that renders the cart line items.

    1. For the Horizon theme, this can be found in snippetscard-products.liquid

    2. For the Dawn theme, this can be found in sectionsmain-cart-items.liquid

  2. Search for occurrences of item.product.title, and replace them with item.title wherever you want the custom title to be rendered.

image-20260730-190443.png
Example of updating the line item title rendering for the Horizon theme - replace item.product.title with item.title
image-20260730-191056.png
Example of updating the line item title rendering for the Dawn theme - replace item.product.title with item.title


Updating the theme to render custom line item images

This change to the theme is a little more intricate, since for some inexplicable reason Shopify does not expose the custom image URL on the cart line item’s properties when rendering the cart. This is documented here: This image is visible in checkout only and is not persisted to orders.

Luckily the ShapeDiver App for Shopify stores the custom image URL in a hidden custom line item property called _imageUrl. This can be be used to adapt the theme code and render the custom image in the cart.

The following example shows how to do this for the Horizon theme.


Step 1 - get custom image URL

The following block of liquid code extracts the custom image URL from the current line item. Place this block inside the loop that renders the line items.

{% doc %}
  Check whether the line item has a hidden property called '_imageUrl'.
  If so, store its value in shapediver_image_url and use it 
  instead of item.image (see below).
{% enddoc %}
{%- liquid
  assign shapediver_image_url = ''
  for property in item.properties
    if property.first == '_imageUrl'
      assign shapediver_image_url = property.last
      break
    endif
  endfor
-%}  
image-20260730-213243.png
Inserting the block of liquid code that extracts the custom image URL (Horizon theme)


Step 2 - render custom image

Use the following block of liquid code to optionally render the custom image (if one exists), otherwise fall back to the default product image.

{% doc %}
  If the line item has a custom image, render it instead of item.image. 
  Note: 
    item.image returns the product's default image, even if a custom 
    image has been set using ShapeDiver's cart transform function.
    This is documented here: 
    https://shopify.dev/docs/api/functions/2026-01/cart-transform#CartTransformRunResult.fields.operations.lineUpdate.image
{% enddoc %}
{% if shapediver_image_url != blank -%}
  <img
    src="{%- echo shapediver_image_url | append: '&width=250' -%}"
    width="250"
    height="250"
    class="cart-items__media-image border-style"
  />
{%- else -%}
  {%- liquid
    echo item.image | image_url: width: 250 | image_tag: class: 'cart-items__media-image border-style', style: border_override
  -%}
{%- endif %}

We use it to replace the following code block:

{%- liquid
  echo item.image | image_url: width: 250 | image_tag: class: 'cart-items__media-image border-style', style: border_override
-%}
image-20260730-214141.png
Inserting the block of liquid code that renders the custom image (Horizon theme)


As the Horizon theme gets updated, the block for rendering the custom image might need to be changed.

If your store uses another theme, use the example code to apply the same principle to it.

As a paying customer, you can book onboarding calls here: Community and Support