Loading...

How to hide shipping methods in your BigCommerce template

Daniel C. Published on 21 September, 2011

There are times when you need to hide shipping methods from your clients and this is especially true when when running a free shipping promotion.BigCommerce does not support hiding shipping methods so the next best thing is to hide them yourself by modifying the BigCommerce templates using some Jquery.

Place the following code into footer.html template file and this will hide any other shipping method (when estimating shipping cost on the cart page) if the Free Shipping method is available.


<script type="text/javascript">//<![CDATA[
$(document).ready(function() {

$('.ShippingMethodList').ajaxSuccess(function(e, xhr, settings) {

if($('.ShippingMethodList').text().search("Free")>=0) {

$('.ShippingMethodList table tbody tr').each(function(){ if($(this).text().search('Free') < 0)

{ $(this).hide(); } });} }); if($('.ShippingProviderList').text().search("Free")>=0)

{ $('.ShippingProviderList li').each(function(){ if($(this).text().search("Free")<0)

{ $(this).hide(); } });} }); //]]></script>


If you are using single page checkout, please use this script:


<script type="text/javascript">//<![CDATA[
$(document).ready(function() {

$('.ShippingMethodList').ajaxSuccess(function(e, xhr, settings) {

if($('.ShippingMethodList').text().search("Free")>=0) {

$('.ShippingMethodList table tbody tr').each(function(){ if($(this).text().search('Free') < 0)

{ $(this).hide(); } });} }); $('.ExpressCheckoutContent').ajaxSuccess(function(e, xhr, settings) {

if($('.ShippingProviderList').text().search("Free")>=0) {

$('.ShippingProviderList li').each(function(){ if($(this).text().search("Free")<0)

{ $(this).hide(); } });} }); });

//]]></script>

You can use this script to hide other shipping methods as well. If you need help with that just post a comment below or contact us via email.

Daniel C. Published on 21 September, 2011