diff --git a/admin/class-paystack-forms-admin.php b/admin/class-paystack-forms-admin.php index 8b4c82e..d0d3b2d 100755 --- a/admin/class-paystack-forms-admin.php +++ b/admin/class-paystack-forms-admin.php @@ -479,7 +479,7 @@ function kkd_pff_paystack_editor_add_recur_data() $recur = get_post_meta($post->ID, '_recur', true); $recurplan = get_post_meta($post->ID, '_recurplan', true); - if ($recur == "") { + if ($recur == "") { $recur = 'no'; } if ($recurplan == "") { @@ -506,16 +506,29 @@ function kkd_pff_paystack_editor_add_quantity_data() // Get the location data if its already been entered $usequantity = get_post_meta($post->ID, '_usequantity', true); + $useinventory = get_post_meta($post->ID, '_useinventory', true); + $inventory = get_post_meta($post->ID, '_inventory',true); + $sold = get_post_meta($post->ID, '_sold',true); $quantity = get_post_meta($post->ID, '_quantity', true); $quantityunit = get_post_meta($post->ID, '_quantityunit', true); $recur = get_post_meta($post->ID, '_recur', true); - + if ($usequantity == "") { $usequantity = 'no'; } + if($useinventory == ""){ + $useinventory = "no"; + } if ($quantity == "") { $quantity = '10'; } + if ($inventory == "" ) { + $inventory = '1'; + } + if($sold == ""){ + $sold = '0'; + } + $stock = $inventory - $sold; if ($quantityunit == "") { $quantityunit = 'Quantity'; } @@ -532,8 +545,28 @@ function kkd_pff_paystack_editor_add_quantity_data() Yes '; } + if($usequantity == "yes"){ + + echo '
Inventory Payment:
Total Inventory
In stock
Max payable quantity:
Unit of quantity: