Plugin Directory

Changeset 2498361


Ignore:
Timestamp:
03/17/2021 11:52:54 PM (5 years ago)
Author:
subscribility
Message:

release 2.9.24

Location:
subscribility
Files:
7 edited
10 copied

Legend:

Unmodified
Added
Removed
  • subscribility/tags/2.9.24/includes/frontend/controllers/class-wp99234-order-controller.php

    r2382505 r2498361  
    107107    }
    108108
     109    public function getShippingCost()
     110    {
     111        // array_values returns null if called on an empty array
     112        $shipping_methods = array_values( $this->_order->get_shipping_methods() );
     113
     114        return $shipping_methods ? $shipping_methods[0]->get_total() : null;
     115    }
     116
    109117    public function shipToDifferentAddress()
    110118    {
  • subscribility/tags/2.9.24/includes/frontend/controllers/class-wp99234-wc-filter.php

    r2493786 r2498361  
    13231323                WP99234()->_customer->order->updateOrderData( [
    13241324                    'shipment' => [
    1325                         'shipping_fee_override' => 1,
     1325                        'shipping_fee_override' => true,
    13261326                        'shipping_price' => 0
    13271327                    ]
    13281328                ] );
    13291329            }
     1330
     1331            if ( $shippingMethod == 'flat_rate' ) {
     1332                WP99234()->_customer->order->updateOrderData( [
     1333                    'shipment' => [
     1334                        'shipping_fee_override' => true,
     1335                        'shipping_price' => WP99234()->_customer->order->getShippingCost(),
     1336                        'ship_carrier_pref' => 'ManualShipment'
     1337                    ]
     1338                ] );
     1339            }
     1340
    13301341        } else {
    13311342            WP99234()->_customer->order->updateOrderData( [
  • subscribility/tags/2.9.24/includes/frontend/controllers/class-wp99234-wc-shipping-method.php

    r2415557 r2498361  
    7474                'label' => $this->title,
    7575                'cost' => 0.00,
     76                'calc_tax' => 'per_item',
     77            ];
     78        } else if(
     79            !empty( $package['destination']['postcode'] ) ||
     80            explode( ':', WC()->session->get( 'chosen_shipping_methods' )[0] )[0] == 'flat_rate'){
     81            $rate = [
     82                'id' => $this->id,
     83                'label' => $this->title,
     84                'cost' => $package['rates']['flat_rate']->cost,
    7685                'calc_tax' => 'per_item',
    7786            ];
  • subscribility/tags/2.9.24/readme.txt

    r2493786 r2498361  
    44Requires at least: 4.9.0
    55Tested up to: 5.4.2
    6 Stable Tag: 2.9.23
     6Stable Tag: 2.9.24
    77PHP version: 7.0 and above
    88License: GPLv2 or later
     
    7070
    7171## Changelog
     72###Version 2.9.24
     73- Adding support for flat rate shipping settings in WooCommerce
     74
    7275###Version 2.9.23
    7376- Resolve various bugs involving customers editing their orders
  • subscribility/tags/2.9.24/wp99234.php

    r2493786 r2498361  
    44 * Plugin URI: https://wordpress.org/plugins/subscribility/
    55 * Description: Manage and fulfil your sales of wine, beers and other crafted beverages, through clubs and other direct-to-consumer sales channels.
    6  * Version: 2.9.23
     6 * Version: 2.9.24
    77 * Author: Troly
    88 * Author URI: https://troly.io
  • subscribility/trunk/includes/frontend/controllers/class-wp99234-order-controller.php

    r2382505 r2498361  
    107107    }
    108108
     109    public function getShippingCost()
     110    {
     111        // array_values returns null if called on an empty array
     112        $shipping_methods = array_values( $this->_order->get_shipping_methods() );
     113
     114        return $shipping_methods ? $shipping_methods[0]->get_total() : null;
     115    }
     116
    109117    public function shipToDifferentAddress()
    110118    {
  • subscribility/trunk/includes/frontend/controllers/class-wp99234-wc-filter.php

    r2493786 r2498361  
    13231323                WP99234()->_customer->order->updateOrderData( [
    13241324                    'shipment' => [
    1325                         'shipping_fee_override' => 1,
     1325                        'shipping_fee_override' => true,
    13261326                        'shipping_price' => 0
    13271327                    ]
    13281328                ] );
    13291329            }
     1330
     1331            if ( $shippingMethod == 'flat_rate' ) {
     1332                WP99234()->_customer->order->updateOrderData( [
     1333                    'shipment' => [
     1334                        'shipping_fee_override' => true,
     1335                        'shipping_price' => WP99234()->_customer->order->getShippingCost(),
     1336                        'ship_carrier_pref' => 'ManualShipment'
     1337                    ]
     1338                ] );
     1339            }
     1340
    13301341        } else {
    13311342            WP99234()->_customer->order->updateOrderData( [
  • subscribility/trunk/includes/frontend/controllers/class-wp99234-wc-shipping-method.php

    r2415557 r2498361  
    7474                'label' => $this->title,
    7575                'cost' => 0.00,
     76                'calc_tax' => 'per_item',
     77            ];
     78        } else if(
     79            !empty( $package['destination']['postcode'] ) ||
     80            explode( ':', WC()->session->get( 'chosen_shipping_methods' )[0] )[0] == 'flat_rate'){
     81            $rate = [
     82                'id' => $this->id,
     83                'label' => $this->title,
     84                'cost' => $package['rates']['flat_rate']->cost,
    7685                'calc_tax' => 'per_item',
    7786            ];
  • subscribility/trunk/readme.txt

    r2493786 r2498361  
    44Requires at least: 4.9.0
    55Tested up to: 5.4.2
    6 Stable Tag: 2.9.23
     6Stable Tag: 2.9.24
    77PHP version: 7.0 and above
    88License: GPLv2 or later
     
    7070
    7171## Changelog
     72###Version 2.9.24
     73- Adding support for flat rate shipping settings in WooCommerce
     74
    7275###Version 2.9.23
    7376- Resolve various bugs involving customers editing their orders
  • subscribility/trunk/wp99234.php

    r2493786 r2498361  
    44 * Plugin URI: https://wordpress.org/plugins/subscribility/
    55 * Description: Manage and fulfil your sales of wine, beers and other crafted beverages, through clubs and other direct-to-consumer sales channels.
    6  * Version: 2.9.23
     6 * Version: 2.9.24
    77 * Author: Troly
    88 * Author URI: https://troly.io
Note: See TracChangeset for help on using the changeset viewer.