I have created a metaobject for the color swatch, which contains the following fields: 1. Color Name, 2. Color Hex Code, 3. Product (for linking to the swatch). I have populated all the details, and everything seems to be set up correctly. I have successfully connected the namespace and key of the metafield. However, I’m facing an issue with the product URL: instead of showing the product handle, it displays the product variant ID. How can I fix this?
Here’s the code of mine for your reference it might be issue in my code please check once.
{% if product.metafields.custom.color_swatches != blank %}