Plugin Directory

Changeset 2699874


Ignore:
Timestamp:
03/26/2022 08:25:44 AM (4 years ago)
Author:
mobipaid
Message:
  • fix order status for gift card product
Location:
mobipaid/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • mobipaid/trunk/includes/class-mobipaid.php

    r2661389 r2699874  
    589589      $order_status = 'completed';
    590590     
    591       foreach ($order->get_items() as $order_item){
    592 
    593         $item = wc_get_product($order_item->get_product_id());
    594        
    595         if (!$item->is_virtual()) {
     591      if(count((array)$order->get_items()) > 1 ) {
     592        if($this->is_product_contain_physical($order)){
     593
    596594            $order_status = 'processing';;
    597            
    598595        }
    599596      }
     597     
    600598
    601599      $this->log('order_status: '.$order_status);
     
    620618   $this->log('response_page: go to thank you page');
    621619  }
     620 }
     621
     622
     623 public function is_gift_card( $product ) {
     624    return str_contains($product->get_type(),'gift') && str_contains($product->get_type(),'card');
     625 }
     626
     627 public function is_product_contain_physical( $order ) {
     628   
     629    foreach ($order->get_items() as $order_item){
     630
     631        $item = wc_get_product($order_item->get_product_id());
     632       
     633        if (!$item->is_virtual() && !$this->is_gift_card($item)) {
     634            return true;
     635        }
     636      }
     637
     638      return false;
    622639 }
    623640
  • mobipaid/trunk/mobipaid.php

    r2661389 r2699874  
    44 * Plugin URI:           https://github.com/MobipaidLLC/mobipaid-woocommerce
    55 * Description:          Receive payments using Mobipaid.
    6  * Version:              1.0.6
     6 * Version:              1.0.7
    77 * Requires at least:    5.0
    88 * Tested up to:         5.6
     
    2424}
    2525
    26 define( 'MOBIPAID_PLUGIN_VERSION', '1.0.6' );
     26define( 'MOBIPAID_PLUGIN_VERSION', '1.0.7' );
    2727
    2828register_activation_hook( __FILE__, 'mobipaid_activate_plugin' );
  • mobipaid/trunk/readme.txt

    r2668681 r2699874  
    123123= 1.0.6 - 2022-01-20 =
    124124* fix order status for virtual product and download product
     125
     126= 1.0.7 - 2022-03-26 =
     127* fix order status for gift card product
Note: See TracChangeset for help on using the changeset viewer.