exclude items when using delivery charges per item

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #5182
    Olly
    Admin & Mod

      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;	
      }
      
    Viewing 1 post (of 1 total)
    • The topic ‘exclude items when using delivery charges per item’ is closed to new replies.