'; echo '
'; echo '

Affiliate WooCommerce Coupons Addon

'; if (isset($_POST['aff_woo_delete_item_id'])) { $item_id = $_REQUEST['aff_woo_delete_item_id']; $collection_obj = AFF_WOO_COUPONS_ASSOC::get_instance(); $collection_obj->delete_item_by_id($item_id); echo '

'; echo 'Item successfully deleted!'; echo '

'; } if (isset($_POST['aff_woo_save_association'])) { $coupon_code = $_POST['aff_woo_coupon_code']; $aff_id = $_POST['aff_woo_affiliate_id']; if(!empty($coupon_code) || !empty($aff_id)){ $item = new AFF_WOO_ASSOC_ITEM($coupon_code, $aff_id); $collection_obj = AFF_WOO_COUPONS_ASSOC::get_instance(); $collection_obj->add_item($item); AFF_WOO_COUPONS_ASSOC::save_object($collection_obj); echo '

'; echo 'Saved!'; echo '

'; } else{ echo '

'; echo 'Error! You must enter a coupon code and an affiliate ID.'; echo '

'; } } ?>

Coupon Code
Affiliate ID
Coupon Code Affiliate ID '; $row_count = 0; $collection_obj = AFF_WOO_COUPONS_ASSOC::get_instance(); if($collection_obj) { $items = $collection_obj->assoc_items; $number_of_items = count($items); if($number_of_items > 0) { foreach ($items as $item) { $output .= ''; $output .= ''.$item->coupon_code.''; $output .= ''.$item->aff_id.''; $output .= ''; $output .= "
"; $output .= ""; $output .= ''; $output .= "
"; $output .= ''; $output .= ''; $row_count = $row_count + 1; } } else { $output .= 'No Record found.'; } } else { $output .= 'No Record found.'; } $output .= ' '; //$output .= '

Add New

'; echo $output; echo '
';//End of poststuff and body echo '';//End of wrap }