We sacrifice by not doing any other technology, so that you get the best of Magento.

We sacrifice by not doing any other technology, so that you get the best of Magento.

    Default Magento does not show associate product’s id of a configurable product on the product detail page When change options of a configurable product.

    If, you want to show associate id then see below code

    Override this file into your theme : vendor/magento/module-catalog/view/frontend/templates/product/view/attribute.phtml

    And, paste below script in last of this page

    <script type="text/javascript">
        
        require(["jquery"], function(jQuery) {
            
            jQuery(".product-options-wrapper select[id^='attribute']").last().on('change', function() {
                
                setTimeout(function (){
                    
                    simpleId=jQuery("input[name=selected_configurable_option]").val();
                    
                    jQuery(".value").html(simpleId);       // Place your place id or class in place of ".value"
    
                }, 500); 
    
            });
    
        }); 
    
    </script>

     

    field_5bfb909c5ccae

      Get a Free Quote