• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

Advanced Product Fields for WooCommerce (Pro Version)

Integrate APF with WooCommerce Restaurant Ordering


Code:
add_filter('wc_restaurant_ordering_modal_data', 'wapf_wro_add_fields_to_modal', 10, 2);
function wapf_wro_add_fields_to_modal($data, $product) {
    
    if(!function_exists('wapf_display_field_groups_for_product'))
        return $data;
    
    $groups_html = wapf_display_field_groups_for_product($product);
    
    $data['options'] = $groups_html;
    
    return $data;
}

add_action('wp_footer', 'wapf_wro_add_javascript');
function wapf_wro_add_javascript() {
?>
<script>
    jQuery(document).on('wro:modal:open',function() {
        new WAPF.Frontend(jQuery('.wc-restaurant-product-modal'));
        jQuery(document).on('wapf/pricing', function(e,pTotal,oTotal,gTotal,$parent) {
            var $wrapper = $parent.closest('.wc-restaurant-product-modal');
            setTimeout(function(){$wrapper.find('button .total').html(WAPF.Util.formatMoney(gTotal,wapf_config.display_options))},10);
        });
    });
</script>
<?php
}
 
  • Like
Reactions: Arshard
for anyone that can't activate it

you can use any key or copy & use this key ;)

B5E0B5F8DD8689E6ACA49DD6E6E1A930

again thanks to @Babak @NullMaster


Thanks, any idea how to get this custom code snipet for this plugin?


Thanks

By the way, I'm going to buy the plugin next month, thanks to giving it a try, otherwise the developer would not see my money. I think Woo devs shoouls start thinking about trial days like shopify or nulling plugins will still be mandatory.
 
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock