WPPizza – A Restaurant Plugin for WordPress › Support › Code Snippets WPPizza v2.x (read only)
(Code Snippets for v3.x) › exclude items when using delivery charges per item
Viewing 1 post (of 1 total)
- AuthorPosts
- 19 September, 2014 at 11:47 am #5182
since v2.11.1
in case you have the scenario where you only want to have a per item charge for products that cost more than 6.95 you could use the filter below in your themes functions.php
you could also exclude by id if you wish (see codesnippet)/************************************************************************************ exclude items from per item delivery charges if price of item < some value ************************************************************************************/ add_filter('wppizza_filter_order_summary_exclude_item_from_count', 'p495nl_exclude_from_per_item_delivery_count',10,2); function p495nl_exclude_from_per_item_delivery_count($countExclude,$item){ /** if you wanted to exclude by id do: if(in_array($item['id'],array(1,23,45))) do a print_r($item) to get all keys you can filter on */ if($item['price']<6.95){//price per item zero for items<6.95 $countExclude=true; } return $countExclude; }
- AuthorPosts
Viewing 1 post (of 1 total)
- The topic ‘exclude items when using delivery charges per item’ is closed to new replies.