Changeset 2394618
- Timestamp:
- 10/06/2020 03:28:15 PM (5 years ago)
- Location:
- smallpay/trunk
- Files:
-
- 4 edited
-
includes/class-wc-gateway-smallpay.php (modified) (5 diffs)
-
includes/config_smallpay.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
smallpay.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
smallpay/trunk/includes/class-wc-gateway-smallpay.php
r2385656 r2394618 27 27 $this->method_description = __('Allow the customer to pay by installments.', 'smallpay'); 28 28 29 $this->module_version = '2.0. 3';29 $this->module_version = '2.0.4'; 30 30 31 31 $this->has_fields = true; … … 85 85 add_action('init', array( $this,'register_instalments_payment_order_status' ), 25); 86 86 add_filter('wc_order_statuses', array( $this,'add_instalments_payment_to_order_statuses' )); 87 add_filter('woocommerce_email_attachments', array( $this,'attach_contract_to_email'), 10, 3); 88 } 89 90 public function attach_contract_to_email($attachments, $id, $object)87 /* add_filter('woocommerce_email_attachments', array( $this,'attach_contract_to_email'), 10, 3);*/ 88 } 89 90 /*public function attach_contract_to_email($attachments, $id, $object) 91 91 { 92 92 $pdf_path = plugin_dir_path(__FILE__) . 'constant_smallpay.php'; … … 95 95 } 96 96 return $attachments; 97 } 97 }*/ 98 98 99 99 … … 340 340 global $post; 341 341 $prod = wc_get_product($post->ID); 342 343 if ($post->ID != self::$lastId) { 344 self::$alreadyEnqueuedDisplayCustomBadge = false; 345 } 346 347 if (!self::$alreadyEnqueuedDisplayCustomBadge) { 348 self::$lastId = $post->ID; 349 $isInstallable = $prod->get_meta('isInstallable'); 350 $maxInstallments = $prod->get_meta('maxInstallments'); 351 $generalMaxInstallments = $this->settings['sp_max_installments']; 352 if ($generalMaxInstallments<$maxInstallments) { 353 $maxInstallments = $generalMaxInstallments; 354 } 355 if ($isInstallable) { 356 if ($isInstallable == 1) { 357 echo'<div class="smallpay-custom-field-wrapper" >' 358 . '<span class="smallpay-custom-badge" style="text-transform: uppercase;padding: 3px;width: 70%;max-width: 400px;margin-bottom: 1em;border: 1px solid;border-radius: 3px;/*color: black;border-color: black;*/display: inline-block;margin-top: 1em;"">' 359 . __('product available in', 'smallpay') 360 . ' ' . $maxInstallments . ' ' . __('installments', 'smallpay') . '</span>' 361 . '</div>'; 342 if($prod !== false) { 343 if ($post->ID != self::$lastId) { 344 self::$alreadyEnqueuedDisplayCustomBadge = false; 345 } 346 347 if (!self::$alreadyEnqueuedDisplayCustomBadge) { 348 self::$lastId = $post->ID; 349 $isInstallable = $prod->get_meta('isInstallable'); 350 $maxInstallments = $prod->get_meta('maxInstallments'); 351 $generalMaxInstallments = $this->settings['sp_max_installments']; 352 if ($generalMaxInstallments < $maxInstallments) { 353 $maxInstallments = $generalMaxInstallments; 362 354 } 363 } 364 } 365 self::$alreadyEnqueuedDisplayCustomBadge = true; 355 if ($isInstallable) { 356 if ($isInstallable == 1) { 357 echo '<div class="smallpay-custom-field-wrapper" >' 358 . '<span class="smallpay-custom-badge" style="text-transform: uppercase;padding: 3px;width: 70%;max-width: 400px;margin-bottom: 1em;border: 1px solid;border-radius: 3px;/*color: black;border-color: black;*/display: inline-block;margin-top: 1em;"">' 359 . __('product available in', 'smallpay') 360 . ' ' . $maxInstallments . ' ' . __('installments', 'smallpay') . '</span>' 361 . '</div>'; 362 } 363 } 364 } 365 self::$alreadyEnqueuedDisplayCustomBadge = true; 366 } 366 367 } 367 368 … … 371 372 if (! self::$alreadyEnqueuedDisplayCustomField) { 372 373 $product = wc_get_product($post->ID); 373 $isInstallable = $product->get_meta('isInstallable'); 374 if ($product !== false){ 375 $isInstallable = $product->get_meta('isInstallable'); 374 376 $maxInstallments = $product->get_meta('maxInstallments'); 375 377 $generalMaxInstallments = $this->settings['sp_max_installments']; 376 if ($generalMaxInstallments <$maxInstallments) {378 if ($generalMaxInstallments < $maxInstallments) { 377 379 $maxInstallments = $generalMaxInstallments; 378 380 } 379 381 if ($isInstallable) { 380 382 if ($isInstallable == 1) { 381 echo '<div class="smallpay-custom-field-wrapper" style="background-color: lightgrey;border-left-color: #f8b250;border-left-style: outset;padding: 15px;max-width: 400px;display: block;margin-bottom: 30px;"">'382 . '<span style="/* float: left; *//* padding-right: 10px; */display: inline-block;">'383 . '<h5 style="padding-left:10px;font-weight: bold;">' . __('INSTALLABLE PRODUCT', 'smallpay') . '</h5>'384 . '<h6 style="padding-left:10px;">' . __('you can pay this products in', 'smallpay') . ' ' . $maxInstallments . ' ' . __('installments', 'smallpay') . '</h6></span>'385 . '<img src='.plugins_url('assets/images/smallpay.png', plugin_dir_path(__FILE__)).' style="max-height: 45px;float: right;max-width: 30%;/* display: block; */"><br></div>';383 echo '<div class="smallpay-custom-field-wrapper" style="background-color: lightgrey;border-left-color: #f8b250;border-left-style: outset;padding: 15px;max-width: 400px;display: block;margin-bottom: 30px;"">' 384 . '<span style="/* float: left; *//* padding-right: 10px; */display: inline-block;">' 385 . '<h5 style="padding-left:10px;font-weight: bold;">' . __('INSTALLABLE PRODUCT', 'smallpay') . '</h5>' 386 . '<h6 style="padding-left:10px;">' . __('you can pay this products in', 'smallpay') . ' ' . $maxInstallments . ' ' . __('installments', 'smallpay') . '</h6></span>' 387 . '<img src=' . plugins_url('assets/images/smallpay.png', plugin_dir_path(__FILE__)) . ' style="max-height: 45px;float: right;max-width: 30%;/* display: block; */"><br></div>'; 386 388 } 387 389 } 390 } 388 391 } 389 392 self::$alreadyEnqueuedDisplayCustomField = true; -
smallpay/trunk/includes/config_smallpay.php
r2385656 r2394618 18 18 include_once($this->path . '/includes/configs/smallpay_prod.php'); 19 19 } 20 -
smallpay/trunk/readme.txt
r2385656 r2394618 8 8 WC Requires at least: 3.0.0 9 9 WC Tested up to: 4.5.2 10 Stable tag: 2.0. 310 Stable tag: 2.0.4 11 11 License: GNU General Public License v3.0 12 12 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 92 92 * Added - Compatibility with Wordpress 5.5 93 93 * Fixed - Display issue showing unwanted characters on some themes. 94 95 = 2.0.4 = 96 * Fixed - file attached in order mail -
smallpay/trunk/smallpay.php
r2385656 r2394618 5 5 * Plugin URI: 6 6 * Description: Official SmallPay plugin. 7 * Version: 2.0. 37 * Version: 2.0.4 8 8 * Author: SmallPay Srl 9 9 * Author URI: https://www.smallpay.it … … 23 23 } 24 24 25 define('SPWC_PLUGIN_VERSION', '2.0. 3');25 define('SPWC_PLUGIN_VERSION', '2.0.4'); 26 26 27 27 class WC_SmallPay
Note: See TracChangeset
for help on using the changeset viewer.