Skip to content
This repository has been archived by the owner on Oct 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #174 from WC-Local-Pickup/release/1.4.1
Browse files Browse the repository at this point in the history
1.4.1 Release
  • Loading branch information
timnolte authored May 23, 2022
2 parents 65fe971 + 7d171a3 commit f7e7097
Show file tree
Hide file tree
Showing 16 changed files with 162 additions and 148 deletions.
29 changes: 9 additions & 20 deletions .github/workflows/pr-unit-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,18 @@ on:
pull_request:

env:
PHP_PREF_MIN_VERSION: '7.4'
WP_STABLE_VERSION: '5.7.*'
PHP_VERSION: '7.4'
WP_VERSION: '5.9.*'
WP_MULTISITE: 0
WC_STABLE_VERSION: '5.7.*'
WC_VERSION: '6.4.*'
COMPOSER_VERSION: '2.2'
ACTION_VERSION: 2
ACTION_VERSION: 3

jobs:
pr_unit_testing:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- job-name: 'Unit Test Latest Stable Requirements'
bleeding-edge: false
php-version: '7.4'
wordpress-version: '5.7.*'
wp-multisite-mode: 0
woocommerce-version: '5.7.*'

name: '${{ matrix.job-name }} (PHP:${{ matrix.php-version }}/WP:${{ matrix.wordpress-version }}/WC:${{ matrix.woocommerce-version }})'
name: 'Unit Test PR in Latest Stable Requirements'

steps:
- name: Checkout Code
Expand All @@ -48,9 +37,9 @@ jobs:
composer-cache-name: cache-composer
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-build-${{ env.composer-cache-name }}-wp-${{ matrix.wordpress-version }}-wc-${{ matrix.woocommerce-version }}-v${{ env.ACTION_VERSION }}-${{ hashFiles('**/composer.lock') }}
key: ${{ runner.os }}-build-${{ env.composer-cache-name }}-wp-${{ env.WP_VERSION }}-wc-${{ env.WC_VERSION }}-v${{ env.ACTION_VERSION }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.composer-cache-name }}-wp-${{ matrix.wordpress-version }}-wc-${{ matrix.woocommerce-version }}-v${{ env.ACTION_VERSION }}-
${{ runner.os }}-build-${{ env.composer-cache-name }}-wp-${{ env.WP_VERSION }}-wc-${{ env.WC_VERSION }}-v${{ env.ACTION_VERSION }}-
- name: Setup Node Environment
# https://github.com/marketplace/actions/setup-node-js-environment
Expand All @@ -63,14 +52,14 @@ jobs:
# https://github.com/marketplace/actions/setup-php-action
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
php-version: "${{ env.PHP_VERSION }}"
tools: "composer:${{ env.COMPOSER_VERSION }}"

- name: Environment Check
run: php -v && composer --version

- name: Require Specified WordPress & WooCommerce Version
run: composer require johnpbloch/wordpress-core:${{ matrix.wordpress-version }} php-stubs/wordpress-stubs:${{ matrix.wordpress-version }} wp-phpunit/wp-phpunit:${{ matrix.wordpress-version }} wpackagist-plugin/woocommerce:${{ matrix.woocommerce-version }} php-stubs/woocommerce-stubs:${{ matrix.woocommerce-version }} --dev --prefer-source --update-with-all-dependencies
run: composer require johnpbloch/wordpress-core:${{ env.WP_VERSION }} php-stubs/wordpress-stubs:${{ env.WP_VERSION }} wp-phpunit/wp-phpunit:${{ env.WP_VERSION }} wpackagist-plugin/woocommerce:${{ env.WC_VERSION }} php-stubs/woocommerce-stubs:${{ env.WC_VERSION }} --dev --prefer-source --update-with-all-dependencies

- name: Install Composer Dependencies
run: composer install --prefer-dist
Expand Down
63 changes: 14 additions & 49 deletions .github/workflows/unit-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,8 @@ on:
- develop

