Custom javascript in child theme,where to add?

Pending
REHub - Price Comparison, Affiliate Marketing, Multi Vendor Store, Community Theme REHub - Price Comparison, Affiliate Marketing, Multi Vendor Store, Community Theme November 20, 2019
Login to reply
Igor Sunz Support Agent
4 years ago

Looks correct

tech zotezo
4 years ago

Hi,

>> Must be wrapped with

<script>

jQuery(document).ready(function () {

    if(jQuery(".ewd-urp-review-form")[0]){

        if(jQuery(".woocommerce-breadcrumb").children('a').eq(1).text() == "Sports, Fitness & Outdoor"){

            jQuery("input[name='Taste']").parent().hide();

            jQuery("input[name='Quality']").parent().hide();

            jQuery("input[name='Effectiveness']").parent().hide();

        }

        else if(jQuery(".woocommerce-breadcrumb").children('a').eq(1).text() == "Diet & Nutrition"){

            jQuery("input[name='Comfort']").parent().hide();

            jQuery("input[name='Sole Quality']").parent().hide();

            jQuery("input[name='Fitting']").parent().hide();

        }

    }

});

</script>

Igor Sunz Support Agent
4 years ago

Theme option - general - footer Js

Must be wrapped with



ср, 20 нояб. 2019 г., 14:13 Sizam Support Help Desk <
sizamtheme+KOzQ1Gd4EzZvjaB3lnZb@mail.support-hub.io>:

tech zotezo
4 years ago

Hello,

Please guide me where to add?

You could use the following Custom jQuery snippet to solve this issue:

jQuery(document).ready(function () {

    if(jQuery(".ewd-urp-review-form")[0]){

        if(jQuery(".woocommerce-breadcrumb").children('a').eq(1).text() == "Sports, Fitness & Outdoor"){

            jQuery("input[name='Taste']").parent().hide();

            jQuery("input[name='Quality']").parent().hide();

            jQuery("input[name='Effectiveness']").parent().hide();

        }

        else if(jQuery(".woocommerce-breadcrumb").children('a').eq(1).text() == "Diet & Nutrition"){

            jQuery("input[name='Comfort']").parent().hide();

            jQuery("input[name='Sole Quality']").parent().hide();

            jQuery("input[name='Fitting']").parent().hide();

        }

    }

});

You would need to place this code in your child theme's JavaScript file.

Thanks,

Dwaipayan