}
// loop through the populated fields to calc the qty
$quantity = 0;
- foreach($populated_fields as $price=>$info){
- $quantity += $info['qty'];
- }
-
- // logic to determine the discount rate, every 4 gets $10 off
- if($quantity % 4 === 0){
- $discount_qty = $quantity / 4;
- $discount_price = $discount_qty * 10;
- $price_total = ($quantity * 10) - $discount_price;
-
- } else if( $quantity > 4 && $quantity % 4 !== 0){
- $discount_qty = floor($quantity / 4);
- $discount_price = $discount_qty * 10;
- $price_total = ($quantity * 10) - $discount_price;
-
- } else if( $quantity < 4){
- $price_total = $quantity * 10;
- }
-
- $new_price = $price_total / $quantity;
-
- // set the newly calulated price for pdf form
- foreach($populated_fields as $price=>$info){
- $_POST[$price] = $new_price;
- }
+// foreach($populated_fields as $price=>$info){
+// $quantity += $info['qty'];
+// }
+//
+// // logic to determine the discount rate, every 4 gets $10 off
+// if($quantity % 4 === 0){
+// $discount_qty = $quantity / 4;
+// $discount_price = $discount_qty * 10;
+// $price_total = ($quantity * 10) - $discount_price;
+//
+// } else if( $quantity > 4 && $quantity % 4 !== 0){
+// $discount_qty = floor($quantity / 4);
+// $discount_price = $discount_qty * 10;
+// $price_total = ($quantity * 10) - $discount_price;
+//
+// } else if( $quantity < 4){
+// $price_total = $quantity * 10;
+// }
+//
+// $new_price = $price_total / $quantity;
+//
+// // set the newly calulated price for pdf form
+// foreach($populated_fields as $price=>$info){
+// $_POST[$price] = $new_price;
+// }
}
+add_action( 'gfpdf_post_html_fields', function( $entry, $config ) {
+ if($entry['form_id'] === '2'){
+ echo "<div class='gf_right_half' style='font-weight: bold;width: 200px;margin-right: 10px;color: black;'> DISCOUNTED TOTAL: " . $entry['21'] . "</div>";
+ }
+
+
+}, 10, 2 );
?>
\ No newline at end of file