<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>jquery Archives &#8212; Stampede: the strategic design &amp; technology company</title>
	<atom:link href="https://stampede-design.com/blog/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>https://stampede-design.com/blog/tag/jquery/</link>
	<description>We are creating better worlds though thoughtful design and technology. Connect with us!</description>
	<lastBuildDate>Tue, 07 Apr 2026 09:04:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.5</generator>

<image>
	<url>https://stampede-design.com/wp-content/uploads/2024/02/cropped-Stampede-Favicon-old-32x32.png</url>
	<title>jquery Archives &#8212; Stampede: the strategic design &amp; technology company</title>
	<link>https://stampede-design.com/blog/tag/jquery/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Add Product Sash/Ribbon in BigCommerce Using jQuery</title>
		<link>https://stampede-design.com/blog/add-product-sash-ribbon-in-bigcommerce-using-jquery/</link>
					<comments>https://stampede-design.com/blog/add-product-sash-ribbon-in-bigcommerce-using-jquery/#comments</comments>
		
		<dc:creator><![CDATA[Shaiful Borhan]]></dc:creator>
		<pubDate>Mon, 23 Sep 2013 16:48:03 +0000</pubDate>
				<category><![CDATA[Field Notes]]></category>
		<category><![CDATA[bigcommerce]]></category>
		<category><![CDATA[e-commerce]]></category>
		<category><![CDATA[front-end development]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[tutorial]]></category>
		<guid isPermaLink="false">https://stampede-design.com/blog/?p=4472</guid>

					<description><![CDATA[<p>Shaiful understands product sashes are a nice touch for e-commerce websites, hence he is here to show you how to have it done.</p>
<p>The post <a href="https://stampede-design.com/blog/add-product-sash-ribbon-in-bigcommerce-using-jquery/">Add Product Sash/Ribbon in BigCommerce Using jQuery</a> appeared first on <a href="https://stampede-design.com">Stampede: the strategic design &amp; technology company</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="lead">Product sashes like On Sale, Bestseller and Sold Out are certainly a nice touch for any e-commerce websites, aesthetically as well as providing a positive user experience.</p>
<div class="full"><img fetchpriority="high" decoding="async" width="655" height="259" src="https://stampede-design.com/wp-content/uploads/2013/06/28-6-2013-12-20-53-AM.jpg" alt="Sample of product sashes." class="size-full wp-image-4268" srcset="https://stampede-design.com/wp-content/uploads/2013/06/28-6-2013-12-20-53-AM.jpg 655w, https://stampede-design.com/wp-content/uploads/2013/06/28-6-2013-12-20-53-AM-300x119.jpg 300w" sizes="(max-width: 655px) 100vw, 655px" /><p class="capt_block">Sample of product sashes.</p></div>
<p>In BigCommerce, exclusive product sash features are not built-in but they can be added using some clever jQuery tricks. Specifically, we need to tell jQuery to read the page for certain &#8220;triggers&#8221; or &#8220;conditions&#8221; and show the appropriate sash based on them. The key to product sashes is they have to appear in product listing pages (like category, homepage, search result) and the product details page. This means the &#8220;triggers&#8221; have to be present in all these pages for jQuery to detect.</p>
<h2>On Sale Sash</h2>
<p>In the following example, I am going to show how to add the most common of all product sashes, On Sale. Firstly, we need to set the discounted price for the appropriate products. If this was done right, the products will show up in the shop with a strike-through line on their original retail price. This element will become the &#8220;trigger&#8221; for the On Sale sash. So we just have to tell jQuery, if this element exists, show the On Sale sash. Below are Javascript codes for the category and product details pages.</p>
<h4>Product Category Page</h4>
<pre class="brush: jscript; title: ; notranslate">
$(&quot;#CategoryContent .ProductList li .RetailPriceValue&quot;).each(function( index ) {
   $(this).parents('li').find('.ProductImage').append('&lt;img src=&quot;http://myshopurl.com/path_to_image/on-sale.png&quot; class=&quot;product-sash&quot; alt=&quot;On Sale&quot; /&gt;');
});
</pre>
<h4>Product Details Page</h4>
<pre class="brush: jscript; title: ; notranslate">
if($('.DetailRow.RetailPrice').is(':visible')) {
   $('.ProductThumbImage .zoomPad').append('&lt;img src=&quot;http://myshopurl.com/path_to_image/on-sale.png&quot; class=&quot;product-sash&quot; alt=&quot;On Sale&quot; /&gt;');
}
</pre>
<h2>Any Miscellaneous Sashes</h2>
<p>A slightly trickier scenario is to show product sashes like Bestseller and New, which we don&#8217;t really have a way to configure via the BC admin. Even though BC has product tags and custom fields, these data don&#8217;t show up in the product category pages. Fortunately, we have something else to use, the main image alternate text. In BC admin, it&#8217;s the Description box of the main product image. You need to enter a unique identifying keyword in the Description box and thanks to jQuery, reading the presence of this keyword is a breeze. This method will allow you to show any kinds of product sashes.</p>
<div class="full"><img decoding="async" width="754" height="420" src="https://stampede-design.com/wp-content/uploads/2013/09/bc_admin_image_desc.png" alt="Enter the keyword into the Description field of the main image." class="size-full wp-image-4490" srcset="https://stampede-design.com/wp-content/uploads/2013/09/bc_admin_image_desc.png 754w, https://stampede-design.com/wp-content/uploads/2013/09/bc_admin_image_desc-300x167.png 300w" sizes="(max-width: 754px) 100vw, 754px" /><p class="capt_block">Enter the keyword into the Description field of the main image.</p></div>
<p>For showing a Bestseller sash, enter the keyword <em>Bestseller</em>. I personally prefer to enter the actual product name followed by the keyword to keep the semantics right, like <em>5ft Christmas Tree &#8211; Bestseller</em>. Here&#8217;s the code for showing the Bestseller product sash.</p>
<h4>Product Category Page</h4>
<pre class="brush: jscript; title: ; notranslate">
$(&quot;#CategoryContent .ProductList li .ProductImage a img&#x5B;alt*='Bestseller']&quot;).each(function( index ) {
   $(this).parents('li').find('.ProductImage').append('&lt;img src=&quot;http://myshopurl.com/path_to_image/best-seller.png&quot; class=&quot;product-sash&quot; alt=&quot;Bestseller&quot; /&gt;');
});
</pre>
<h4>Product Details Page</h4>
<pre class="brush: jscript; title: ; notranslate">
if(ProductImageDescriptions&#x5B;0] &amp;&amp; ProductImageDescriptions&#x5B;0].indexOf(&quot;Bestseller&quot;) &gt;= 0) {
   $('.ProductThumbImage .zoomPad').append('&lt;img src=&quot;http://myshopurl.com/path_to_image/best-seller.png&quot; class=&quot;product-sash&quot; alt=&quot;Bestseller&quot; /&gt;');
}
</pre>
<p>The examples I provide here only contain the necessary jQuery code snippets to make the product sash works. It&#8217;s not really a step-by-step beginners tutorial. You would need CSS to style the product sash nicely. Don&#8217;t forget about the sash graphics too, they are transparent PNGs. I can also foresee that my codes are totally template-dependent. However, if you are familiar with jQuery selectors I am sure you will be able to understand the gist and tweak the codes accordingly to fit your templates. </p>
<p>Give it a try and post your feedback below!</p>
<p>The post <a href="https://stampede-design.com/blog/add-product-sash-ribbon-in-bigcommerce-using-jquery/">Add Product Sash/Ribbon in BigCommerce Using jQuery</a> appeared first on <a href="https://stampede-design.com">Stampede: the strategic design &amp; technology company</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://stampede-design.com/blog/add-product-sash-ribbon-in-bigcommerce-using-jquery/feed/</wfw:commentRss>
			<slash:comments>23</slash:comments>
		
		
			</item>
	</channel>
</rss>
