Plugin Directory

Changeset 2394618


Ignore:
Timestamp:
10/06/2020 03:28:15 PM (5 years ago)
Author:
iplus
Message:

2.0.4

Location:
smallpay/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • smallpay/trunk/includes/class-wc-gateway-smallpay.php

    r2385656 r2394618  
    2727        $this->method_description = __('Allow the customer to pay by installments.', 'smallpay');
    2828
    29         $this->module_version = '2.0.3';
     29        $this->module_version = '2.0.4';
    3030
    3131        $this->has_fields = true;
     
    8585        add_action('init', array( $this,'register_instalments_payment_order_status' ), 25);
    8686        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)
    9191    {
    9292        $pdf_path = plugin_dir_path(__FILE__) . 'constant_smallpay.php';
     
    9595        }
    9696        return $attachments;
    97     }
     97    }*/
    9898
    9999
     
    340340        global $post;
    341341        $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;
    362354                }
    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        }
    366367    }
    367368
     
    371372        if (! self::$alreadyEnqueuedDisplayCustomField) {
    372373            $product = wc_get_product($post->ID);
    373             $isInstallable = $product->get_meta('isInstallable');
     374            if ($product !== false){
     375                $isInstallable = $product->get_meta('isInstallable');
    374376            $maxInstallments = $product->get_meta('maxInstallments');
    375377            $generalMaxInstallments = $this->settings['sp_max_installments'];
    376             if ($generalMaxInstallments<$maxInstallments) {
     378            if ($generalMaxInstallments < $maxInstallments) {
    377379                $maxInstallments = $generalMaxInstallments;
    378380            }
    379381            if ($isInstallable) {
    380382                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>';
    386388                }
    387389            }
     390        }
    388391        }
    389392        self::$alreadyEnqueuedDisplayCustomField = true;
  • smallpay/trunk/includes/config_smallpay.php

    r2385656 r2394618  
    1818    include_once($this->path . '/includes/configs/smallpay_prod.php');
    1919}
     20
  • smallpay/trunk/readme.txt

    r2385656 r2394618  
    88WC Requires at least: 3.0.0
    99WC Tested up to: 4.5.2
    10 Stable tag: 2.0.3
     10Stable tag: 2.0.4
    1111License: GNU General Public License v3.0
    1212License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    9292 * Added - Compatibility with Wordpress 5.5
    9393 * 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  
    55 * Plugin URI:
    66 * Description: Official SmallPay plugin.
    7  * Version: 2.0.3
     7 * Version: 2.0.4
    88 * Author: SmallPay Srl
    99 * Author URI: https://www.smallpay.it
     
    2323}
    2424
    25 define('SPWC_PLUGIN_VERSION', '2.0.3');
     25define('SPWC_PLUGIN_VERSION', '2.0.4');
    2626
    2727class WC_SmallPay
Note: See TracChangeset for help on using the changeset viewer.