Safir Hosting Posted April 18, 2021 Share Posted April 18, 2021 Hello All, I need a hook for changing a div class from col-sm-6 to col-sm-12 for Configurable Options Group on Cart. When i inspect the element it's in cart.php > secondary-cart-body > product-configurable-options i tried to explain a bit below. Any help appreciated. 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted April 19, 2021 Share Posted April 19, 2021 Using the hook in and just adding in $('#inputOptionXX').parent().parent().attr('class', 'col-sm-12'); to the html string should do the trick. You just need to get the input field name for that option. However, do note that you will probably have to adjust the other input also as otherwise you will get a blank area there. 0 Quote Link to comment Share on other sites More sharing options...
Safir Hosting Posted April 20, 2021 Author Share Posted April 20, 2021 Hello, below did the trick by product, because some products configOptions are different from others. Only thing you can select more than one products inserting product id into array in $products like 3,5,10 that has same inputConfigOption value. Appreciate for your help <?php add_hook('ClientAreaFooterOutput', 1, function ($vars) { // Add the product ID to the array below with commas separting them. For example: array(1,4,5) $Products = array(); if (isset($vars['templatefile']) and $vars['templatefile']==='configureproduct') { if (isset($vars['productinfo'] ) and in_array($vars['productinfo']['pid'], $Products)) { $HTML = "<script> $( document ).ready(function() { $('#inputConfigOption19').parent().parent().attr('class', 'col-sm-12'); }); </script>"; return $HTML; } } }); 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted April 21, 2021 Share Posted April 21, 2021 1 hour ago, Safir Hosting said: Hello, below did the trick by product, because some products configOptions are different from others. Only thing you can select more than one products inserting product id into array in $products like 3,5,10 that has same inputConfigOption value. Appreciate for your help If you want that to apply to any product that has that config option, just remove the if that checks for product. The id for that config option will be the same for any other product. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.