env:
PHP_MIN_VERSION: '7.2'
PHP_PREF_MIN_VERSION: '7.3'
PHP_STABLE_VERSION: '7.4'
WP_MIN_VERSION: '5.5.*'
WP_PREF_MIN_VERSION: '5.6.*'
WP_PREF_STABLE_VERSION: '5.7.*'
WP_STABLE_VERSION: '5.8.*'
WC_MIN_VERSION: '4.6.*'
WC_PREF_MIN_VERSION: '4.8.*'
WC_PREF_STABLE_VERSION: '5.*'
WC_STABLE_VERSION: '6.*'
COMPOSER_VERSION: '2.2'
ACTION_VERSION: 2
ACTION_VERSION: 3

jobs:
matrix_unit_testing:
Expand All @@ -31,49 +20,25 @@ jobs:
strategy:
fail-fast: false
matrix:
job-name: ['Unit Test']
php-version: ['7.2','7.3','7.4','8.0']
wordpress-version: ['5.5.*','5.6.*','5.7.*','5.8.*','5.9.*']
woocommerce-version: ['4.0.*','4.*','5.0.*','5.*','6.0.*','6.4.*']
wp-multisite-mode: [0]
bleeding-edge: [false]
include:
- job-name: 'Unit Test Latest Stable Requirements'
bleeding-edge: false
php-version: '7.4'
wordpress-version: '5.8.*'
wp-multisite-mode: 0
woocommerce-version: '6.*'
- job-name: 'Unit Test Preferred Stable Requirements'
bleeding-edge: false
php-version: '7.4'
wordpress-version: '5.7.*'
wp-multisite-mode: 0
woocommerce-version: '5.*'
- job-name: 'Unit Test Preferred Minimum Requirements'
bleeding-edge: false
php-version: '7.3'
wordpress-version: '5.6.*'
wp-multisite-mode: 0
woocommerce-version: '4.8.*'
- job-name: 'Unit Test Minimum Requirements'
bleeding-edge: false
php-version: '7.2'
wordpress-version: '5.5.*'
wp-multisite-mode: 0
woocommerce-version: '4.6.*'
- job-name: 'Unit Test Latest Compatibility Requirements'
bleeding-edge: false
php-version: '8.0'
wordpress-version: '5.9.*'
wp-multisite-mode: 0
woocommerce-version: '6.4.*'
- job-name: 'Unit Test Bleeding Edge Requirements'
bleeding-edge: true
php-version: '7.4'
php-version: '8.1'
wordpress-version: 'dev-master'
wp-multisite-mode: 0
woocommerce-version: 'dev-trunk'
- job-name: 'Unit Test Multisite Compatibility Requirements'
bleeding-edge: false
php-version: '7.4'
wordpress-version: '5.7.*'
php-version: '8.0'
wordpress-version: '5.9.*'
wp-multisite-mode: 1
woocommerce-version: '5.*'
woocommerce-version: '6.4.*'

name: '${{ matrix.job-name }} (PHP:${{ matrix.php-version }}/WP:${{ matrix.wordpress-version }}/WC:${{ matrix.woocommerce-version }})'

Expand Down Expand Up @@ -141,12 +106,12 @@ jobs:
run: |
composer require phpunit/phpunit:^8.0 phpro/grumphp:^1.10.0 --dev -W --ignore-platform-req=php
- name: Install Composer Dependencies (PHP 8.0)
if: matrix.php-version == '8.0'
- name: Install Composer Dependencies (PHP 8.x)
if: matrix.php-version == '8.0' || matrix.php-version == '8.1'
run: composer install --prefer-dist --ignore-platform-req=php

- name: Install Composer Dependencies
if: matrix.php-version != '8.0'
if: matrix.php-version != '8.0' && matrix.php-version != '8.1'
run: composer install --prefer-dist

- name: NPM Setup
Expand Down
Binary file added .wordpress-org/screenshot-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 1.4.1

### Changed

- Updated the README to provide details and usage on the latest functionality and features.

### Fixed

- Possible PHP Fatal Error when using new Local Pickup association functionality.

### Added

- Added new screenshot for "Ready for Pickup" email notification.

## 1.4.0

### Changed
Expand All @@ -10,7 +24,7 @@

- Updated Plugin Development Dependencies

### Adds
### Added

