If you are using our Bundle builder or Inventory management mode, and some of your Shopify products should only be added to cart as a part of a bundle, you may want to redirect customers from the product pages of such products to a customizable one and prevent the possibility of adding them to cart separately.
To achieve this, please, follow the steps below:
1. Create a Shopify metafield
Go to the Shopify settings > Custom data > Products
Then, click "Add definition" and fill out the form as shown in the screenshot below:
2. Apply the metafield to your products
On the product edit page, you will see the field where you can add a main customizable product. Please repeat this action for all the products which a customer should be redirected from.
3. Edit Product Page layout
In the code of your theme find a file 'main-product.liquid' and add the following code right at the top of it:
{% comment %} Redirect, if cpb product is connected {% endcomment %}
{% if product.metafields.custom.sku_container_product %}
<script>
window.location.href = "{{ product.metafields.custom.sku_container_product.value.url }}"
</script>
{% endif %}
*Please note that the file (main-product.liquid) may have different names, depending on the theme version you use.
Now, if customers go to those product pages, they will be automatically redirected to the product you selected in the metafield.
Note: In some cases the steps above are not enough to prevent adding products to cart. Your theme may have "quick-buy buttons" or something similar. If there are some issues with setting this up, please, contact our support.
Comments
0 comments
Please sign in to leave a comment.