PluginProbe ʕ •ᴥ•ʔ
PiWeb Delivery & Pickup Date Time for WooCommerce / 3.0.62
PiWeb Delivery & Pickup Date Time for WooCommerce v3.0.62
3.0.63 3.0.62 3.0.61 3.0.60 3.0.49.49 3.0.49.6 3.0.49.60 3.0.49.61 3.0.49.62 3.0.49.63 3.0.49.64 3.0.49.66 3.0.49.67 3.0.49.69 3.0.49.7 3.0.49.70 3.0.49.72 3.0.49.73 3.0.49.74 3.0.49.76 3.0.49.77 3.0.49.79 3.0.49.9 3.0.49.90 3.0.49.91 3.0.49.92 3.0.49.93 3.0.49.94 3.0.49.96 3.0.49.97 3.0.49.99 trunk 1.0 1.1 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 2.9.17 3.0.47 3.0.49 3.0.49.1 3.0.49.10 3.0.49.11 3.0.49.12 3.0.49.13 3.0.49.16 3.0.49.17 3.0.49.19 3.0.49.2 3.0.49.20 3.0.49.21 3.0.49.22 3.0.49.23 3.0.49.24 3.0.49.26 3.0.49.27 3.0.49.29 3.0.49.3 3.0.49.30 3.0.49.31 3.0.49.32 3.0.49.33 3.0.49.34 3.0.49.36 3.0.49.37 3.0.49.39 3.0.49.4 3.0.49.40 3.0.49.41 3.0.49.42 3.0.49.43 3.0.49.44 3.0.49.46 3.0.49.47
pi-woocommerce-order-date-time-and-type / include / pisol.class.promotion.php
pi-woocommerce-order-date-time-and-type / include Last commit date
Pro_Warning.php 3 weeks ago background.png 3 weeks ago banner-sample.php 3 weeks ago class-get-values.php 3 weeks ago includes.php 3 weeks ago pisol.class.form.php 3 weeks ago pisol.class.promotion.php 3 weeks ago review-icon.svg 3 weeks ago review.php 3 weeks ago
pisol.class.promotion.php
73 lines
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) exit;
3 /**
4 * Promotion
5 * Version 1.0.0
6 */
7 if(!class_exists('pisol_promotion')):
8 class pisol_promotion{
9
10 public $variable_name;
11
12 function __construct($variable_name){
13 $this->variable_name = $variable_name;
14 $this->logic();
15 }
16
17 function logic(){
18 $day_passed = $this->daysPassed();
19 $today = wp_date('d, M Y');
20 switch($day_passed){
21 case 0:
22 $this->add("OFFER ENDS ON", $today, "6%", "OFF6" );
23 break;
24
25 case 1:
26 $this->add("OFFER ENDS ON", $today, "4%", "OFF4" );
27 break;
28
29 case 2:
30 $this->add("OFFER ENDS ON", $today, "2%", "OFF2" );
31 break;
32
33 case ($day_passed > 2):
34 if($this->isWeekEnd()){
35 $this->add("WEEKEND OFFER", "---------------", "10%", "DISC10" );
36 }
37 break;
38 }
39 }
40
41 function getInstallationDate(){
42 $install_date = get_option($this->variable_name,"");
43 $today = wp_date('Y-m-d');
44 if($install_date == "" || $install_date == false || $install_date == "1"){
45 update_option($this->variable_name, $today);
46 return $today;
47 }
48 //return '2019-06-21';
49 return $install_date == "" ? $today : $install_date;
50 }
51
52 function daysPassed(){
53 $date = $this->getInstallationDate();
54 $today = wp_date('Y-m-d');
55 $date_obj = date_create($date);
56 $today_obj = date_create($today);
57 $diff = date_diff($today_obj, $date_obj);
58 return $diff->days;
59 }
60
61 function isWeekEnd(){
62 $day = wp_date('N', strtotime(wp_date('Y/m/d')));
63 if($day >= 6){
64 return true;
65 }
66 return false;
67 }
68
69 function add($tagline, $date, $percent, $coupon_code){
70 include 'banner-sample.php';
71 }
72 }
73 endif;