How to get the URL to a configurable item in Magento?

How to get the URL to a configurable item in Magento?

August 9, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How to get the URL to a configurable item in Magento?

Linking to Configurable Products in Magento

Magento provides extensive functionality for managing configurable products, allowing you to offer multiple variants of a single product. This includes size options for bedding, color choices for apparel, or processor speed selections for electronics. However, linking directly to these specific configurations can be a bit tricky.

Understanding the Super Attribute Problem

Let’s break down your scenario step by step. You have created a configurable product called “Bedding Sheets” with an attribute called “Size”. This attribute has four options:

  1. 200*200cm
  2. 200*230cm
  3. 200*250cm
  4. 250*250cm

The unique identifier for this attribute is attribute496. When you view the product page, Magento generates a dropdown to select the size:

<select class="required-entry super-attribute-select" id="attribute496" name="super_attribute[496]">
  <option value="">Choose option...</option>
  <option value="4">200*200cm</option>
  <option value="3">200*230cm</option>
  <option value="2">200*250cm</option>
  <option value="1">250*250cm</option>
</select>

Your initial attempt at creating a link to the 250*250cm option looks like this:

https://mystore.com/bedding-sheets?attribute496=1

However, this does not work because Magento doesn’t recognize query parameters for configurable options in the URL.

Solving the Linking Issue

The key to linking directly to a specific configuration lies in using the catalog_product_view route. This requires you to know the unique identifier of the associated simple product.

Here’s how you can construct the URL:

  1. Identify the SKU or ID of the simple product that corresponds to your desired option (e.g., the 250*250cm sheet).

  2. Use the following format for the URL:

https://mystore.com/catalog/product/view/id/<simple_product_id>/s/<product_sku>

Replace <simple_product_id> with the ID of the simple product and <product_sku> with its SKU.

For example, if your 250*250cm sheet has an ID of 1378:

https://mystore.com/catalog/product/view/id/1378/s/sheet-2

This URL will direct the user to the specific product, giving them a preview before adding it to their cart.

Previewing Before Adding to Cart

You mentioned that you want users to preview the item before it’s added to their cart. To achieve this:

  1. Create a custom link in your frontend theme or use an extension like Amasty Magento 2 Configurable Swatches to display product variations.

  2. Use the catalog_product_view URL format mentioned above.

  3. Style your custom link according to your store’s design requirements for a seamless user experience.

Conclusion

Linking to specific configurations in Magento requires understanding how configurable products and their associated simple products work together. By identifying the unique identifiers of the simple products and using the catalog_product_view route, you can create direct links that allow users to preview and select their desired options easily.

Catalog Database Performance Configuration

Our network