- Added New Ready for Pickup Order Status & Customer Email
- Added Pickup Time Required & Local Pickup Link Capabilities
Expand Down
57 changes: 39 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,66 @@
**Tags:** woocommcerce, shipping, local pickup, checkout fields, ecommerce, e-commerce, wordpress ecommerce
**Requires at least:** 4.9
**Tested up to:** 5.9.3
**Stable tag:** 1.4.0
**Stable tag:** 1.4.1
**Requires PHP:** 7.2
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

Add an option to WooCommerce checkout pages for Local Pickup orders to allow the user to choose a pickup time, defined in the admin area.
Add an option to the WooCommerce checkout for Local Pickup orders to allow the user to choose a pickup time, defined in the admin area.

## Description ##

Local Pickup Time extends the [WooCommerce](http://wordpress.org/plugins/woocommerce/) Local Pickup shipping option to allow users to choose a pickup time.

In the admin area, under WooCommerce -> Settings -> General, you can set the start and end times for order pickups each day, as well as define days the store is closed and allow you to select a time interval for allowing pickups. In addition, you can specify a time delay between when a customer places their order and when they can pickup their order to account for processing time, as well as how many days ahead a customer can choose for their delivery.
In the admin area, under "WooCommerce -> Settings -> Shipping -> Local Pickup Time settings", you can set the start and end times for order pickups each day, as well as define days the store is closed and allow you to select a time interval for allowing pickups. In addition, you can specify a time delay between when a customer places their order and when they can pickup their order to account for processing time, as well as how many days ahead a customer can choose for their delivery.

** Requires WooCommerce 4.x **
### Features ###

- **Daily Pickup Available Start/End Time:** Set the starting time and ending time for each day that pickups are available.
- **Pickup Time Interval to Allow Pickup Planning:** Define Pickup Time intervals to ensure that pickups are spaced out with adequate time to manage the number of pickups at any given time.
- **Pickup Time Delay to Allow for Required Product Preparation Time:** Setup a pickup delay to ensure that you have the required preparation time for products to be available.
- **Make Pickup Time Optional:** Allow pickup time to be optional in cases where a customer should only have the option to choose a Pickup Time but not be required to do so.
- **Limit Local Pickup Time to Local Shipping Methods Only:** Instead of always presenting a Pickup Time option on checkout only present the Pickup Time on the WooCommerce "Local Pickup" shipping method.
- **Ability to limit to specific Shipping Zones.** Pickup Time can be limited to only specific Shipping Zones.
- **"Ready for Pickup" Order Status:** A custom Order Status of "Ready for Pickup" is available in order to better track the progress of your orders.
- **Custom "Ready for Pickup" customer notification email template.** A custom "Email notification" can be setup under "WooCommerce -> Settings -> Emails" for when an Order is changed to "Ready for Pickup".

## Installation ##

### Using The WordPress Dashboard ###

1. Navigate to the 'Add New' in the plugins dashboard
2. Search for 'woocommerce-local-pickup-time'
2. Search for 'WooCommerce Local Pickup Time Select'
3. Click 'Install Now'
4. Activate the plugin on the Plugin dashboard

### Uploading in WordPress Dashboard ###

1. Navigate to the 'Add New' in the plugins dashboard
2. Navigate to the 'Upload' area
3. Select `woocommerce-local-pickup-time.zip` from your computer
4. Click 'Install Now'
5. Activate the plugin in the Plugin dashboard
1. Download a zip file of the plugins, which can be done from the WordPress plugin directory
2. Navigate to 'Add New' in the plugins dashboard
3. Click on the "Upload Plugin" button
4. Choose the downloaded Zip file from your computer with "Choose File"
5. Click 'Install Now'
6. Activate the plugin in the Plugin dashboard

### Using FTP ###

1. Download `woocommerce-local-pickup-time.zip`
2. Extract the `woocommerce-local-pickup-time` directory to your computer
3. Upload the `woocommerce-local-pickup-time` directory to the `/wp-content/plugins/` directory
1. Download a zip file of the plugins, which can be done from the WordPress plugin directory
2. Extract the Zip file to a directory on your computer
3. Upload the `woocommerce-local-pickup-time-select` directory to the `/wp-content/plugins/` directory
4. Activate the plugin in the Plugin dashboard

# Usage #

Navigate to `WooCommerce -> Settings -> General`, edit your start and end times for daily pickups, set your days closed and time interval for pickups.
Navigate to `WooCommerce -> Settings -> Shipping -> Local Pickup Time settings`, to edit your start and end times for daily pickups, set your days closed and time interval for pickups.

## Frequently Asked Questions ##

### Things aren't displaying properly ###

Go to `WooCommerce -> Settings -> General` and Save Changes to trigger the options to update.

Make sure to set your Timezone on the WordPress Admin Settings page.
- Go to `WooCommerce -> Settings -> Shipping -> Local Pickup Time settings` and "Save Changes" to trigger the options to update.
- Make sure to set your Timezone on the WordPress Admin Settings page to a proper value that is not a UTC offset.
- If "Limit to Local Pickup Shipping Methods?" is checked in the "Local Pickup Time settings", ensure you have a Shipping Zone that includes a "Local Pickup" Shipping Method. Additionally, make sure that each "Local Pickup" Shipping Method you want to have a "Pickup Time" has it enabled.

### How do I change the location of the pickup time select box during checkout? ###

Expand All @@ -70,17 +80,28 @@ The location, by default, is hooked to `woocommerce_admin_order_data_after_billi
3. Local Pickup Shipping Method Settings Screen
4. Order Listing Includes Pickup Date/Time
5. Order Details Screen Includes Pickup Date/Time
6. Ready for Pickup Order Email Notification

## Changelog ##

### 1.4.1
#### Changed
- Updated the README to provide details and usage on the latest functionality and features.

#### Fixed
- Possible PHP Fatal Error when using new Local Pickup association functionality.

#### Added
- Added new screenshot for "Ready for Pickup" email notification.

### 1.4.0
#### Changed
- Updated WordPress & WooCommerce Supported Versions.

#### Fixed
- Updated Plugin Development Dependencies

#### Adds
#### Added
- Added New Ready for Pickup Order Status & Customer Email
- Added Pickup Time Required & Local Pickup Link Capabilities

Expand Down
12 changes: 8 additions & 4 deletions admin/class-local-pickup-time-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,14 +480,18 @@ public function shipping_instance_form_add_extra_fields( $fields ) {
*
* @since 1.4.0
*
* @param array<mixed[]> $args The shipping method arguments.
* @param WC_Shipping_Method $shipping_method The WC_Shipping_Method instance object.
* @param array<mixed[]> $args The shipping method arguments.
* @param WC_Shipping_Method|null $shipping_method The WC_Shipping_Method instance object.
*
* @return array<mixed[]>
*/
public function shipping_method_add_rate_pickup_time_args( $args, $shipping_method ) {
public function shipping_method_add_rate_pickup_time_args( $args, $shipping_method = null ) {

if ( 'local_pickup' === $shipping_method->get_rate_id() ) {
if ( empty( $shipping_method ) ) {
return $args;
}

if ( 'yes' === $this->plugin->get_local_pickup_only() && 'local_pickup' === $shipping_method->get_rate_id() ) {
$args['meta_data']['wclpt_shipping_method_enabled'] = $shipping_method->get_option( 'wclpt_shipping_method_enabled' );
}

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"johnpbloch/wordpress-core": "~5.9.0",
"johnpbloch/wordpress-core-installer": "^2.0",
"mockery/mockery": "^1.3",
"php-stubs/woocommerce-stubs": "~6.3.0",
"php-stubs/woocommerce-stubs": "~6.4.0",
"php-stubs/wordpress-stubs": "~5.9.0",
"phpcompatibility/php-compatibility": "^9.0",
"phpcompatibility/phpcompatibility-wp": "^2.1",
Expand All @@ -71,7 +71,7 @@
"woocommerce/woocommerce-sniffs": "~0.1.0",
"wp-coding-standards/wpcs": "^2.2",
"wp-phpunit/wp-phpunit": "~5.9.0",
"wpackagist-plugin/woocommerce": "~6.3.0",
"wpackagist-plugin/woocommerce": "~6.4.0",
"yoast/phpunit-polyfills": "^1.0"
},
"autoload": {
Expand Down
Loading

0 comments on commit f7e7097

Please sign in to comment.