In my theme (bought from themeforest) Configurable swatches is integrated technically but not working functionaly. I can see the swatches in my Product page but when I click on them upon add to cart its showing error "Please select item". When I disable the Configurable swatches then traditional drop-down field is come up and its working.

So I wanted to know why configurable watches is not working? Googled a lot but no answer. Please guys help me in that.

This is the link : https://www.myshopingkart.com/clothing/men/haute-denim-navy-blue-main.html

Configurable Swatches

This the error when I click on the swathces..

Configurable Swatches-error

  • check if your select is inside of <form>
    – zhartaunik
    May 4, 2015 at 17:29
  • I didn't alter any code. So its definately inside the form. Disabling Magento's Native Configurable Swatch is making it work, but I want Config swatches to be worked. There must be a solution. Please help. May 5, 2015 at 13:20

3 Answers 3


You have problems with Javascript:

        re = 1;
        proId = $("#proId").val();
        curQty = $('#qty').val();
        minQty = $('#min_qty_stock').val();
        maxQty = $('#max_qty_stock').val();
        qtyStock = $('#qty_stock').val();
        qtyStock_1 = $('#qty_stock').val();
        if ( manage_stock == 0 ){
            qtyStock = maxQty + 1;
        if( minQty==''&&maxQty==''&&qtyStock=='' ){
            alert('Please, select item');
            return false;

When you try to test in console ()

        minQty = jQuery('#min_qty_stock').val();
        maxQty = jQuery('#max_qty_stock').val();
        qtyStock = jQuery('#qty_stock').val();

The 3 vars show empty "" Try to check when the elements #min_qty_stock, #max_qty_stock, #qty_stock is filled

<span class="quantity-box">

                    <input type="text" name="qty" id="qty" maxlength="12" value="1" title="Qty" class="quantity-input qty">                     
                    <input type="hidden" id="min_qty_stock" name="min_qty_stock" value="">                      
                    <input type="hidden" id="max_qty_stock" name="max_qty_stock" value="">
                    <input type="hidden" id="qty_stock" name="qty_stock" value="">
                    <input type="button" class="quantity-controls quantity-plus" onclick="$('qty').value=Number($('qty').value)+1" value="">    
                    <input type="button" class="quantity-controls quantity-minus" onclick="if(Number($('qty').value)>1){$('qty').value=Number($('qty').value)-1;}" value="">                    
  • But when I disable the Configurable Swatch, its working. And the script remains same as you have stated above. Then What changes should I make to get the Configurable Swatches working? May 5, 2015 at 11:58
  • Can you disable? I will check it
    – osrecio
    May 5, 2015 at 13:41
  • Sure. Wait a minute. Are u on Gtalk or Skype? Mine westzonesolution1@gmail.com / Skype: amitretail2008 May 5, 2015 at 13:51
  • The Config Swatch is disabled. May 5, 2015 at 13:52
  • Now when I make in console : minQty = jQuery('#min_qty_stock').val(); maxQty = jQuery('#max_qty_stock').val(); qtyStock = jQuery('#qty_stock').val(); it show me qty's. Check please my answer. "Try to check when the elements #min_qty_stock, #max_qty_stock, #qty_stock are filled"
    – osrecio
    May 5, 2015 at 13:56

Check for the javascript error from firebug ,if there isn't any javascript bug or you are unable to debug it. Simply what you can do is disable your current configurable swatches and Try this swatches extension - https://github.com/tzyganu/Switcher

  • I want to use Magento's own Configurable Swatches. So what error is there in my script. May 5, 2015 at 12:00

I had the same problem. I solved by adding the following javascript code (just before the comment // validated configurable):

// validate configurable swatches
    id = $(this).attr('id');
    id = id.replace("swatch","");
    value = $('#minQty_'+id).val();
    value = $('#maxQty_'+id).val();
    value = $('#qty_stock_'+id).val();
    manage_stock = $('#manage_stock_'+id).val();

in the following file:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.