Plugin Directory

Changeset 1420170


Ignore:
Timestamp:
05/19/2016 08:02:29 AM (10 years ago)
Author:
hemnathmouli
Message:

Bug Fix

Location:
wc-wallet
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • wc-wallet/tags/1.0.2/includes/functions.php

    r1408393 r1420170  
    898898 *
    899899 * @param int $order_type
    900  * @param string $order_status
     900 * @param string $old_status
    901901 *
    902902 * @since 1.0.2
    903903 *
    904904 */
    905 function wcw_check_the_order_status( $order_id ){
     905function wcw_check_the_order_status( $order_id, $old_status ){
    906906    $order      =   new WC_Order( $order_id );
    907907    $order_type =   get_post_meta( $order_id, '_payment_method', true );
    908     $order_status   =   "wc-".$order->get_status();
     908    $order_status   =   "wc-".$old_status;
    909909    $array  =   json_decode( get_option('wcw_transfer_only'), true );
    910910    $order_array = isset($array[$order_type])   ?   $array[$order_type] :   false;
    911     if( $order_array&&array_search($order_status,  $order_array) !== null){
     911    if( $order_array && array_search( $order_status,  $order_array ) !== false ){
    912912        return true;
    913913    }else{
  • wc-wallet/tags/1.0.2/wcw.php

    r1408393 r1420170  
    66 * Author URI: http://hemzware.com
    77 * Description: Activate this plugin to make the wallet system with WooCommerce.!
    8  * Version: 1.0.2
     8 * Version: 1.0.3
    99 */
    1010
     
    1616     * @var The current version of the plugin
    1717     */
    18     private $version    = '1.0.1';
     18    private $version    = '1.0.3';
    1919   
    2020    /**
     
    202202        }
    203203        if( array_search( $order_id, get_the_order_in_log() ) === false ) {
    204             if( count(get_wcw_only_methods()) == 0 || array_search( get_post_meta( $order_id, '_payment_method', true ), get_wcw_only_methods() ) !== false ){
     204            if( count(get_wcw_only_methods()) != 0 && array_search( get_post_meta( $order_id, '_payment_method', true ), get_wcw_only_methods() ) !== false && wcw_check_the_order_status( $order_id, $old_status ) ){
     205                error_log( "Count: ".count(get_wcw_only_methods()) );
     206                error_log("bool: ".wcw_check_the_order_status( $order_id ));
    205207                $order_total = get_post_meta($order_id, '_order_total', true);
    206208                $order = wc_get_order( $order_id );
  • wc-wallet/trunk/includes/functions.php

    r1408393 r1420170  
    898898 *
    899899 * @param int $order_type
    900  * @param string $order_status
     900 * @param string $old_status
    901901 *
    902902 * @since 1.0.2
    903903 *
    904904 */
    905 function wcw_check_the_order_status( $order_id ){
     905function wcw_check_the_order_status( $order_id, $old_status ){
    906906    $order      =   new WC_Order( $order_id );
    907907    $order_type =   get_post_meta( $order_id, '_payment_method', true );
    908     $order_status   =   "wc-".$order->get_status();
     908    $order_status   =   "wc-".$old_status;
    909909    $array  =   json_decode( get_option('wcw_transfer_only'), true );
    910910    $order_array = isset($array[$order_type])   ?   $array[$order_type] :   false;
    911     if( $order_array&&array_search($order_status,  $order_array) !== null){
     911    if( $order_array && array_search( $order_status,  $order_array ) !== false ){
    912912        return true;
    913913    }else{
  • wc-wallet/trunk/wcw.php

    r1408393 r1420170  
    66 * Author URI: http://hemzware.com
    77 * Description: Activate this plugin to make the wallet system with WooCommerce.!
    8  * Version: 1.0.2
     8 * Version: 1.0.3
    99 */
    1010
     
    1616     * @var The current version of the plugin
    1717     */
    18     private $version    = '1.0.1';
     18    private $version    = '1.0.3';
    1919   
    2020    /**
     
    202202        }
    203203        if( array_search( $order_id, get_the_order_in_log() ) === false ) {
    204             if( count(get_wcw_only_methods()) == 0 || array_search( get_post_meta( $order_id, '_payment_method', true ), get_wcw_only_methods() ) !== false ){
     204            if( count(get_wcw_only_methods()) != 0 && array_search( get_post_meta( $order_id, '_payment_method', true ), get_wcw_only_methods() ) !== false && wcw_check_the_order_status( $order_id, $old_status ) ){
     205                error_log( "Count: ".count(get_wcw_only_methods()) );
     206                error_log("bool: ".wcw_check_the_order_status( $order_id ));
    205207                $order_total = get_post_meta($order_id, '_order_total', true);
    206208                $order = wc_get_order( $order_id );
Note: See TracChangeset for help on using the changeset viewer.