# Test the Price of Multiple Products With a Theme Test

{% hint style="danger" %}
If your store meets the criteria specified on [this page](https://docs.shoplift.ai/test/price-testing/overview), we recommend testing prices in Shoplift with [Price tests](https://docs.shoplift.ai/test/price-testing/create-a-price-test). However, if your store does not meet the criteria, we recommend trying to test prices with duplicate products.

Setting up duplicate product tests can be **very technical**, requiring thorough QA and monitoring to ensure tests are set up correctly. Therefore, we suggest working closely with a team of developers or upgrading to our [Pro plan](https://www.shoplift.ai/pricing) before launching a test with duplicate products.

It's important to note that price tests are inherently high-risk tests. While we provide a few approaches to conduct these tests, it is your responsibility to QA these tests and methods prior to exposing a wider audience, to confirm that the user experience and level of risk is acceptable.
{% endhint %}

{% hint style="danger" %}
Price testing is subject to regional regulations. These legal frameworks may vary significantly across jurisdictions, covering areas such as consumer protection, fair pricing practices, competition laws, and disclosure requirements. It is your responsibility to ensure that price testing methods comply with local legislation, including any restrictions on price manipulation, discriminatory pricing, or deceptive practices.
{% endhint %}

### Test prices on multiple products with a theme test

If you want to test the prices of multiple products, you can leverage a theme test to route traffic between two different themes that point to different catalogues of products, each with their own set of prices.

<details>

<summary>Step 1: Identify the products you want to test, and create duplicate products in Shopify</summary>

1. Within Shopify, click **Products** and navigate to each product you want to price test.
2. Click on the Duplicate button at the top right corner.
3. In the duplication dialog:
   * Ensure you have all of the boxes checked to duplicate media, SKUs, inventory quantities, and translations.
   * Ensure you do not retain the autogenerated “(Copy)” text in the product title.
   * Ensure you are setting the duplicated product as a draft until you are ready to publish your test.

</details>

<details>

<summary>Step 2: Adjust the price and inventory settings of the duplicated products</summary>

1. Navigate to your newly duplicated products and open the product details.
2. Scroll to the **Pricing** section and set the new price.
3. Under **Inventory**, decide how you want to track inventory. If you want both products to share inventory, consider using an app like [Connected Inventory](https://apps.shopify.com/connected-inventory) or [Duplicate SKU Sync Master](https://apps.shopify.com/duplicate-sku-sync).
4. Click **Save** to apply your changes.

</details>

<details>

<summary>Step 3: Set product tags on your original and duplicate set of products</summary>

Next, you will need to set tags on your original and duplicate products so that you can exclude them from your A theme or B theme.

1. Navigate to each product and open the product details.
2. Tag all of your original products with a unique tag, like **price-test-a.**
3. Tag all of your duplicated products with a different unique tag, like **price-test-b.**

</details>

<details>

<summary>Step 4: Create a duplicate of each collection on your store, and swap out the original products for the duplicated versions</summary>

Now you'll need to create copies of each collection on your store for your B theme to use, which will contain your duplicated products only.

1. Within Shopify, click **Products** and then click **Collections**.
2. Click **Create** **collection** in the top right corner to create a new collection for each existing collection on your store.
3. For each collection you create, name your collection and ensure the **Collection type** is set to **Manual**.
4. In the **Products** section, **Browse** and select your duplicate set of products to add them to the collection.
5. If any products contained in the original collection are not being included in the price test, you can continue to include those in the duplicate collection.
6. **Save** your collection.
7. You can give your duplicate collection the same name as your original collection, but make note of the URL assigned to the duplicate, as it will not be the same as your original collection. To do this, scroll down to **Search engine listing** and click the pencil icon to edit the **URL handle.**

</details>

<details>

<summary>Step 5: Exclude your original and test products from other collections on your store</summary>

Now that you have your original and variant collections (and their corresponding original and variant products and prices), you'll need to verify that these products are only included in the correct collections on your store.

1. Click into each product that will be included in your test (both original and duplicate products).
2. In the **Product organization** section, check the collections that each product is associated with and remove them as necessary.
3. For automated collections, ensure your original and duplicate products do not meet the collection conditions by leveraging product tags. Using the tags you created above, modify your automated collections’ conditions to exclude products with the **price-test-a** or **price-test-b** tags.

</details>

<details>

<summary>Step 6: Exclude your duplicate products and collections from third-party sales channels </summary>

1. From the **Products** view in Shopify, select each duplicate product using the checkboxes in the list of products.
2. When you've selected all of your duplicate products, select **Actions** (the button with the three horizontal dots) at the top right of the products list.
3. Select **Include in sales channels** in the dropdown menu. Deselect all sales channels except for **Online Store**.
4. Then do the same for your duplicate collections. From the **Collections** view in Shopify, select your duplicate collections using the checkbox in the list of collections.
5. Select **Actions** (the button with the three horizontal dots) at the top right of the collections list, and select **Include in sales channels** in the dropdown menu. Deselect all sales channels except for **Online Store**.

</details>

<details>

<summary>Step 7: Create a copy of your main theme</summary>

1. In **Shopify**, click **Online Store** from the left sidebar navigation (under Sales Channels).
2. Click the **Actions** button (next to **Customize)** for your main theme, and click **Duplicate** from the dropdown menu.
3. Give your duplicated theme a name that corresponds to the test, like **Price Test Theme B.**

</details>

<details>

<summary>Step 8: Modify your A and B theme code to exclude tagged products from Search templates</summary>

**Important:** It is strongly recommended that you consult a developer prior to making changes to your theme code. If you do not have access to a developer, then ensure you back up your theme by creating a duplicate.

1. Next you'll need to add some code to ensure your original and duplicate products are completely hidden from all search templates on each theme.
2. Go to **Online Store** and click **Themes.**
3. Under **Templates**, locate and click on **search.liquid** or **search.json** (depending on your theme).

   * If you have a liquid template, you can add the below code directly in that template.
   * If you have a JSON template, you'll need to find the main collection section in your **Sections** directory. This will be referenced in your **search.json** template and will be called something like **main-search.liquid.**
   * Look for the code that loops through search results. This typically looks like:

   ```
   {% for item in search.results %}
     <!-- Code to display each item -->
   {% endfor %}
   ```
4. Now modify the search loop by adding a condition to exclude products with the **price-test-a** or **price-test-b** tags:

```
{% for item in search.results %}
  {% unless 'price-test-a' in item.tags %}
    <!-- Existing code to display the product -->
  {% endunless %}
{% endfor %}
```

5. Click the Save button at the top right of the editor to apply your changes.
6. Do the same for both themes.

</details>

<details>

<summary>Step 9: Prevent your duplicate products from being indexed by search engines</summary>

1. Using the **price-test-b** tag you created in the previous step, you'll now need to ensure that search engines will avoid indexing any product with this tag by adding some theme code.
2. Navigate to **Online Store** and click **Themes**. Find your active theme and click **Edit code.**
3. In the **Code Editor**, find your **theme.liquid** file and add the following code within the `<head>` section:

   ```
   {% if 'price-test-b' in product.tags %}
     <meta name="robots" content="noindex">
   {% endif %}
   ```
4. Hit **Save** to apply your changes.

</details>

<details>

<summary>Step 10: Prevent direct access to your original and duplicate collections via navigation menus on the appropriate themes</summary>

1. Go to **Online Store** and click **Navigation.**
2. Check all your menus to ensure there are no links to the duplicate collection.
3. If there are, remove any links that point to the duplicate collection.
4. Then, create a second version of your navigation menu that only links to your duplicate collections, and does not link to your original collections (you will use this on your B theme).
5. **Customize** your B theme, and change out the main navigation for your newly created navigation menu.

</details>

<details>

<summary>Step 11 (optional): Hide the duplicate products from third-party search apps</summary>

If you leverage third-party search apps, ensure that they are set to exclude products with the tag **hidden** from search results.

</details>

<details>

<summary>Step 12 (optional): Add the duplicate products to custom shipping profiles</summary>

If you use custom shipping profiles for your original products, you'll need to add your duplicate products to the shipping profiles you've set up for your originals.

1. From within Shopify, click **Settings** and then **Shipping and delivery.**
2. Find your relevant shipping profiles in the list, and click **Manage rates**. Then click **Manage products**.
3. You can easily search for products with the **hidden** tag. Select these products, and then click **Done.**
4. Click **Save** to save your selections.

</details>

<details>

<summary>Step 13 (optional): Add the duplicate products to discount codes</summary>

If you have discounts configured for your original products, you'll need to make sure your duplicate products are included in the discount.

1. From within Shopify, click **Discounts**.
2. Locate your active discounts, and modify the products they apply to to include your duplicate products.

</details>

<details>

<summary>Step 12: Set up URL redirects on your B theme to redirect any visitors from original products to the duplicate products</summary>

**Important:** It is strongly recommended that you consult a developer prior to making changes to your theme code. If you do not have access to a developer, then ensure you back up your theme by creating a duplicate.

Despite the actions taken above, there may still be a chance that visitors allocated to your B theme end up on product pages (and prices) for the A side of your test. To handle this, we'll need to add redirect code to your B theme to handle each product being tested.

1. Go to **Online Store** and click **Themes.**
2. Locate your B theme and click **Edit code**.
3. Under **Layout**, locate and click on **theme.liquid.**
4. Now add redirect code for each original price product page to send to the variant price product page in the `<head>` of your theme.

```liquid
<script>
if (window.location.href.includes('products/page_path-1')) {
    window.location.pathname = '/products/variant_page_path-1';
}
if (window.location.href.includes('products/page_path-2')) {
    window.location.pathname = '/products/variant_page_path-2';
}
</script>
```

5. Click the **Save** button at the top right of the editor to apply your changes.

</details>

<details>

<summary>Step 13: Set up a theme test in Shoplift between your A theme and B theme</summary>

1. Within Shoplift, create a new test by clicking **Create a test.**
2. Select **Test a theme or a global element** when drafting your test.
3. A drawer will open, wherein you can specify the original theme for your test. Select your main (published) theme.
4. When selecting your variant theme, choose your **B theme (the one titled accordingly for the price test).**
5. (Optional) Specify your visitor, device, and audience configurations for your test.[<br>](https://docs.shoplift.ai/~/changes/zAZxOVxxwnvg7SGVDOOk/test/price-testing/test-the-price-of-a-single-product)

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.shoplift.ai/learn/guides/price-tests-with-duplicate-products/test-the-price-of-multiple-products-with-a-theme-test.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
