• webmastertesco

    (@webmastertesco)


    The code below does not work. What is wrong??

    add_filter( 'wcfm_coupons_actions', function( $actions, $wcfm_coupons_single ) {
      	global $WCFM, $WCFMu;
      	
      	if( $wcfm_coupons_single->post_status == 'publish' ) {
      	  $actions .= ( current_user_can( 'delete_published_shop_coupons' ) ) ? '<a class="wcfm_coupon_delete wcfm-action-icon" href="#" data-couponid="' . $wcfm_coupons_single->ID . '"><span class="wcfmfa fa-trash-alt text_tip" data-tip="' . esc_attr__( 'Delete', 'wc-frontend-manager-ultimate' ) . '"></span></a>' : '';
      	} else {
      		$actions .= ( current_user_can( 'delete_shop_coupons' ) ) ? '<a class="wcfm_coupon_delete wcfm-action-icon" href="#" data-couponid="' . $wcfm_coupons_single->ID . '"><span class="wcfmfa fa-trash-alt text_tip" data-tip="' . esc_attr__( 'Delete', 'wc-frontend-manager-ultimate' ) . '"></span></a>' : '';
      	}
      	
      	return $actions;
      }, 50, 2 );

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author WC Lovers

    (@wclovers)

    This code is fine. But it’s only adding coupon delete button but what you have written for making this button functional?

    Between, WCFM Ultimate already has coupon delete option. https://ibb.co/0rxz7mj

Viewing 1 replies (of 1 total)

The topic ‘Delete Cuopon’ is closed to new replies.