Dynamic CTA button with meta fields does not work in custom store set-up

Topic summary

A developer is building a cross-store Shopify setup where products on Store A need to checkout on Store B using cart permalinks. The implementation involves:

Technical Approach:

  • Store A displays products with variant selection
  • Variant meta fields in Store A contain corresponding variant IDs from Store B
  • JavaScript dynamically generates checkout URLs by pulling the correct variant ID from meta fields
  • Cart permalink format: https://www.shopB.com/cart/:variant-id:1

Current Issue:

  • After implementing the code, the CTA button is not clickable
  • The developer has included Liquid markup for the product variant picker and JavaScript within the section
  • Code snippets appear corrupted/reversed in the post, making detailed troubleshooting difficult

Status: The question remains unanswered with the developer seeking hints on what might be causing the button to be non-functional.

Summarized with AI on November 8. AI used: claude-sonnet-4-5-20250929.

Hello everyone, I am trying to construct a page on my Shopify instance A where I have a custom product section with two variants and I want to add a dynamic CTA button that generates a check-out on a second Shopify instance B (it’s a very specific set-up). For this, I am using cart permalinks and variant meta fields in my Shopify instance A where I store the right variant id from my Shopify instance B.

I am trying to implement it with a javascript that checks the variant selection, pulls the right variant id from the meta field and generates the href url accordingly ("https://www.shopB.com/cart/'" + “variant-id:1”)

After making all edits, the CTA button is not clickable. Any hints why could go wrong? See the code below.

JS within section liquid:


product-variant-picker liquid:

{%- unless product.has_only_default_variant -%}
  {%- if block.settings.picker_type == 'button' -%}
    
  {%- else -%}
    
  {%- endif -%}
{%- endunless -%}