PluginProbe ʕ •ᴥ•ʔ
PiWeb Delivery & Pickup Date Time for WooCommerce / 3.0.49.13
PiWeb Delivery & Pickup Date Time for WooCommerce v3.0.49.13
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
background.png 1 year ago banner-sample.php 1 year ago class-get-values.php 1 year ago includes.php 1 year ago pisol.class.form.php 1 year ago pisol.class.promotion.php 1 year ago review-icon.svg 1 year ago review.php 1 year ago
pisol.class.promotion.php
72 lines
1 <?php
2 /**
3 * Promotion
4 * Version 1.0.0
5 */
6 if(!class_exists('pisol_promotion')):
7 class pisol_promotion{
8
9 public $variable_name;
10
11 function __construct($variable_name){
12 $this->variable_name = $variable_name;
13 $this->logic();
14 }
15
16 function logic(){
17 $day_passed = $this->daysPassed();
18 $today = date('d, M Y');
19 switch($day_passed){
20 case 0:
21 $this->add("OFFER ENDS ON", $today, "6%", "OFF6" );
22 break;
23
24 case 1:
25 $this->add("OFFER ENDS ON", $today, "4%", "OFF4" );
26 break;
27
28 case 2:
29 $this->add("OFFER ENDS ON", $today, "2%", "OFF2" );
30 break;
31
32 case ($day_passed > 2):
33 if($this->isWeekEnd()){
34 $this->add("WEEKEND OFFER", "---------------", "10%", "DISC10" );
35 }
36 break;
37 }
38 }
39
40 function getInstallationDate(){
41 $install_date = get_option($this->variable_name,"");
42 $today = date('Y-m-d');
43 if($install_date == "" || $install_date == false || $install_date == "1"){
44 update_option($this->variable_name, $today);
45 return $today;
46 }
47 //return '2019-06-21';
48 return $install_date == "" ? $today : $install_date;
49 }
50
51 function daysPassed(){
52 $date = $this->getInstallationDate();
53 $today = date('Y-m-d');
54 $date_obj = date_create($date);
55 $today_obj = date_create($today);
56 $diff = date_diff($today_obj, $date_obj);
57 return $diff->days;
58 }
59
60 function isWeekEnd(){
61 $day = date('N', strtotime(date('Y/m/d')));
62 if($day >= 6){
63 return true;
64 }
65 return false;
66 }
67
68 function add($tagline, $date, $percent, $coupon_code){
69 include 'banner-sample.php';
70 }
71 }
72 endif;