1 / 3

Show color swatches on category pages in Bigcommerce

The swatch display type is used to show a color or texture for a product or one of its attributes. It’s commonly used for products that are available in different colors or materials. For example, you could use swatches to let your customers select from available patterns of fabric.

makkpress
Download Presentation

Show color swatches on category pages in Bigcommerce

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Show color swatches on category pages in Bigcommerce The swatch display type is used to show a color or texture for a product or one of its attributes. It‟s commonly used for products that are available in different colors or materials. For example, you could use swatches to let your customers select from available patterns of fabric. Setting Up the Option Go to Store Setup › Design, than click Edit HTML/CSS.

  2. Find Category.html, Copy below code and paste the code before </body> <script type=”text/javascript”> /* Ajax in Product Color Options */ $(„#frmCompare ul.ProductList > li‟).each(function(index, el) { var _this = $(el); var thisProductName = _this.find(„.ProductName‟); var thisProductURL = thisProductName.find(„> a‟).attr(„href‟); // AJAX to this product $.ajax({ url: thisProductURL, type: „GET‟, dataType: „html‟, async: false }) .done(function(data) { // find “color” swatches

  3. var thisSwatches = $(„.productAttributeRow‟, data) .filter(function() { return $(this).find(„.productAttributeLabel .name‟).text().trim() == “Color:”; }) .find(„.productAttributeValue .previewContent span.swatchColour‟); // Append swatches if (thisSwatches.length > 0) { thisSwatches.wrapAll(„<div class=”colorGrid”></div>‟).parent().appendTo(thisProductName); } // end if }); // end ajax done }); // end each </script> Save the changes and its Done. Color swatches on category pages in Bigcommerce

More Related