Advanced Product Fields for WooCommerce (Pro Version)

aarsna1

Member
Jun 6, 2019
85
79
18
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

guayaba

New member
Jul 17, 2018
7
1
3
for anyone that can't activate it

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

B5E0B5F8DD8689E6ACA49DD6E6E1A930

again thanks to @Tomz @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.
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu