Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825
Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830
Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825
Ameliabooking_Helpers::get_coupon_usage_count( int $coupon_id )
Fetches the total coupon usage.
Contents
Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830
Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825
Parameters Parameters
- $coupon_id
(Required) The coupon ID.
Return Return
(int) The number of coupons left.
Source Source
File: src/integrations/ameliabooking/helpers/ameliabooking-helpers.php
public function get_coupon_usage_count( $coupon_id ) { global $wpdb; $results = $wpdb->get_row( $wpdb->prepare( "SELECT count(*) as total FROM {$wpdb->prefix}amelia_customer_bookings WHERE couponId = %d", $coupon_id ), ARRAY_A ); return isset( $results['total'] ) ? absint( $results['total'] ) : 0; }
Expand full source code Collapse full source code View on Github