Jump to content

Need a hook for changing a div class


Recommended Posts

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. 

Link to comment
Share on other sites

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;
        }
    }
});

 

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated