Plugin Directory

Changeset 2605518


Ignore:
Timestamp:
09/27/2021 11:48:08 AM (5 years ago)
Author:
slimcd
Message:

Fixed error on if user do not update settings after plugin update 1.0.2

Location:
slimcd-payment-gateway
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • slimcd-payment-gateway/tags/1.0.2/includes/class-slimcd-payment-gateway.php

    r2601662 r2605518  
    185185    {
    186186        $order = wc_get_order($order_id);
    187         $order->update_status(trim($this->get_option('slimcd_wc_status_after_payment')));
     187        if (empty($this->get_option('slimcd_wc_status_after_payment'))) {
     188            $cartStatus = "processing";
     189        } else {
     190          $cartStatus = trim($this->get_option('slimcd_wc_status_after_payment')); 
     191        }
     192        $order->update_status($cartStatus);
    188193        WC()->cart->empty_cart();
    189194    }
  • slimcd-payment-gateway/trunk/includes/class-slimcd-payment-gateway.php

    r2601662 r2605518  
    185185    {
    186186        $order = wc_get_order($order_id);
    187         $order->update_status(trim($this->get_option('slimcd_wc_status_after_payment')));
     187        if (empty($this->get_option('slimcd_wc_status_after_payment'))) {
     188            $cartStatus = "processing";
     189        } else {
     190          $cartStatus = trim($this->get_option('slimcd_wc_status_after_payment')); 
     191        }
     192        $order->update_status($cartStatus);
    188193        WC()->cart->empty_cart();
    189194    }
Note: See TracChangeset for help on using the changeset viewer.