Trigger AJAX Popup on the whole product element click

The following code snippet will make popup opening without having to click on the “Select” button, will actually make the whole product wrapper clickable. Copy and paste the following code to your functions.php under your child theme add_action("wp_footer", "wpslash_woofood_hook_trigger_click_wrapper"); function…

1 min read

The following code snippet will make popup opening without having to click on the “Select” button, will actually make the whole product wrapper clickable.

Copy and paste the following code to your functions.php under your child theme

add_action("wp_footer", "wpslash_woofood_hook_trigger_click_wrapper");

function wpslash_woofood_hook_trigger_click_wrapper()
{
    ?>

    <script type="text/javascript">
        

        jQuery(document).ready(function()

        {

                  jQuery(document).on('click', '.woofood-product-loop' , function(e)
                  { 
                    jQuery(this).find('.woofood-quickview-button').trigger('click');


                  });




        });
    </script>
    <?php
}

Commission-free ordering

Run restaurant orders on your own WordPress site

FoodMaster adds delivery, pickup, dine-in, POS, and kitchen tools — with zero per-order fees.

Get FoodMaster

Leave a Comment

Your email address will not be published. Required fields are marked *