Changeset 2217376
- Timestamp:
- 12/24/2019 07:30:36 AM (6 years ago)
- Location:
- woo-sagepay-addon/trunk
- Files:
-
- 2 edited
-
README.txt (modified) (1 diff)
-
woo-sagepay-addon.php (modified) (29 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woo-sagepay-addon/trunk/README.txt
r2216770 r2217376 111 111 = 1.0.5 = 112 112 * Fix - Made funcation changes. 113 = 2.0.0 = 114 * Fix - Update segapay kit. 115 113 116 == Upgrade Notice == -
woo-sagepay-addon/trunk/woo-sagepay-addon.php
r2216770 r2217376 5 5 * Plugin URL: Addon for sagepay and WooCommerce 6 6 * Description: Addon for sagepay and WooCommerce allows you to accept payments on your Woocommerce store. It accpets credit card payments and processes them securely with your merchant account. 7 * Version: 1.0.57 * Version: 2.0.0 8 8 * WC requires at least:2.3 9 9 * WC tested up to: 3.8.1 … … 25 25 deactivate_plugins(plugin_basename(__FILE__)); 26 26 add_action('load-plugins.php', function () { 27 add_filter('gettext', 'wsa p_change_text', 99, 3);27 add_filter('gettext', 'wsa_change_text', 99, 3); 28 28 }); 29 29 30 function wsa p_change_text($translated_text, $untranslated_text, $domain)30 function wsa_change_text($translated_text, $untranslated_text, $domain) 31 31 { 32 echo '111'; 33 echo '<pre>'; 34 print_r($_REQUEST);die; 32 35 $old = array( 33 36 "Plugin <strong>activated</strong>.", … … 41 44 remove_filter(current_filter(), __FUNCTION__, 99); 42 45 } 43 44 46 return $translated_text; 45 47 } … … 48 50 } 49 51 50 add_action('plugins_loaded', 'wsa p_init_woocommerce_sagepay', 0);51 52 function wsa p_init_woocommerce_sagepay()52 add_action('plugins_loaded', 'wsa_init_woocommerce_sagepay_4', 0); 53 54 function wsa_init_woocommerce_sagepay_4() 53 55 { 54 56 … … 59 61 load_plugin_textdomain('woocommerce', false, dirname(plugin_basename(__FILE__)) . '/lang'); 60 62 61 function wsap_add_sagepay_gateway($methods)63 function psdv2_add_sagepay_gateway($methods) 62 64 { 63 64 $methods[] = 'woocommerce_sagepay'; 65 $methods[] = 'woocommerce_sagepay_psdv2'; 66 65 67 return $methods; 66 68 } 67 69 68 add_filter('woocommerce_payment_gateways', ' wsap_add_sagepay_gateway');69 70 class woocommerce_sagepay extends WC_Payment_Gateway_CC70 add_filter('woocommerce_payment_gateways', 'psdv2_add_sagepay_gateway'); 71 72 class woocommerce_sagepay_psdv2 extends WC_Payment_Gateway_CC 71 73 { 72 74 … … 75 77 global $woocommerce; 76 78 77 $this->id = 'sagepay ';78 $this->method_title = __('Sagepay ', 'woocommerce');79 $this->id = 'sagepay_psdv2'; 80 $this->method_title = __('Sagepay psdv2', 'woocommerce'); 79 81 $this->icon = apply_filters('woocommerce_sagepay_icon', ''); 80 82 $this->has_fields = true; 81 $this->notify_url = add_query_arg('wc-api', 'woocommerce_sagepay ', home_url('/'));83 $this->notify_url = add_query_arg('wc-api', 'woocommerce_sagepay_psdv2', home_url('/')); 82 84 83 85 $this->init_form_fields(); … … 91 93 $this->mode = $this->get_option('mode'); 92 94 $this->transtype = $this->get_option('transtype'); 95 93 96 $this->send_shipping = $this->get_option('send_shipping'); 94 97 $this->sagepay_cardtypes = $this->get_option('sagepay_cardtypes'); … … 96 99 $this->sagepay_zerocurrency = array("BIF", "CLP", "DJF", "GNF", "JPY", "KMF", "KRW", "MGA", "PYG", "RWF", "VND", "VUV", "XAF", "XOF", "XPF", "GBP"); 97 100 98 add_action('init', array($this, 'wsap_auth_success')); 99 add_action('woocommerce_api_woocommerce_sagepay', array($this, 'wsap_auth_success')); 101 add_action('init', array($this, 'wsa_auth_success')); 102 103 add_action('woocommerce_api_woocommerce_' . $this->id, array($this, 'wsa_auth_success')); 104 100 105 add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options')); 101 add_action('woocommerce_order_status_processing_to_cancelled', array($this, 'wsap_restore_order_stock'), 10, 1); 102 add_action('woocommerce_order_status_completed_to_cancelled', array($this, 'wsap_restore_order_stock'), 10, 1); 103 add_action('woocommerce_order_status_on-hold_to_cancelled', array($this, 'wsap_restore_order_stock'), 10, 1); 104 add_action('woocommerce_order_status_processing_to_refunded', array($this, 'wsap_restore_order_stock'), 10, 1); 105 106 add_action('woocommerce_receipt_sagepay', array($this, 'receipt_page')); 107 add_action('woocommerce_order_status_completed_to_refunded', array($this, 'wsap_restore_order_stock'), 10, 1); 108 add_action('woocommerce_order_status_on-hold_to_refunded', array($this, 'wsap_restore_order_stock'), 10, 1); 106 107 add_action('woocommerce_order_status_processing_to_cancelled', array($this, 'wsa_restore_order_stock'), 10, 1); 108 109 add_action('woocommerce_order_status_completed_to_cancelled', array($this, 'wsa_restore_order_stock'), 10, 1); 110 111 add_action('woocommerce_order_status_on-hold_to_cancelled', array($this, 'wsa_restore_order_stock'), 10, 1); 112 113 add_action('woocommerce_order_status_processing_to_refunded', array($this, 'wsa_restore_order_stock'), 10, 1); 114 115 add_action('woocommerce_receipt_' . $this->id, array($this, 'receipt_page')); 116 117 add_action('woocommerce_order_status_completed_to_refunded', array($this, 'wsa_restore_order_stock'), 10, 1); 118 119 add_action('woocommerce_order_status_on-hold_to_refunded', array($this, 'wsa_restore_order_stock'), 10, 1); 120 109 121 add_filter('woocommerce_credit_card_form_fields', array($this, 'sagepay_card_type'), 10, 2); 122 110 123 } 111 124 … … 170 183 if ('yes' == get_option('woocommerce_sagepay_ssl_checkout')) { 171 184 $url = str_replace('http:', 'https:', $url); 185 echo $url;die; 172 186 } 173 187 return $url; … … 264 278 global $woocommerce; 265 279 266 if (empty(sanitize_text_field($_POST['sagepay -card-name']))) {280 if (empty(sanitize_text_field($_POST['sagepay_psdv2-card-name']))) { 267 281 wc_add_notice('<strong>Card Name</strong> ' . __('is required.', 'woocommerce'), 'error'); 268 282 } 269 283 270 if (!$this->wsa p_if_credit_card_is_empty(sanitize_text_field($_POST['sagepay-card-number']))) {284 if (!$this->wsa_if_credit_card_is_empty(sanitize_text_field($_POST['sagepay_psdv2-card-number']))) { 271 285 wc_add_notice('<strong>Credit Card Number</strong> ' . __('is required.', 'woocommerce'), 'error'); 272 } elseif (!$this->wsa p_is_valid_credit_card(sanitize_text_field($_POST['sagepay-card-number']))) {286 } elseif (!$this->wsa_is_valid_credit_card(sanitize_text_field($_POST['sagepay_psdv2-card-number']))) { 273 287 wc_add_notice('<strong>Credit Card Number</strong> ' . __('is not a valid credit card number.', 'woocommerce'), 'error'); 274 288 } 275 289 276 if (!$this->wsa p_if_expire_date_is_empty(sanitize_text_field($_POST['sagepay-card-expiry']))) {290 if (!$this->wsa_if_expire_date_is_empty(sanitize_text_field($_POST['sagepay_psdv2-card-expiry']))) { 277 291 wc_add_notice('<strong>Card Expiry Date</strong> ' . __('is required.', 'woocommerce'), 'error'); 278 } elseif (!$this->wsa p_is_valid_expire_date(sanitize_text_field($_POST['sagepay-card-expiry']))) {292 } elseif (!$this->wsa_is_valid_expire_date(sanitize_text_field($_POST['sagepay_psdv2-card-expiry']))) { 279 293 wc_add_notice('<strong>Card Expiry Date</strong> ' . __('is not a valid expiry date.', 'woocommerce'), 'error'); 280 294 } 281 295 282 if (!$this->wsa p_if_cvv_number_is_empty(sanitize_text_field($_POST['sagepay-card-cvc']))) {296 if (!$this->wsa_if_cvv_number_is_empty(sanitize_text_field($_POST['sagepay_psdv2-card-cvc']))) { 283 297 wc_add_notice('<strong>CVV Number</strong> ' . __('is required.', 'woocommerce'), 'error'); 284 298 } 285 299 } 286 300 287 private function wsa p_if_credit_card_is_empty($credit_card)301 private function wsa_if_credit_card_is_empty($credit_card) 288 302 { 289 303 if (empty($credit_card)) { … … 298 312 } 299 313 300 private function wsa p_if_expire_date_is_empty($expiry_date)314 private function wsa_if_expire_date_is_empty($expiry_date) 301 315 { 302 316 $expiry_date = str_replace(' / ', '', $expiry_date); … … 308 322 } 309 323 310 private function wsa p_if_cvv_number_is_empty($ccv_number)324 private function wsa_if_cvv_number_is_empty($ccv_number) 311 325 { 312 326 $length = strlen($ccv_number); 313 327 return is_numeric($ccv_number) and $length > 2 and $length < 5; 314 }315 316 private function wsap_is_valid_expire_date($expiry_date)317 {318 319 $month = $year = '';320 $month = substr($expiry_date, 0, 2);321 $year = substr($expiry_date, 5, 7);322 $year = '20' . $year;323 324 if ($month > 12) {325 return false;326 }327 328 if (date("Y-m-d", strtotime($year . "-" . $month . "-01")) > date("Y-m-d")) {329 return true;330 }331 332 return false;333 }334 335 private function wsap_is_valid_credit_card($credit_card)336 {337 $credit_card = preg_replace('/(?<=\d)\s+(?=\d)/', '', trim($credit_card));338 $number = preg_replace('/[^0-9]+/', '', $credit_card);339 $strlen = strlen($number);340 $sum = 0;341 if ($strlen < 13) {342 return false;343 }344 for ($i = 0; $i < $strlen; $i++) {345 $digit = substr($number, $strlen - $i - 1, 1);346 347 if ($i % 2 == 1) {348 349 $sub_total = $digit * 2;350 351 if ($sub_total > 9) {352 $sub_total = 1 + ($sub_total - 10);353 }354 } else {355 $sub_total = $digit;356 }357 $sum += $sub_total;358 }359 360 if ($sum > 0 and $sum % 10 == 0) {361 return true;362 }363 364 return false;365 328 } 366 329 … … 408 371 'TermUrl' => $this->notify_url, 409 372 ); 373 } else if (!empty(WC()->session->get('set_creq'))) { 374 $VPSTxId = WC()->session->get('set_vpstxid'); 375 $VPSTxId = str_replace('{', '', $VPSTxId); 376 $VPSTxId = str_replace('}', '', $VPSTxId); 377 $sagepay_args = array( 378 'creq' => WC()->session->get('set_creq'), 379 'threeDSSessionData' => $VPSTxId, 380 ); 410 381 } 411 382 $sagepay_args_array = array(); … … 414 385 $sagepay_args_array[] = '<input type="hidden" name="' . esc_attr($key) . '" value="' . esc_attr($value) . '" />'; 415 386 } 416 387 417 388 wc_enqueue_js(' 418 jQuery("body").block({419 message: "<img src=\"' . esc_url($woocommerce->plugin_url()) . '/assets/images/select2-spinner.gif\" alt=\"Redirecting...\" style=\"float:left; margin-right: 10px;\" />' . __('Thank you for your order. We are now redirecting you to verify your card.', 'woocommerce') . '",420 overlayCSS:421 {422 background: "#fff",423 opacity: 0.6424 },425 426 });389 /* jQuery("body").block({ 390 message: "<img src=\"' . esc_url($woocommerce->plugin_url()) . '/images/ajax-loader.gif\" alt=\"Redirecting...\" style=\"float:left; margin-right: 10px;\" />' . __('Thank you for your order. We are now redirecting you to verify your card.', 'woocommerce') . '", 391 overlayCSS: 392 { 393 background: "#fff", 394 opacity: 0.6 395 }, 396 397 }); */ 427 398 jQuery("#submit_sagepay_payment_form").click(); 428 399 '); 429 430 return '<form action="' . esc_url(WC()->session->get('set_acsurl')) . '" method="post" id="sagepay_payment_form">431 ' . implode('', $sagepay_args_array) . '432 <input type="submit" class="button-alt" id="submit_sagepay_payment_form" value="' . __('Submit', 'woocommerce') . '" /><a class="button cancel" href="' . esc_url($order->get_cancel_order_url()) . '">' . __('Cancel order & restore cart', 'woocommerce') . '</a>433 </form>';434 400 echo '<form style="display:none" action="' . esc_url(WC()->session->get('set_acsurl')) . '" target="3Diframe" method="post" id="sagepay_payment_form"> 401 ' . implode('', $sagepay_args_array) . ' 402 <input type="submit" class="button-alt" id="submit_sagepay_payment_form" value="' . __('Submit', 'woocommerce') . '" /> 403 <a class="button cancel" href="' . esc_url($order->get_cancel_order_url()) . '">' . __('Cancel order & restore cart', 'woocommerce') . '</a> 404 </form>'; 405 return '<iframe width="800" margin-top="30px" height="300" name="3Diframe" ></iframe>'; 435 406 } 436 407 … … 438 409 { 439 410 global $woocommerce; 440 411 441 412 $order = new WC_Order($order_id); 442 413 443 $credit_card = preg_replace('/(?<=\d)\s+(?=\d)/', '', trim(sanitize_text_field($_POST['sagepay -card-number'])));444 445 $expiry_date = sanitize_text_field($_POST['sagepay -card-expiry']);414 $credit_card = preg_replace('/(?<=\d)\s+(?=\d)/', '', trim(sanitize_text_field($_POST['sagepay_psdv2-card-number']))); 415 416 $expiry_date = sanitize_text_field($_POST['sagepay_psdv2-card-expiry']); 446 417 $month = substr($expiry_date, 0, 2); 447 418 $year = substr($expiry_date, 5, 7); … … 467 438 $product_item['BillingPhone'] = $order->billing_phone; 468 439 469 if ($this->wsa p_if_meta_product() == true || $this->send_shipping == 'yes') {440 if ($this->wsa_if_meta_product() == true || $this->send_shipping == 'yes') { 470 441 $product_item['DeliverySurname'] = $order->billing_last_name; 471 442 $product_item['DeliveryFirstnames'] = $order->billing_first_name; … … 510 481 $product_item['CustomerEMail'] = $order->billing_email; 511 482 } 512 $product_item['VPSProtocol'] = " 3.00";483 $product_item['VPSProtocol'] = "4.00"; 513 484 $product_item['TxType'] = $this->transtype; 514 485 $product_item['Vendor'] = $this->vendor_name; … … 518 489 $product_item['Description'] = sprintf(__('Order #%s', 'woocommerce'), ltrim($order->get_order_number(), '#')); 519 490 $product_item['DeliveryPhone'] = $order->billing_phone; 520 $product_item['CardHolder'] = sanitize_text_field($_POST['sagepay-card-name']); 491 // $product_item['CardHolder'] = sanitize_text_field($_POST['sagepay_psdv2-card-name']); 492 $product_item['CardHolder'] = 'CHALLENGE'; 521 493 $product_item['CardNumber'] = $credit_card; 522 494 $product_item['StartDate'] = ''; 523 495 $product_item['ExpiryDate'] = $month . $year; 524 $product_item['CV2'] = sanitize_text_field($_POST['sagepay -card-cvc']);525 $product_item['CardType'] = sanitize_text_field($_POST['sagepay -card-type']);496 $product_item['CV2'] = sanitize_text_field($_POST['sagepay_psdv2-card-cvc']); 497 $product_item['CardType'] = sanitize_text_field($_POST['sagepay_psdv2-card-type']); 526 498 $product_item['CustomerEMail'] = $order->billing_email; 527 499 $product_item['clientipaddress'] = $this->get_the_user_ip(); 528 500 $product_item['product_categories'] = $this->get_categories; 529 501 $product_item['customer_email'] = $order->billing_email; 502 // $product_item['VPSTxID'] = // $product_item['CreateToken'] = 1; 503 $product_item['ThreeDSNotificationURL'] = $this->notify_url; 504 $product_item['BrowserAcceptHeader'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3'; 505 $product_item['BrowserUserAgent'] = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36'; 506 507 $product_item['BrowserLanguage'] = 'en-GB'; 508 $product_item['BrowserJavascriptEnabled'] = true; 509 $product_item['BrowserJavaEnabled'] = true; 510 $product_item['BrowserColorDepth'] = 16; 511 $product_item['BrowserScreenHeight'] = '300'; 512 $product_item['BrowserScreenWidth'] = '300'; 513 $product_item['BrowserTZ'] = '-3180'; 514 $product_item['ChallengeWindowSize'] = '05'; 515 $product_item['Apply3DSecure'] = 3; 530 516 531 517 $post_values = ""; … … 613 599 'redirect' => $redirect_url, 614 600 ); 601 615 602 } else if ($responce_update['Status'] == "3DAUTH") { 616 603 617 604 if ($responce_update['3DSecureStatus'] == 'OK') { 618 if (isset($responce_update['ACSURL']) && (isset($responce_update['PAReq']))) {619 605 // if (isset($responce_update['ACSURL']) && (isset($responce_update['PAReq']))) { 606 if (isset($responce_update['ACSURL']) && (isset($responce_update['PAReq']) || isset($responce_update['CReq']))) { 620 607 WC()->session->set('set_acsurl', $responce_update['ACSURL']); 621 608 … … 624 611 } 625 612 613 if (isset($responce_update['CReq']) && !empty($responce_update['CReq'])) { 614 WC()->session->set('set_pareq', ""); 615 WC()->session->set('set_creq', $responce_update['CReq']); 616 } 617 626 618 WC()->session->set('set_md', $responce_update['MD']); 627 619 628 620 $redirect = $order->get_checkout_payment_url(true); 621 629 622 return array( 630 623 'result' => 'success', … … 641 634 static public function setStore($key, $value) 642 635 { 643 636 644 637 if (gettype($value) == "object") { 645 638 $_SESSION[$key] = serialize($value); … … 651 644 public function getSharedUrl($method, $env = '') 652 645 { 653 646 654 647 $env = $this->_validEnvironment($env); 655 648 if (isset($this->_sharedUrls[$env][$method])) { … … 659 652 } 660 653 661 function wsa p_update_logs($script_name, $msg, $file_name = 'logs.txt')662 { 663 654 function wsa_update_logs($script_name, $msg, $file_name = 'logs.txt') 655 { 656 664 657 $file = fopen($file_name, 'r+'); 665 658 $message_old = fread($file, filesize($file_name)); … … 670 663 } 671 664 672 public function wsa p_restore_order_stock($order_id)673 { 674 665 public function wsa_restore_order_stock($order_id) 666 { 667 675 668 $order = new WC_Order($order_id); 676 669 … … 740 733 } 741 734 742 public function thankyou_page() 743 { 744 if ($this->instructions) { 745 echo wpautop(wptexturize($this->instructions)); 746 } 747 } 748 749 public function wsap_auth_success() 735 private function wsa_is_valid_credit_card($credit_card) 736 { 737 $credit_card = preg_replace('/(?<=\d)\s+(?=\d)/', '', trim($credit_card)); 738 $number = preg_replace('/[^0-9]+/', '', $credit_card); 739 $strlen = strlen($number); 740 $sum = 0; 741 if ($strlen < 13) { 742 return false; 743 } 744 for ($i = 0; $i < $strlen; $i++) { 745 $digit = substr($number, $strlen - $i - 1, 1); 746 747 if ($i % 2 == 1) { 748 749 $sub_total = $digit * 2; 750 751 if ($sub_total > 9) { 752 $sub_total = 1 + ($sub_total - 10); 753 } 754 } else { 755 $sub_total = $digit; 756 } 757 $sum += $sub_total; 758 } 759 760 if ($sum > 0 and $sum % 10 == 0) { 761 return true; 762 } 763 764 return false; 765 } 766 767 public function wsa_auth_success() 750 768 { 751 769 global $woocommerce; 752 770 753 if ( isset($_REQUEST['MD']) && isset($_REQUEST['PaRes'])) {771 if ((!empty(WC()->session->get('set_vpstxid')) || isset($_REQUEST['MD'])) && (isset($_REQUEST['PaRes']) || isset($_REQUEST['cres']))) { 754 772 755 773 $order = new WC_Order(WC()->session->get('sagepay_oid')); 756 757 $request_array = array( 758 'MD' => sanitize_text_field($_REQUEST['MD']), 759 'PaRes' => sanitize_text_field($_REQUEST['PaRes']), 774 $VPSTxId = WC()->session->get('set_vpstxid'); 775 $VPSTxId = str_replace('{', '', $VPSTxId); 776 $VPSTxId = str_replace('}', '', $VPSTxId); 777 778 $request_psdv1_array = array( 779 'MD' => sanitize_text_field(isset($_REQUEST['MD'])), 780 'PaRes' => sanitize_text_field(isset($_REQUEST['PaRes'])), 760 781 'VendorTxCode' => WC()->session->get('sagepay_set'), 761 'VPSTxId' => WC()->session->get('set_vpstxid'),782 'VPSTxId' => $VPSTxId, 762 783 ); 763 764 $request = http_build_query($request_array); 784 $request_psdv2_array = array( 785 'CRes' => sanitize_text_field($_REQUEST['cres']), 786 'VPSTxId' => sanitize_text_field($VPSTxId), 787 ); 788 789 $request = ''; 790 if (isset($_REQUEST['PaRes'])) { 791 $request = http_build_query($request_psdv1_array); 792 } else { 793 $request = http_build_query($request_psdv2_array); 794 } 765 795 766 796 if ($this->mode == 'test') { … … 833 863 } 834 864 865 /* In the real world, the bank will either authorise the transaction (an OK response) or fail it (a 866 NOTATUHED response). The Sage Pay gateway prepares either an OK response 867 with an authorisation code, a NOTAUTHED response if the bank declined the transaction, */ 868 835 869 if ($responce_update['Status'] == "OK" || $responce_update['Status'] == "REGISTERED" || $responce_update['Status'] == "AUTHENTICATED") { 836 870 … … 839 873 $order->payment_complete(); 840 874 $redirect_url = $this->get_return_url($order); 841 842 wp_redirect($redirect_url); 875 ?> 876 <script type="text/javascript"> 877 top.location = '<?=$redirect_url?>'; 878 </script> 879 <?php 843 880 exit(); 844 881 845 882 } else if ($responce_update['Status'] == "3DAUTH") { 846 883 847 if (isset($responce_update['ACSURL']) && (isset($responce_update['PAReq']))) { 884 // if (isset($responce_update['ACSURL']) && (isset($responce_update['PAReq']))) { 885 if (isset($responce_update['ACSURL']) && (isset($responce_update['PAReq']) || isset($responce_update['CReq']))) { 848 886 WC()->session->set('set_acsurl', $responce_update['ACSURL']); 849 887 850 888 if (isset($responce_update['PAReq']) && !empty($responce_update['PAReq'])) { 851 889 WC()->session->set('set_pareq', $responce_update['PAReq']); 890 } 891 892 if (isset($responce_update['CReq']) && !empty($responce_update['CReq'])) { 893 WC()->session->set('set_pareq', ""); 894 WC()->session->set('set_creq', $responce_update['CReq']); 852 895 } 853 896 … … 872 915 } 873 916 874 private function wsap_if_meta_product() 917 private function wsa_is_valid_expire_date($expiry_date) 918 { 919 920 $month = $year = ''; 921 $month = substr($expiry_date, 0, 2); 922 $year = substr($expiry_date, 5, 7); 923 $year = '20' . $year; 924 925 if ($month > 12) { 926 return false; 927 } 928 929 if (date("Y-m-d", strtotime($year . "-" . $month . "-01")) > date("Y-m-d")) { 930 return true; 931 } 932 933 return false; 934 } 935 936 private function wsa_if_meta_product() 875 937 { 876 938 global $woocommerce; … … 897 959 898 960 } 899 900 961 }
Note: See TracChangeset
for help on using the changeset viewer.