Skip to content

Commit

Permalink
allow lazadaapp campaign
Browse files Browse the repository at this point in the history
  • Loading branch information
nhymxu authored Jun 1, 2018
1 parent 2b4d5d9 commit 73357d8
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions nhymxu-at-coupon-pro.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
Plugin URI: http://github.com/nhymxu/accesstrade-coupon-pro
Description: Pro version for ACCESSTRADE coupon
Author: Dũng Nguyễn (nhymxu)
Version: 0.3.0
Author URI: http://dungnt.net
Version: 0.3.1
Author URI: https://dungnt.net
*/

defined( 'ABSPATH' ) || die;
define('NHYMXU_AT_COUPON_PRO_VER', "0.3.0");
define('NHYMXU_AT_COUPON_PRO_VER', "0.3.1");

date_default_timezone_set('Asia/Ho_Chi_Minh');

Expand All @@ -28,12 +28,11 @@ function nhymxu_at_coupon_pro_weekly_cron_schedule( $schedules ) {

class nhymxu_at_coupon_pro {

private $ignore_campains = [
private $ignore_campaigns = [
'lazadacashback',
'uber_rider',
'ubernew',
'agodamobile',
'lazadaapp',
];

private $endpoint_at_campaign = 'https://api.accesstrade.vn/v1/campaigns';
Expand Down Expand Up @@ -80,7 +79,7 @@ public function do_this_daily() {
if( !empty($input) && isset( $input['data'] ) && is_array( $input['data'] ) ) {
$prepare_data = [];
foreach( $input['data'] as $campain ) {
if( $campain['approval'] == 'successful' && $campain['scope'] == 'public' && !in_array( $campain['merchant'], $this->ignore_campains ) ) {
if( $campain['approval'] == 'successful' && $campain['scope'] == 'public' && !in_array( $campain['merchant'], $this->ignore_campaigns ) ) {
$prepare_data[$campain['merchant']] = $campain['name'];
}
}
Expand Down

0 comments on commit 73357d8

Please sign in to comment.