WPPizza – A Restaurant Plugin for WordPress › Support › Add-Ons › Extensions › Add Ingredients › Codesnippets › adding/filtering the output
Viewing 3 posts - 1 through 3 (of 3 total)
- AuthorPosts
- 11 June, 2014 at 11:04 am #3453
as of v4.3.4.3 several filters have been added to add to the output
to add an additional “add to cart” button for example to the end of the form after all the ingredients groups , you can do so by adding the following to your themes function.php file
add_filter('wppizza_add_ingredients_filter_after_groups', 'my_custom_filter',10,2); function my_custom_filter($str,$lbl){ $str.='<div style="margin:0 0 30px 0;padding:5px 3px 0 0;"><input id="wppizza-diy-to-cart" class="btn btn-primary" type="button" value="'.$lbl['add_to_cart'].'"></div>'; return $str; }
NOTE: as of “Add Ingredients” plugin version 5.0.9+ , the following should be used instead
add_filter('wppizza_add_ingredients_filter_after_groups', 'my_custom_filter',10,5); function my_custom_filter($str, $labels, $itemId, $tierId, $sizeId){ $str .= '<div style="margin:0 0 30px 0;padding:5px 3px 0 0;"><input id="wppizza-alt-diy-to-cart-'.$itemId.'" class="btn btn-primary wppizza-diy-to-cart" type="button" value="'.$labels['add_to_cart'].'" /></div>'; return $str; }
to add some html elsewhere, there are also the following filters available you can use in a similar fashion:
- wppizza_add_ingredients_filter_before_form (to add something before the opening form tag)
- wppizza_add_ingredients_filter_form_start(to add something right after the opening form tag)
- wppizza_add_ingredients_filter_before_groups(to add something before the ingredients groups)
- wppizza_add_ingredients_filter_after_groups(to add something after the ingredients groups)
- wppizza_add_ingredients_filter_form_end (to add something right before the closing form tag – equivalent to wppizza_add_ingredients_filter_after_groups)
- wppizza_add_ingredients_filter_after_form (to add something after the closing form tag)
22 September, 2014 at 6:35 pm #5231This reply has been marked as private.22 September, 2014 at 6:58 pm #5232not really, no
are you sure you added it to the right functions.php file ?ps: why did you mark your question as private ???
- AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- The topic ‘adding/filtering the output’ is closed to new replies.