├── .devcontainer
├── activate.sh
├── devcontainer.json
├── local-features
│ └── welcome-message
│ │ ├── devcontainer-feature.json
│ │ └── install.sh
└── setup.sh
├── .editorconfig
├── .github
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE
│ ├── 1-Security-issue.md
│ ├── 2-Support.md
│ ├── 3-Bug-report.md
│ ├── 4-Enhancement.md
│ └── 5-Feature-request.md
├── PULL_REQUEST_TEMPLATE.md
└── workflows
│ ├── i18n.yml
│ ├── linting.yml
│ ├── pr-unit-testing.yml
│ ├── release.yml
│ ├── static-analysis.yml
│ └── unit-testing.yml
├── .gitignore
├── .gitpod.yml
├── .npmrc
├── .nvmrc
├── .wordpress-org
├── screenshot-1.png
├── screenshot-2.png
├── screenshot-3.png
├── screenshot-4.png
├── screenshot-5.png
└── screenshot-6.png
├── CHANGELOG.md
├── Gruntfile.js
├── README.md
├── admin
├── class-local-pickup-time-admin.php
└── emails
│ └── class-wc-email-customer-ready-for-pickup-order.php
├── codecov.yml
├── composer.json
├── composer.lock
├── docker-compose.yml
├── grumphp.yml.dist
├── languages
├── index.php
├── woocommerce-local-pickup-time-cs_CZ.mo
├── woocommerce-local-pickup-time-cs_CZ.po
├── woocommerce-local-pickup-time-en_US.mo
├── woocommerce-local-pickup-time-en_US.po
└── woocommerce-local-pickup-time.pot
├── package-lock.json
├── package.json
├── phpcs.xml.dist
├── phpstan.neon.dist
├── phpunit.xml.dist
├── public
└── class-local-pickup-time.php
├── readme.txt
├── templates
└── emails
│ ├── customer-ready-for-pickup-order.php
│ └── plain
│ └── customer-ready-for-pickup-order.php
├── tests
├── db-wordpress_test.sql
├── phpstan-bootstrap.php
└── phpunit
│ ├── admin
│ ├── class-local-pickup-time-admin_test.php
│ └── email
│ │ └── class-wc-email-customer-ready-for-pickup-order_test.php
│ ├── bootstrap.php
│ ├── public
│ └── class-local-pickup-time_test.php
│ ├── woocommerce-local-pickup-time_test.php
│ └── wp-tests-config.php
├── tools
├── apache
│ └── httpd.conf
├── local-env
│ ├── .htaccess
│ ├── index.php
│ ├── wp-cli.yml
│ ├── wp-config.php
│ └── wp-content
│ │ └── mu-plugins
│ │ ├── phpmailer-mailhog.php
│ │ └── wp-cfm.php
└── php
│ └── php-cli.ini
├── uninstall.php
├── woocommerce-local-pickup-time.php
└── wp-cli.yml
/.devcontainer/activate.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -eu
4 |
5 | # Activate the plugin.
6 | cd "/app"
7 | echo "Activating plugin..."
8 | if ! wp plugin is-active woocommerce-local-pickup-time-select 2>/dev/null; then
9 | wp plugin activate woocommerce-local-pickup-time-select --quiet
10 | fi
11 |
12 | echo "Done!"
13 |
--------------------------------------------------------------------------------
/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | // For format details, https://containers.dev/implementors/json_reference/.
2 | {
3 | "name": "WordPress Development Environment",
4 | "dockerComposeFile": "../docker-compose.yml",
5 | "service": "app",
6 | "mounts": ["source=dind-var-lib-docker,target=/var/lib/docker,type=volume"],
7 | "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
8 |
9 | "customizations": {
10 | "vscode": {
11 | // Set *default* container specific settings.json values on container create.
12 | "settings": {},
13 |
14 | // Add the IDs of extensions you want installed when the container is created.
15 | "extensions": [
16 | "ms-azuretools.vscode-docker",
17 | "bmewburn.vscode-intelephense-client",
18 | "claudiosanches.woocommerce",
19 | "ddarkonen.phpstan-larastan",
20 | "ecmel.vscode-html-css",
21 | "editorconfig.editorconfig",
22 | "github.codespaces",
23 | "johnbillion.vscode-wordpress-hooks",
24 | "ms-azuretools.vscode-docker",
25 | "ms-vscode-remote.remote-containers",
26 | "ms-vscode-remote.remote-ssh",
27 | "ms-vscode-remote.remote-ssh-edit",
28 | "obliviousharmony.vscode-php-codesniffer"
29 | ]
30 | }
31 | },
32 |
33 | // Features to add to the dev container. More info: https://containers.dev/features.
34 | "features": {
35 | "./local-features/welcome-message": "latest"
36 | },
37 |
38 | // Use 'forwardPorts' to make a list of ports inside the container available locally.
39 | "forwardPorts": [8080, 8081, 8027, 3306],
40 |
41 | // Maps a port number, "host:port" value, range, or regular expression to a set of default options. See port attributes for available options
42 | "portsAttributes": {
43 | "8080": {
44 | "label": "WordPress Development/Testing Site"
45 | },
46 | "8081": {
47 | "label": "phpMyAdmin"
48 | },
49 | "8027": {
50 | "label": "MailHog"
51 | },
52 | "3306": {
53 | "label": "MariaDB"
54 | }
55 | },
56 |
57 | // Use `onCreateCommand` to run commands as part of the container creation.
58 | //"onCreateCommand": "chmod +x .devcontainer/install.sh && .devcontainer/install.sh",
59 |
60 | // Use 'postCreateCommand' to run commands after the container is created.
61 | "postCreateCommand": "chmod +x .devcontainer/setup.sh && .devcontainer/setup.sh",
62 |
63 | // Use 'postStartCommand' to run commands after the container has started.
64 | "postStartCommand": "cd /app && wp --quiet plugin activate woocommerce-local-pickup-time-select",
65 |
66 | // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
67 | "remoteUser": "wp_php",
68 |
69 | // A set of name-value pairs that sets or overrides environment variables for the devcontainer.json supporting service / tool (or sub-processes like terminals) but not the container as a whole.
70 | "remoteEnv": { "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" }
71 | }
72 |
--------------------------------------------------------------------------------
/.devcontainer/local-features/welcome-message/devcontainer-feature.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "welcome-message",
3 | "name": "Install the First Start Welcome Message",
4 | "install": {
5 | "app": "",
6 | "file": "install.sh"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/.devcontainer/local-features/welcome-message/install.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -eux
4 |
5 | export DEBIAN_FRONTEND=noninteractive
6 |
7 | # Copy the welcome message
8 | if [ ! -f /usr/local/etc/vscode-dev-containers/first-run-notice.txt ]; then
9 | echo "Installing First Run Notice..."
10 | echo -e "👋 Welcome to \"WC Local Pickup Time Development\" in Dev Containers!\n\n🛠️ Your environment is fully setup with all the required software.\n\n🚀 To get started, wait for the \"postCreateCommand\" to finish setting things up, then open the portforwarded URL and append '/wp/wp-admin'. Login to the WordPress Dashboard using \`admin/password\` for the credentials.\n" | sudo tee /usr/local/etc/vscode-dev-containers/first-run-notice.txt
11 | fi
12 |
13 | echo "Done!"
14 |
--------------------------------------------------------------------------------
/.devcontainer/setup.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -eu
4 |
5 | # true is shell command and always return 0
6 | # false always return 1
7 | if [ -z "${CODESPACES}" ] ; then
8 | SITE_HOST="http://localhost:8080"
9 | else
10 | SITE_HOST="https://${CODESPACE_NAME}-8080.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}"
11 | fi
12 |
13 | PLUGIN_DIR=/workspaces/woocommerce-local-pickup-time
14 |
15 | # Attempt to make ipv4 traffic have a higher priority than ipv6.
16 | sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"
17 |
18 | # Install Composer dependencies.
19 | cd "${PLUGIN_DIR}"
20 | echo "Installing Composer dependencies..."
21 | COMPOSER_NO_INTERACTION=1 COMPOSER_ALLOW_XDEBUG=0 COMPOSER_MEMORY_LIMIT=-1 composer install --no-progress --quiet
22 |
23 | # Install NPM dependencies.
24 | cd "${PLUGIN_DIR}"
25 | if [ ! -d "node_modules" ]; then
26 | echo "Installing NPM dependencies..."
27 | npm ci
28 | fi
29 |
30 | # Add a wait to ensure the database is up and available.
31 | sleep 5
32 |
33 | # Setup the WordPress environment.
34 | cd "/app"
35 | if ! wp core is-installed 2>/dev/null; then
36 | echo "Setting up WordPress at $SITE_HOST"
37 | wp core install --url="$SITE_HOST" --title="WC Local Pickup Development" --admin_user="admin" --admin_email="admin@example.com" --admin_password="password" --skip-email --quiet
38 | echo "Importing WooCommerce sample products..."
39 | # Activate required plugins for content import.
40 | wp plugin activate action-scheduler woocommerce wordpress-importer
41 | # Import sample products.
42 | wp import wp-content/plugins/woocommerce/sample-data/sample_products.xml --authors=create
43 | fi
44 |
45 | if wp core is-installed 2>/dev/null; then
46 | echo "Activating required development plugins.."
47 | wp --quiet plugin activate \
48 | action-scheduler \
49 | debug-bar \
50 | debug-bar-actions-and-filters-addon \
51 | display-environment-type \
52 | health-check \
53 | query-monitor \
54 | transients-manager \
55 | woo-order-test \
56 | woocommerce \
57 | wordpress-importer \
58 | wp-mail-logging
59 |
60 | echo "Activating required development theme.."
61 | wp --quiet theme activate storefront
62 | fi
63 |
64 | echo "Done!"
65 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # This file is for unifying the coding style for different editors and IDEs
2 | # editorconfig.org
3 |
4 | # WordPress Coding Standards
5 | # https://make.wordpress.org/core/handbook/coding-standards/
6 |
7 | root = true
8 |
9 | [*]
10 | charset = utf-8
11 | end_of_line = lf
12 | insert_final_newline = true
13 | trim_trailing_whitespace = true
14 | indent_style = tab
15 |
16 | [*.yml,*.yml.dist,*.travis.yml]
17 | indent_style = space
18 | indent_size = 2
19 |
20 | [*.md]
21 | trim_trailing_whitespace = false
22 |
23 | [{*.txt,wp-config-sample.php}]
24 | end_of_line = crlf
25 |
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to WooCommerce Local Pickup Time ✨
2 |
3 | This plugin enhances WooCommerce, and your help making it even more awesome will be greatly appreciated :)
4 |
5 | There are many ways to contribute to the project!
6 |
7 | - [Translating strings into your language](https://translate.wordpress.org/projects/wp-plugins/woocommerce-local-pickup-time-select/).
8 | - Answering questions on the [WP.org support forums](https://wordpress.org/support/plugin/woocommerce-local-pickup-time-select/).
9 | - Testing open [issues](https://github.com/WC-Local-Pickup/woocommerce-local-pickup-time/issues) or [pull requests](https://github.com/WC-Local-Pickup/woocommerce-local-pickup-time/pulls) and sharing your findings in a comment.
10 | - Submitting fixes, improvements, and enhancements.
11 | - Disclose a security issue to our team by responsibly contacting the lead developer via DM to `@tnolte` in the [WordPress Slack](https://wordpress.slack.com/) or via secure message to [timnolte](https://keybase.io/timnolte/chat). (*NOTE*: Please disclose responsibly and not via GitHub, which allows for exploiting issues in the wild before the patch is released.)
12 |
13 | If you wish to contribute code, please read the information in the sections below. Then [fork](https://help.github.com/articles/fork-a-repo/) the plugin, commit your changes, and [submit a pull request](https://help.github.com/articles/using-pull-requests/) 🎉
14 |
15 | We use the `good first issue` label to mark issues that are suitable for new contributors. You can find all the issues with this label [here](https://github.com/WC-Local-Pickup/woocommerce-local-pickup-time/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).
16 |
17 | WooCommerce Local Pickup Time is licensed under the GPLv2.0, and all contributions to the project will be released under the same license. You maintain copyright over any contribution you make, and by submitting a pull request, you are agreeing to release that contribution under the GPLv2.0 license.
18 |
19 | ## Getting started
20 |
21 | - [How to set up the plugin development environment](https://github.com/WC-Local-Pickup/woocommerce-local-pickup-time/wiki/How-to-setup-the-plugin-development-environment)
22 |
23 | ## Coding Guidelines and Development 🛠
24 |
25 | - Ensure you stick to the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/)
26 | - Run our build process described in the document on [How to setup the plugin development environment](https://github.com/WC-Local-Pickup/woocommerce-local-pickup-time/wiki/How-to-setup-the-plugin-development-environment), it will install everything needed to do development on our plugin.
27 | - Whenever possible please fix pre-existing code standards errors in the files that you change. It is ok to skip that for larger files or complex fixes.
28 | - Ensure you use LF line endings in your code editor. Use [EditorConfig](http://editorconfig.org/) if your editor supports it so that indentation, line endings and other settings are auto configured.
29 | - When committing, reference your issue number (#1234) and include a note about the fix.
30 | - Ensure that your code supports the minimum supported versions of PHP and WordPress; this is shown at the top of the `readme.txt` file.
31 | - Push the changes to your fork and submit a pull request on the `develop` branch of the plugin repository.
32 | - Make sure to write good and detailed commit messages (see [this post](https://chris.beams.io/posts/git-commit/) for more on this) and follow all the applicable sections of the pull request template.
33 | - Please avoid modifying the changelog directly or updating the .pot files. These will be updated by the plugin team.
34 |
35 | ## Feature Requests 🚀
36 |
37 | Feature requests can be [submitted to our issue tracker](https://github.com/WC-Local-Pickup/woocommerce-local-pickup-time/issues/new?template=5-Feature-request.md). Be sure to include a description of the expected behavior and use case, and before submitting a request, please search for similar ones in the closed issues.
38 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/1-Security-issue.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "\U0001F46E♂️ Security issue"
3 | about: Please report security issues *only* via DM to `@tnolte` in the WordPress Slack. https://wordpress.slack.com/
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | For security reasons, please report all security issues via DM to `@tnolte` in the [WordPress Slack](https://wordpress.slack.com/) or via Keybase secure message to [timnolte](https://keybase.io/timnolte/chat).
11 |
12 | Please disclose responsibly and not via GitHub (which allows for exploiting issues in the wild before the patch is released).
13 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/2-Support.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "❓ Support Question"
3 | about: "Ask a general usage question \U0001F4AC."
4 | title: ''
5 | labels: 'help+wanted'
6 | assignees: ''
7 |
8 | ---
9 |
10 | **General usage questions**
11 | If your question hasn't been answered in the Wiki please check the [Discussions](https://github.com/WC-Local-Pickup/woocommerce-local-pickup-time/discussions) for possible solutions or post a new question there.
12 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/3-Bug-report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "\U0001F41E Bug report"
3 | about: Report a bug if something isn't working as expected in the plugin.
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is. Please be as descriptive as possible; issues lacking detail, or for any other reason than to report a bug, may be closed without action.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Screenshots**
21 | If applicable, add screenshots to help explain your problem.
22 |
23 | **Expected behavior**
24 | A clear and concise description of what you expected to happen.
25 |
26 | **Isolating the problem (mark completed items with an [x]):**
27 | - [ ] I have deactivated other plugins and confirmed this bug occurs when only WooCommerce and this plugin are active.
28 | - [ ] This bug happens with a default WordPress theme active, or [Storefront](https://woocommerce.com/storefront/).
29 | - [ ] I can reproduce this bug consistently using the steps above.
30 |
31 | **WordPress Environment**
32 | - Website URL:
33 | - PHP Version:
34 | - WordPress Version:
35 | - WooCommerce Version:
36 | - Plugin Version:
37 | - WordPress Timezone Setting:
38 | - WordPress Date Format Setting:
39 | - WordPress Time Format Setting:
40 | - All Plugin Start/End Pickup Time Settings:
41 | - Plugin Pickup Time Interval Setting:
42 | - Plugin Pickup Time Delay Setting:
43 | - Plugin Orders Per Interval:
44 | - Plugin Pickup Time Open Days Ahead Setting:
45 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/4-Enhancement.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "✨ New Enhancement"
3 | about: If you have an idea to improve an existing feature in the plugin or need something
4 | for development (such as a new hook) please let us know or submit a Pull Request!
5 | title: ''
6 | labels: ''
7 | assignees: ''
8 |
9 | ---
10 |
11 | **Is your feature request related to a problem? Please describe.**
12 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
13 |
14 | **Describe the solution you'd like**
15 | A clear and concise description of what you want to happen.
16 |
17 | **Describe alternatives you've considered**
18 | A clear and concise description of any alternative solutions or features you've considered.
19 |
20 | **Additional context**
21 | Add any other context or screenshots about the feature request here.
22 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/5-Feature-request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "\U0001F680 Feature request"
3 | about: "Suggest a new feature \U0001F389 We'll consider building it if it receives
4 | sufficient interest! \U0001F44D"
5 | title: ''
6 | labels: ''
7 | assignees: ''
8 |
9 | ---
10 |
11 | **Is your feature request related to a problem? Please describe.**
12 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
13 |
14 | **Describe the solution you'd like**
15 | A clear and concise description of what you want to happen.
16 |
17 | **Describe alternatives you've considered**
18 | A clear and concise description of any alternative solutions or features you've considered.
19 |
20 | **Additional context**
21 | Add any other context or screenshots about the feature request here.
22 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ### All Submissions:
2 |
3 | * [ ] Have you followed the [plugin Contributing guideline](https://github.com/WC-Local-Pickup/woocommerce-local-pickup-time/blob/master/.github/CONTRIBUTING.md)?
4 | * [ ] Does your code follow the [WordPress' coding standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/)?
5 | * [ ] Have you checked to ensure there aren't other open [Pull Requests](https://github.com/WC-Local-Pickup/woocommerce-local-pickup-time/pulls)) for the same update/change?
6 |
7 |
8 |
9 |
10 |
11 | ### Changes proposed in this Pull Request:
12 |
13 |
14 |
15 | Closes # .
16 |
17 | ### How to test the changes in this Pull Request:
18 |
19 | 1.
20 | 2.
21 | 3.
22 |
23 | ### Other information:
24 |
25 | * [ ] Have you added an explanation of what your changes do and why you'd like us to include them?
26 | * [ ] Have you written new tests for your changes, as applicable?
27 | * [ ] Have you successfully run tests with your changes locally?
28 |
29 |
30 |
31 | ### Changelog entry
32 |
33 | > Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.
34 |
--------------------------------------------------------------------------------
/.github/workflows/i18n.yml:
--------------------------------------------------------------------------------
1 | name: Internationalization
2 |
3 | on:
4 | pull_request:
5 | push:
6 | branches:
7 | - develop
8 | - 'release/**'
9 | - 'feature/**'
10 | - 'fix/**'
11 |
12 | env:
13 | ACTION_VERSION: 3
14 | WP_MULTISITE: 0
15 |
16 | jobs:
17 | check_i18n:
18 | name: Setup & Check Internationalization
19 |
20 | runs-on: ubuntu-latest
21 |
22 | steps:
23 | - name: Checkout Code
24 | # https://github.com/marketplace/actions/checkout
25 | uses: actions/checkout@v2
26 |
27 | - name: Setup Node Environment
28 | # https://github.com/marketplace/actions/setup-node-js-environment
29 | uses: actions/setup-node@v2
30 | with:
31 | node-version-file: '.nvmrc'
32 | cache: ${{ !env.ACT && 'npm' || '' }}
33 |
34 | - name: NPM Install
35 | run: npm ci
36 |
37 | - name: Check i18n Compliance
38 | run: npm run check:i18n
39 |
--------------------------------------------------------------------------------
/.github/workflows/linting.yml:
--------------------------------------------------------------------------------
1 | name: Coding Standards
2 |
3 | on:
4 | pull_request:
5 | push:
6 | branches:
7 | - develop
8 | - 'release/**'
9 | - 'feature/**'
10 | - 'fix/**'
11 |
12 | env:
13 | ACTION_VERSION: 3
14 | PHP_VERSION: '8.1'
15 | COMPOSER_VERSION: '2.5'
16 | WP_MULTISITE: 0
17 |
18 | jobs:
19 | check_linting:
20 | name: Setup & Check Coding Standards
21 |
22 | runs-on: ubuntu-latest
23 |
24 | steps:
25 | - name: Checkout Code
26 | # https://github.com/marketplace/actions/checkout
27 | uses: actions/checkout@v2
28 |
29 | - name: Get Composer Cache Directory
30 | id: composer-cache
31 | if: ${{ !env.ACT }}
32 | run: echo "::set-output name=dir::$(composer config cache-files-dir)"
33 |
34 | - name: Cache Composer dependencies
35 | if: ${{ !env.ACT }}
36 | # https://github.com/marketplace/actions/cache
37 | uses: actions/cache@v3
38 | env:
39 | composer-cache-name: cache-composer
40 | with:
41 | path: ${{ steps.composer-cache.outputs.dir }}
42 | key: ${{ runner.os }}-build-${{ env.composer-cache-name }}-v${{ env.ACTION_VERSION }}-${{ hashFiles('**/composer.lock') }}
43 | restore-keys: |
44 | ${{ runner.os }}-build-${{ env.composer-cache-name }}-v${{ env.ACTION_VERSION }}-
45 |
46 | - name: Setup PHP & Composer Environment
47 | # https://github.com/marketplace/actions/setup-php-action
48 | uses: shivammathur/setup-php@v2
49 | with:
50 | php-version: "${{ env.PHP_VERSION }}"
51 | tools: "composer:${{ env.COMPOSER_VERSION }}"
52 |
53 | - name: Environment Check
54 | run: php -v && composer --version
55 |
56 | - name: Install Composer Dependencies
57 | run: composer install
58 |
59 | - name: Check WordPress Coding Standards
60 | run: composer run-script lint
61 |
--------------------------------------------------------------------------------
/.github/workflows/pr-unit-testing.yml:
--------------------------------------------------------------------------------
1 | name: PR Unit Testing
2 |
3 | on:
4 | # Allows you to run this workflow manually from the Actions tab
5 | workflow_dispatch:
6 | # Triggers the workflow on pull request events
7 | pull_request:
8 |
9 | env:
10 | ACTION_VERSION: 4
11 |
12 | jobs:
13 | pr_unit_testing:
14 | runs-on: ubuntu-latest
15 |
16 | name: 'Unit Test PR in Latest Stable Requirements'
17 |
18 | steps:
19 | - name: Checkout Code
20 | # https://github.com/marketplace/actions/checkout
21 | uses: actions/checkout@v2
22 |
23 | - name: Set Swap Space
24 | uses: pierotofy/set-swap-space@master
25 | with:
26 | swap-size-gb: 10
27 |
28 | - name: Start Docker Environment
29 | run: docker compose up -d
30 |
31 | - name: Run PHPUnit Tests
32 | run: docker compose exec app /bin/bash -c 'composer install && composer phpunit'
33 |
34 | - name: Shutdown Docker Environment
35 | if: success() || failure()
36 | run: docker compose down
37 |
38 | - name: Generate Coverage Report
39 | if: success() && ${{ github.event_name == 'pull_request' }}
40 | # https://github.com/marketplace/actions/coverage-report-as-comment-clover
41 | uses: lucassabreu/comment-coverage-clover@main
42 | with:
43 | file: clover.xml
44 |
45 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Prepare & Deploy a Release
2 |
3 | on:
4 | release:
5 | types: [published]
6 |
7 | env:
8 | ACTION_VERSION: 3
9 | WP_MULTISITE: 0
10 |
11 | jobs:
12 | release:
13 | name: New Release
14 |
15 | if: github.repository == 'WC-Local-Pickup/woocommerce-local-pickup-time'
16 |
17 | runs-on: ubuntu-latest
18 |
19 | steps:
20 | - name: Checkout Code
21 | uses: actions/checkout@v2
22 |
23 | - name: Setup Node Environment
24 | # https://github.com/marketplace/actions/setup-node-js-environment
25 | uses: actions/setup-node@v2
26 | with:
27 | node-version-file: '.nvmrc'
28 | cache: ${{ !env.ACT && 'npm' || '' }}
29 |
30 | - name: Get NPM Cache Directory
31 | id: npm-cache
32 | if: ${{ !env.ACT }}
33 | run: echo "::set-output name=dir::$(npm config get cache)"
34 |
35 | - name: Cache Node Modules
36 | if: ${{ !env.ACT }}
37 | uses: actions/cache@v2
38 | env:
39 | npm-cache-name: cache-node-modules
40 | with:
41 | # npm cache files are stored in `~/.npm` on Linux/macOS
42 | path: ${{ steps.npm-cache.outputs.dir }}
43 | key: ${{ runner.os }}-build-${{ env.npm-cache-name }}-v${{ env.ACTION_VERSION }}-${{ hashFiles('**/package-lock.json') }}
44 | restore-keys: |
45 | ${{ runner.os }}-build-${{ env.npm-cache-name }}-v${{ env.ACTION_VERSION }}-
46 |
47 | - name: NPM Install
48 | run: npm ci
49 |
50 | - name: Prepare a WordPress.org Release
51 | run: npm run release
52 |
53 | - name: WordPress.org Plugin Deploy
54 | uses: nk-o/action-wordpress-plugin-deploy@master
55 | # https://github.com/marketplace/actions/wordpress-plugin-deploy
56 | env:
57 | SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
58 | SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
59 | SOURCE_DIR: dist/
60 | SLUG: woocommerce-local-pickup-time-select
61 |
--------------------------------------------------------------------------------
/.github/workflows/static-analysis.yml:
--------------------------------------------------------------------------------
1 | name: Static Code Analysis
2 |
3 | on:
4 | pull_request:
5 | push:
6 | branches:
7 | - develop
8 | - 'release/**'
9 | - 'feature/**'
10 | - 'fix/**'
11 |
12 | env:
13 | ACTION_VERSION: 3
14 | PHP_VERSION: '8.1'
15 | COMPOSER_VERSION: '2.5'
16 | WP_MULTISITE: 0
17 |
18 | jobs:
19 | check_static_analysis:
20 | name: Setup & Perform Static Analysis
21 |
22 | runs-on: ubuntu-latest
23 |
24 | steps:
25 | - name: Checkout Code
26 | # https://github.com/marketplace/actions/checkout
27 | uses: actions/checkout@v2
28 |
29 | - name: Get Composer Cache Directory
30 | id: composer-cache
31 | if: ${{ !env.ACT }}
32 | run: echo "::set-output name=dir::$(composer config cache-files-dir)"
33 |
34 | - name: Cache Composer dependencies
35 | if: ${{ !env.ACT }}
36 | # https://github.com/marketplace/actions/cache
37 | uses: actions/cache@v3
38 | env:
39 | composer-cache-name: cache-composer
40 | with:
41 | path: ${{ steps.composer-cache.outputs.dir }}
42 | key: ${{ runner.os }}-build-${{ env.composer-cache-name }}-v${{ env.ACTION_VERSION }}-${{ hashFiles('**/composer.lock') }}
43 | restore-keys: |
44 | ${{ runner.os }}-build-${{ env.composer-cache-name }}-v${{ env.ACTION_VERSION }}-
45 |
46 | - name: Setup PHP & Composer Environment
47 | # https://github.com/marketplace/actions/setup-php-action
48 | uses: shivammathur/setup-php@v2
49 | with:
50 | php-version: ${{ env.PHP_VERSION }}
51 | tools: "composer:${{ env.COMPOSER_VERSION }}"
52 |
53 | - name: Environment Check
54 | run: php -v && composer --version
55 |
56 | - name: Install Composer Dependencies
57 | run: composer install
58 |
59 | - name: Perform Static Analysis
60 | run: composer analyze
61 |
--------------------------------------------------------------------------------
/.github/workflows/unit-testing.yml:
--------------------------------------------------------------------------------
1 | name: Unit Testing
2 |
3 | on:
4 | # Allows you to run this workflow manually from the Actions tab
5 | workflow_dispatch:
6 | # Triggers the workflow on push events only for the matching branches
7 | push:
8 | branches:
9 | - 'release/**'
10 |
11 | env:
12 | ACTION_VERSION: 4
13 | COMPOSER_VERSION: '2.5'
14 |
15 | jobs:
16 | matrix_unit_testing:
17 | runs-on: ubuntu-latest
18 | continue-on-error: ${{ matrix.bleeding-edge }}
19 |
20 | strategy:
21 | fail-fast: false
22 | matrix:
23 | job-name: ['Unit Test']
24 | php-version: ['7.4','8.0','8.1']
25 | wordpress-version: ['5.9.*','6.4.*','6.5.*']
26 | woocommerce-version: ['4.*','5.*','6.*','7.*','8.*']
27 | wp-multisite-mode: [0]
28 | bleeding-edge: [false]
29 | include:
30 | - job-name: 'Unit Test Bleeding Edge Requirements'
31 | bleeding-edge: true
32 | php-version: '8.3'
33 | wordpress-version: 'dev-master'
34 | wp-multisite-mode: 0
35 | woocommerce-version: 'dev-trunk'
36 | - job-name: 'Unit Test Multisite Compatibility Requirements'
37 | bleeding-edge: false
38 | php-version: '8.1'
39 | wordpress-version: '6.5.*'
40 | wp-multisite-mode: 1
41 | woocommerce-version: '8.7.*'
42 |
43 | name: '${{ matrix.job-name }} (PHP:${{ matrix.php-version }}/WP:${{ matrix.wordpress-version }}/WC:${{ matrix.woocommerce-version }})'
44 |
45 | steps:
46 | - name: Checkout Code
47 | # https://github.com/marketplace/actions/checkout
48 | uses: actions/checkout@v2
49 |
50 | - name: Get Composer Cache Directory
51 | id: composer-cache
52 | if: ${{ !env.ACT }}
53 | run: echo "::set-output name=dir::$(composer config cache-files-dir)"
54 |
55 | - name: Cache Composer dependencies
56 | if: ${{ !env.ACT }}
57 | uses: actions/cache@v2
58 | env:
59 | composer-cache-name: cache-composer
60 | with:
61 | path: ${{ steps.composer-cache.outputs.dir }}
62 | key: ${{ runner.os }}-build-${{ env.composer-cache-name }}-wp-${{ matrix.wordpress-version }}-wc-${{ matrix.woocommerce-version }}-v${{ env.ACTION_VERSION }}-${{ hashFiles('**/composer.lock') }}
63 | restore-keys: |
64 | ${{ runner.os }}-build-${{ env.composer-cache-name }}-wp-${{ matrix.wordpress-version }}-wc-${{ matrix.woocommerce-version }}-v${{ env.ACTION_VERSION }}-
65 |
66 | - name: Setup PHP & Composer Environment
67 | # https://github.com/marketplace/actions/setup-php-action
68 | uses: shivammathur/setup-php@v2
69 | with:
70 | php-version: "${{ matrix.php-version }}"
71 | tools: "composer:${{ env.COMPOSER_VERSION }}"
72 |
73 | - name: Environment Check
74 | run: php -v && composer --version
75 |
76 | - name: Require Specified WordPress & WooCommerce Version (PHP <7.4)
77 | if: matrix.php-version == '7.3' || matrix.php-version == '7.2'
78 | 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 --ignore-platform-req=php
79 |
80 | - name: Require Specified WordPress & WooCommerce Version (Bleeding Edge)
81 | if: matrix.bleeding-edge
82 | run: composer require johnpbloch/wordpress-core:${{ matrix.wordpress-version }} php-stubs/wordpress-stubs:${{ matrix.wordpress-version }} szepeviktor/phpstan-wordpress:* wp-phpunit/wp-phpunit:${{ matrix.wordpress-version }} wpackagist-plugin/woocommerce:${{ matrix.woocommerce-version }} php-stubs/woocommerce-stubs:* --dev --prefer-source --update-with-all-dependencies
83 |
84 | - name: Require Specified WordPress & WooCommerce Version
85 | if: matrix.php-version != '7.3' && matrix.php-version != '7.2' && ! matrix.bleeding-edge
86 | 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
87 |
88 | - name: PHPUnit Bleeding Edge Support
89 | if: matrix.bleeding-edge
90 | run: |
91 | composer require sebastian/code-unit:dev-main phpunit/phpunit:dev-master phpro/grumphp:dev-master --dev -W --ignore-platform-req=php --update-with-all-dependencies
92 |
93 | - name: PHPUnit PHP 8.0 Support
94 | if: matrix.php-version == '8.0'
95 | run: |
96 | composer require phpunit/phpunit:^8.0 phpro/grumphp:^1.10.0 --dev -W --ignore-platform-req=php
97 |
98 | - name: Install Composer Dependencies (PHP 8.x)
99 | if: matrix.php-version == '8.0' || matrix.php-version == '8.1'
100 | run: composer install --prefer-dist --ignore-platform-req=php
101 |
102 | - name: Install Composer Dependencies
103 | if: matrix.php-version != '8.0' && matrix.php-version != '8.1'
104 | run: composer install --prefer-dist
105 |
106 | - name: Unit Tests
107 | env:
108 | WP_MULTISITE: ${{ matrix.wp-multisite-mode }}
109 | run: composer test
110 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Numerous always-ignore extensions
2 | *.diff
3 | *.err
4 | *.orig
5 | *.log
6 | *.rej
7 | *.swo
8 | *.swp
9 | *.vi
10 | *~
11 | *.sass-cache
12 |
13 | # Local Development files/folders.
14 | .env
15 | .wp-env.override.json
16 | phpcs.xml
17 | phpstan.neon
18 | phpunit.xml
19 | .phpunit.result.cache
20 | clover.xml
21 |
22 | # OS or Editor folders
23 | .DS_Store
24 | Thumbs.db
25 | .cache
26 | tags.*
27 | .project
28 | .settings
29 | .tmproj
30 | *.esproj
31 | nbproject
32 | *.sublime-project
33 | *.sublime-workspace
34 | .idea
35 |
36 | # Dreamweaver added files
37 | _notes
38 | dwsync.xml
39 |
40 | # Komodo
41 | *.komodoproject
42 | .komodotools
43 |
44 | # Folders to ignore
45 | .hg
46 | .svn
47 | .CVS
48 | intermediate
49 | .idea
50 | cache
51 | node_modules
52 | vendor
53 | dist
54 |
55 | # WordPress Development environment directories to ignore.
56 | tools/local-env/wp
57 | tools/local-env/wp-content/db.php
58 | tools/local-env/wp-content/.litespeed_conf.dat
59 | tools/local-env/wp-content/cache/*
60 | tools/local-env/wp-content/ewww/*
61 | tools/local-env/wp-content/litespeed/*
62 | !tools/local-env/wp-content/plugins/
63 | tools/local-env/wp-content/plugins/*
64 | tools/local-env/wp-content/themes/*
65 | tools/local-env/wp-content/uploads/*
66 | tools/local-env/wp-content/upgrade/*
67 |
68 | # Local Development Exceptions.
69 | !tools/local-env/wp-content/mu-plugins/*
70 | !tools/local-env/wp-content/plugins/.gitkeep
71 | !tools/local-env/wp-content/plugins/woocommerce-local-pickup-time-select/.gitkeep
72 |
73 |
--------------------------------------------------------------------------------
/.gitpod.yml:
--------------------------------------------------------------------------------
1 | # List the start up tasks. Learn more https://www.gitpod.io/docs/config-start-tasks/
2 | tasks:
3 | - name: WordPress Development Environment
4 | init: npm run setup # runs during prebuild
5 | command: |
6 | npm start -- --update
7 |
8 | # List the ports to expose. Learn more https://www.gitpod.io/docs/config-ports/
9 | ports:
10 | - port: 8888
11 | onOpen: notify
12 | visibility: public
13 | - port: 8889
14 | onOpen: notify
15 | visibility: public
16 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | save-exact = true
2 |
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | 16
2 |
--------------------------------------------------------------------------------
/.wordpress-org/screenshot-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WC-Local-Pickup/woocommerce-local-pickup-time/5350e429c05c5482249eb39c16feb95ca106cebd/.wordpress-org/screenshot-1.png
--------------------------------------------------------------------------------
/.wordpress-org/screenshot-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WC-Local-Pickup/woocommerce-local-pickup-time/5350e429c05c5482249eb39c16feb95ca106cebd/.wordpress-org/screenshot-2.png
--------------------------------------------------------------------------------
/.wordpress-org/screenshot-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WC-Local-Pickup/woocommerce-local-pickup-time/5350e429c05c5482249eb39c16feb95ca106cebd/.wordpress-org/screenshot-3.png
--------------------------------------------------------------------------------
/.wordpress-org/screenshot-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WC-Local-Pickup/woocommerce-local-pickup-time/5350e429c05c5482249eb39c16feb95ca106cebd/.wordpress-org/screenshot-4.png
--------------------------------------------------------------------------------
/.wordpress-org/screenshot-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WC-Local-Pickup/woocommerce-local-pickup-time/5350e429c05c5482249eb39c16feb95ca106cebd/.wordpress-org/screenshot-5.png
--------------------------------------------------------------------------------
/.wordpress-org/screenshot-6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WC-Local-Pickup/woocommerce-local-pickup-time/5350e429c05c5482249eb39c16feb95ca106cebd/.wordpress-org/screenshot-6.png
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## 1.4.2
4 |
5 | ### Fixed
6 |
7 | - Checkout prevented on non-Local Shipping methods.
8 | - Updated WordPress Supported Versions.
9 |
10 | ## 1.4.1
11 |
12 | ### Changed
13 |
14 | - Updated the README to provide details and usage on the latest functionality and features.
15 |
16 | ### Fixed
17 |
18 | - Possible PHP Fatal Error when using new Local Pickup association functionality.
19 |
20 | ### Added
21 |
22 | - Added new screenshot for "Ready for Pickup" email notification.
23 |
24 | ## 1.4.0
25 |
26 | ### Changed
27 |
28 | - Updated WordPress & WooCommerce Supported Versions.
29 |
30 | ### Fixed
31 |
32 | - Updated Plugin Development Dependencies
33 |
34 | ### Added
35 |
36 | - Added New Ready for Pickup Order Status & Customer Email
37 | - Added Pickup Time Required & Local Pickup Link Capabilities
38 |
39 | ## 1.3.13
40 |
41 | - Compatibility versions bump.
42 | - Plugin owner/author transition.
43 |
44 | ## 1.3.12
45 |
46 | - Fixes Time Zone related pickup delay issue.
47 |
48 | ## 1.3.11
49 |
50 | - NPM development dependencies security vulnerability update.
51 |
52 | ## 1.3.10
53 |
54 | - Adds check for PHP 7.1+ Date/Time object changes and makes appropriate PHP version specific calls.
55 |
56 | ## 1.3.9
57 |
58 | - Fixes how the starting interval is set, especially during the middle of the current open/close pickup time.
59 | - Sets end time 1 interval past it in order to have the end close pickup time be inclusive for pickup.
60 | - Changes field title and help text for Pickup Days Ahead to be clear that the number does now represent the number of open days inclusive of the current day.
61 | - Updates language files to handle some new dashboard labels and help text.
62 | - Fixes an incorrect use of the pickup time interval instead of the delay, causing incorrect starting pickup time.
63 | - Changes direct WC_Order id attribute access to use get_id() method.
64 | - Fixes additonal issue with how time delay is handled on the first available pickup time.
65 |
66 | ## 1.3.8
67 |
68 | - Fixes issue with recognizing the current date/time as the start of the pickup time selection.
69 |
70 | ## 1.3.7
71 |
72 | - Fixes an issue with not using the WordPress locale and built-in language pack to translate the pickup date output on checkout.
73 |
74 | ## 1.3.6
75 |
76 | - Fixes WordPress date/time format handling for pickup time selection.
77 | - Fixes issues with some interval combinations.
78 |
79 | ## 1.3.5
80 |
81 | - fixes issue with allowing customers to pick a pickup date/time on a non-open day.
82 |
83 | ## 1.3.4
84 |
85 | - fixes 1.3.3 patch issue.
86 |
87 | ## 1.3.3
88 |
89 | - fixes PHP 5.6 issue with DateTime syntax usage.
90 |
91 | ## 1.3.2
92 |
93 | - fixes issue with missing space in pickup time options, from 1.3.1.
94 | - adds pickup date/time to Order List in Admin Dashboard.
95 | - adds longer pickup delay option.
96 |
97 | ## 1.3.1
98 |
99 | - expands pickup time delay to include 4/8/16/24/36 hours.
100 | - changes days ahead setting to allow any number of days via text input.
101 | - changes customer display of pickup time to include the date using the WordPress date format setting.
102 | - removes closed dates from option list even if it's not today.
103 |
104 | ## 1.3.0
105 |
106 | - fix pickup time for multiple locales and update translations (props vyskoczilova)
107 |
108 | ## 1.2.0
109 |
110 | - added option to select the delay from the current time until the order can be picked up
111 | - added option to select the number of days ahead for allowing orders to be picked up
112 |
113 | ## 1.1.0
114 |
115 | - added `local_pickup_time_select_location` filter to customize location of pickup time select during checkout
116 | - added `local_pickup_time_admin_location` filter to customize location of pickup time shown in the admin Order Details screen
117 |
118 | ## 1.0.3
119 |
120 | - replace deprecated call to $order->order_custom_fields, which no longer words in WooCommerce 2.1
121 |
122 | ## 1.0.2
123 |
124 | - fix typos
125 |
126 | ## 1.0.1
127 |
128 | - properly set closing time if trying to order after hours
129 |
130 | ## 1.0.0
131 |
132 | - initial version
133 |
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | module.exports = function (grunt) {
2 | require("load-grunt-tasks")(grunt);
3 |
4 | // Project configuration.
5 | grunt.initConfig({
6 | pkg: grunt.file.readJSON("package.json"),
7 |
8 | composerBin: "vendor/bin",
9 |
10 | shell: {
11 | phpcs: {
12 | options: {
13 | stdout: true,
14 | },
15 | command: "<%= composerBin %>/phpcs",
16 | },
17 |
18 | phpcbf: {
19 | options: {
20 | stdout: true,
21 | },
22 | command: "<%= composerBin %>/phpcbf",
23 | },
24 |
25 | phpstan: {
26 | options: {
27 | stdout: true,
28 | },
29 | command: "<%= composerBin %>/phpstan analyze .",
30 | },
31 |
32 | phpunit: {
33 | options: {
34 | stdout: true,
35 | },
36 | command: "<%= composerBin %>/phpunit",
37 | },
38 | },
39 |
40 | gitinfo: {
41 | commands: {
42 | "local.tag.current.name": ["name-rev", "--tags", "--name-only", "HEAD"],
43 | "local.tag.current.nameLong": ["describe", "--tags", "--long"],
44 | },
45 | },
46 |
47 | clean: {
48 | main: ["dist"], //Clean up build folder
49 | },
50 |
51 | copy: {
52 | // Copy the plugin to a versioned release directory
53 | main: {
54 | src: [
55 | "**",
56 | "!*.xml",
57 | "!*.log", //any config/log files
58 | "!node_modules/**",
59 | "!Gruntfile.js",
60 | "!package.json",
61 | "!package-lock.json", //npm/Grunt
62 | "!.wordpress-org/**", //wp-org assets
63 | "!dist/**", //build directory
64 | "!.git/**", //version control
65 | "!.github/**", //GitHub platform files
66 | "!tests/**",
67 | "!scripts/**",
68 | "!phpunit.xml",
69 | "!phpunit.xml.dist", //unit testing
70 | "!vendor/**",
71 | "!composer.lock",
72 | "!composer.phar",
73 | "!composer.json", //composer
74 | "!wordpress/**",
75 | "!.*",
76 | "!**/*~", //hidden files
77 | "!CONTRIBUTING.md",
78 | "!README.md",
79 | "!phpcs.xml",
80 | "!phpcs.xml.dist",
81 | "!phpstan.neon.dist",
82 | "!grumphp.yml.dist", // CodeSniffer Configuration.
83 | "!docker-compose.override.yml", // Local Docker Development configuration.
84 | "!codecov.yml", // Code coverage configuration.
85 | "!tools/**", // Local Development/Build tools configuration.
86 | ],
87 | dest: "dist/",
88 | options: {
89 | processContentExclude: ["**/*.{png,gif,jpg,ico,mo}"],
90 | },
91 | },
92 | },
93 |
94 | addtextdomain: {
95 | options: {
96 | textdomain: "woocommerce-local-pickup-time-select", // Project text domain.
97 | },
98 | update_all_domains: {
99 | options: {
100 | updateDomains: true,
101 | },
102 | src: [
103 | "*.php",
104 | "**/*.php",
105 | "!node_modules/**",
106 | "!tests/**",
107 | "!tools/**",
108 | "!scripts/**",
109 | "!vendor/**",
110 | "!wordpress/**",
111 | ],
112 | },
113 | },
114 |
115 | wp_readme_to_markdown: {
116 | dest: {
117 | files: {
118 | "README.md": "readme.txt",
119 | },
120 | },
121 | },
122 |
123 | makepot: {
124 | target: {
125 | options: {
126 | domainPath: "/languages", // Where to save the POT file.
127 | exclude: [
128 | "node_modules/.*", //npm
129 | ".wordpress-org/.*", //wp-org assets
130 | ".devcontainer/.*",
131 | "dist/.*", //build directory
132 | ".git/.*", //version control
133 | ".github/.*", //GitHub platform
134 | "tests/.*",
135 | "scripts/.*", //unit testing
136 | "tools/.*",
137 | "vendor/.*", //composer
138 | "wordpress/.*",
139 | ], // List of files or directories to ignore.
140 | mainFile: "woocommerce-local-pickup-time.php", // Main project file.
141 | potFilename: "woocommerce-local-pickup-time.pot", // Name of the POT file.
142 | potHeaders: {
143 | poedit: true, // Includes common Poedit headers.
144 | "x-poedit-keywordslist": true, // Include a list of all possible gettext functions.
145 | }, // Headers to add to the generated POT file.
146 | type: "wp-plugin", // Type of project (wp-plugin or wp-theme).
147 | updateTimestamp: true, // Whether the POT-Creation-Date should be updated without other changes.
148 | updatePoFiles: true, // Whether to update PO files in the same directory as the POT file.
149 | },
150 | },
151 | },
152 |
153 | po2mo: {
154 | plugin: {
155 | src: "languages/*.po",
156 | expand: true,
157 | },
158 | },
159 |
160 | checkrepo: {
161 | deploy: {
162 | tagged: true, // Check that the last commit (HEAD) is tagged
163 | tag: {
164 | eq: "<%= pkg.version %>", // Check if highest repo tag is equal to pkg.version
165 | },
166 | },
167 | },
168 |
169 | checktextdomain: {
170 | options: {
171 | text_domain: "woocommerce-local-pickup-time-select",
172 | keywords: [
173 | "__:1,2d",
174 | "_e:1,2d",
175 | "_x:1,2c,3d",
176 | "esc_html__:1,2d",
177 | "esc_html_e:1,2d",
178 | "esc_html_x:1,2c,3d",
179 | "esc_attr__:1,2d",
180 | "esc_attr_e:1,2d",
181 | "esc_attr_x:1,2c,3d",
182 | "_ex:1,2c,3d",
183 | "_x:1,2c,3d",
184 | "_n:1,2,4d",
185 | "_nx:1,2,4c,5d",
186 | "_n_noop:1,2,3d",
187 | "_nx_noop:1,2,3c,4d",
188 | ],
189 | },
190 | files: {
191 | src: [
192 | "**/*.php",
193 | "!node_modules/**",
194 | "!dist/**",
195 | "!tests/**",
196 | "!tools/**",
197 | "!vendor/**",
198 | "!wordpress/**",
199 | "!*~",
200 | ],
201 | expand: true,
202 | },
203 | },
204 |
205 | // Bump version numbers
206 | version: {
207 | class: {
208 | options: {
209 | prefix: "const VERSION = '",
210 | },
211 | src: ["<%= pkg.name %>.php", "public/class-local-pickup-time.php"],
212 | },
213 | header: {
214 | options: {
215 | prefix: "\\* Version:\\s+",
216 | },
217 | src: ["<%= pkg.name %>.php"],
218 | },
219 | readme: {
220 | options: {
221 | prefix: "Stable tag:\\s+",
222 | },
223 | src: ["readme.txt"],
224 | },
225 | },
226 |
227 | wp_deploy: {
228 | deploy: {
229 | options: {
230 | plugin_slug: "woocommerce-local-pickup-time-select",
231 | plugin_main_file: "woocommerce-local-pickup-time.php",
232 | build_dir: "dist/",
233 | assets_dir: ".wordpress-org/",
234 | max_buffer: 1024 * 1024,
235 | skip_confirmation: false,
236 | },
237 | },
238 | },
239 | });
240 |
241 | grunt.registerTask("phpcs", ["shell:phpcs"]);
242 | grunt.registerTask("phpcbf", ["shell:phpcbf"]);
243 | grunt.registerTask("phpstan", ["shell:phpstan"]);
244 | grunt.registerTask("phpunit", ["shell:phpunit"]);
245 | grunt.registerTask("i18n", ["addtextdomain", "makepot", "po2mo"]);
246 | grunt.registerTask("readme", ["wp_readme_to_markdown"]);
247 | grunt.registerTask("test", ["checktextdomain"]);
248 | grunt.registerTask("build", ["gitinfo", "test", "i18n", "readme"]);
249 | grunt.registerTask("release", [
250 | "checkbranch:HEAD",
251 | "checkrepo",
252 | "gitinfo",
253 | "checktextdomain",
254 | "clean",
255 | "copy",
256 | ]);
257 | };
258 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # WooCommerce Local Pickup Time Select #
2 | **Contributors:** [tnolte](https://profiles.wordpress.org/tnolte/), [mjbanks](https://profiles.wordpress.org/mjbanks/), [vyskoczilova](https://profiles.wordpress.org/vyskoczilova/)
3 | **Donate link:** https://www.ndigitals.com/donate/
4 | **Tags:** woocommcerce, shipping, local pickup, checkout fields, ecommerce, e-commerce, wordpress ecommerce
5 | **Requires at least:** 4.9
6 | **Tested up to:** 6.0.1
7 | **Stable tag:** 1.4.2
8 | **Requires PHP:** 7.2
9 | **License:** GPLv2 or later
10 | **License URI:** http://www.gnu.org/licenses/gpl-2.0.html
11 |
12 | 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.
13 |
14 | ## Description ##
15 |
16 | Local Pickup Time extends the [WooCommerce](http://wordpress.org/plugins/woocommerce/) Local Pickup shipping option to allow users to choose a pickup time.
17 |
18 | 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.
19 |
20 | ### Features ###
21 |
22 | - **Daily Pickup Available Start/End Time:** Set the starting time and ending time for each day that pickups are available.
23 | - **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.
24 | - **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.
25 | - **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.
26 | - **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.
27 | - **Ability to limit to specific Shipping Zones.** Pickup Time can be limited to only specific Shipping Zones.
28 | - **"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.
29 | - **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".
30 |
31 | ## Installation ##
32 |
33 | ### Using The WordPress Dashboard ###
34 |
35 | 1. Navigate to the 'Add New' in the plugins dashboard
36 | 2. Search for 'WooCommerce Local Pickup Time Select'
37 | 3. Click 'Install Now'
38 | 4. Activate the plugin on the Plugin dashboard
39 |
40 | ### Uploading in WordPress Dashboard ###
41 |
42 | 1. Download a zip file of the plugins, which can be done from the WordPress plugin directory
43 | 2. Navigate to 'Add New' in the plugins dashboard
44 | 3. Click on the "Upload Plugin" button
45 | 4. Choose the downloaded Zip file from your computer with "Choose File"
46 | 5. Click 'Install Now'
47 | 6. Activate the plugin in the Plugin dashboard
48 |
49 | ### Using FTP ###
50 |
51 | 1. Download a zip file of the plugins, which can be done from the WordPress plugin directory
52 | 2. Extract the Zip file to a directory on your computer
53 | 3. Upload the `woocommerce-local-pickup-time-select` directory to the `/wp-content/plugins/` directory
54 | 4. Activate the plugin in the Plugin dashboard
55 |
56 | # Usage #
57 |
58 | 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.
59 |
60 | ## Frequently Asked Questions ##
61 |
62 | ### Things aren't displaying properly ###
63 |
64 | - Go to `WooCommerce -> Settings -> Shipping -> Local Pickup Time settings` and "Save Changes" to trigger the options to update.
65 | - Make sure to set your Timezone on the WordPress Admin Settings page to a proper value that is not a UTC offset.
66 | - 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.
67 |
68 | ### How do I change the location of the pickup time select box during checkout? ###
69 |
70 | The location, by default, is hooked to `woocommerce_after_order_notes`. This can be overridden using the `local_pickup_time_select_location` filter. [A list of available hooks can be seen in the WooCommerce documentation](http://docs.woothemes.com/document/hooks/).
71 |
72 | ### How do I change the location of the pickup time shown in the admin Order Details screen? ###
73 |
74 | The location, by default, is hooked to `woocommerce_admin_order_data_after_billing_address`. This can be overridden using the `local_pickup_time_admin_location` filter. [A list of available hooks can be seen in the WooCommerce documentation](http://docs.woothemes.com/document/hooks/).
75 |
76 | ## Screenshots ##
77 |
78 | 1. Frontend Display on Checkout Page
79 | 2. Shipping Settings -> Local Pickup Time Settings Screen
80 | 3. Local Pickup Shipping Method Settings Screen
81 | 4. Order Listing Includes Pickup Date/Time
82 | 5. Order Details Screen Includes Pickup Date/Time
83 | 6. Ready for Pickup Order Email Notification
84 |
85 | ## Changelog ##
86 |
87 | ### 1.4.2
88 | #### Fixed
89 | - Checkout prevented on non-Local Shipping methods.
90 | - Updated WordPress Supported Versions.
91 |
92 | ### 1.4.1
93 | #### Changed
94 | - Updated the README to provide details and usage on the latest functionality and features.
95 |
96 | #### Fixed
97 | - Possible PHP Fatal Error when using new Local Pickup association functionality.
98 |
99 | #### Added
100 | - Added new screenshot for "Ready for Pickup" email notification.
101 |
102 | ### 1.4.0
103 | #### Changed
104 | - Updated WordPress & WooCommerce Supported Versions.
105 |
106 | #### Fixed
107 | - Updated Plugin Development Dependencies
108 |
109 | #### Added
110 | - Added New Ready for Pickup Order Status & Customer Email
111 | - Added Pickup Time Required & Local Pickup Link Capabilities
112 |
113 | --------
114 |
115 | [See the previous changelogs here](https://github.com/WC-Local-Pickup/woocommerce-local-pickup-time/blob/main/CHANGELOG.md#changelog)
116 |
--------------------------------------------------------------------------------
/admin/class-local-pickup-time-admin.php:
--------------------------------------------------------------------------------
1 | plugin = Local_Pickup_Time::get_instance();
43 |
44 | /*
45 | * Add settings quicklink to plugin entry in the plugins list.
46 | */
47 | add_filter( 'plugin_action_links_' . WCLOCALPICKUPTIME_PLUGIN_BASE, array( $this, 'plugin_action_links' ) );
48 |
49 | /*
50 | * Show Pickup Time Settings in the WooCommerce -> Shipping Screen
51 | */
52 | add_filter( 'woocommerce_get_sections_shipping', array( $this, 'plugin_add_settings_section' ) );
53 | add_filter( 'woocommerce_get_settings_shipping', array( $this, 'plugin_settings' ), 10, 2 );
54 |
55 | /*
56 | * Add Local Pickup Time enabled argument to Local Pickup Shipping methods.
57 | */
58 | add_filter( 'woocommerce_shipping_method_add_rate_args', array( $this, 'shipping_method_add_rate_pickup_time_args' ) );
59 |
60 | /*
61 | * Add an option to bind the Local Pickup Time to Local Pickup shipping methods.
62 | */
63 | add_filter( 'woocommerce_shipping_methods', array( $this, 'shipping_methods_settings_override' ) );
64 |
65 | /*
66 | * Add support for a Ready for Pickup Order Status.
67 | */
68 | add_action( 'init', array( $this, 'register_post_status' ) );
69 | add_filter( 'wc_order_statuses', array( $this, 'wc_order_statuses' ), 10, 1 );
70 | add_filter( 'bulk_actions-edit-shop_order', array( $this, 'add_bulk_actions_edit_shop_order' ), 50, 1 );
71 | add_filter( 'woocommerce_email_actions', array( $this, 'woocommerce_email_actions' ) );
72 | add_filter( 'woocommerce_email_classes', array( $this, 'woocommerce_email_classes' ) );
73 |
74 | /*
75 | * Show Pickup Time in the Order Details in the Admin Screen
76 | */
77 | $admin_hooked_location = apply_filters( 'local_pickup_time_admin_location', 'woocommerce_admin_order_data_after_billing_address' );
78 | add_action( $admin_hooked_location, array( $this, 'show_metabox' ), 10, 1 );
79 |
80 | /*
81 | * Show Pickup Time in the Orders List in the Admin Dashboard.
82 | */
83 | add_filter( 'manage_edit-shop_order_columns', array( $this, 'add_orders_list_pickup_date_column_header' ) );
84 | add_action( 'manage_shop_order_posts_custom_column', array( $this, 'add_orders_list_pickup_date_column_content' ) );
85 | add_filter( 'manage_edit-shop_order_sortable_columns', array( $this, 'add_orders_list_pickup_date_column_sorting' ) );
86 | add_filter( 'pre_get_posts', array( $this, 'filter_orders_list_by_pickup_date' ) );
87 | }
88 |
89 | /**
90 | * Return an instance of this class.
91 | *
92 | * @since 1.0.0
93 | *
94 | * @return object A single instance of this class.
95 | */
96 | public static function get_instance() {
97 |
98 | // If the single instance hasn't been set, set it now.
99 | if ( null === self::$instance ) {
100 | self::$instance = new self();
101 | }
102 |
103 | return self::$instance;
104 | }
105 |
106 | /**
107 | * Add plugin Settings page link to plugin actions.
108 | *
109 | * @link https://developer.wordpress.org/reference/hooks/plugin_action_links_plugin_file/
110 | *
111 | * @since 1.4.0
112 | *
113 | * @param string[] $actions The plugin action links.
114 | *
115 | * @return string[]
116 | */
117 | public function plugin_action_links( $actions ) {
118 |
119 | $settings_link = '' . __( 'Settings', 'woocommerce-local-pickup-time-select' ) . '';
120 |
121 | array_unshift( $actions, $settings_link );
122 |
123 | return $actions;
124 | }
125 |
126 | /**
127 | * Add Pickup Time Settings section on the WooCommerce->Shipping settings Admin screen.
128 | *
129 | * @link https://woocommerce.com/document/adding-a-section-to-a-settings-tab/
130 | *
131 | * @since 1.4.0
132 | *
133 | * @param array $sections The array of Settings screen sections.
134 | *
135 | * @return array
136 | */
137 | public function plugin_add_settings_section( $sections ) {
138 |
139 | $sections[ $this->plugin->get_plugin_slug() ] = __( 'Local Pickup Time settings', 'woocommerce-local-pickup-time-select' );
140 |
141 | return $sections;
142 | }
143 |
144 | /**
145 | * Show Pickup Time Settings in the WooCommerce -> General Admin Screen
146 | *
147 | * @since 1.0.0
148 | *
149 | * @param array $settings The array of WooCommerce General Plugin Settings.
150 | * @param string $current_section The plugin settings section.
151 | *
152 | * @return array
153 | */
154 | public function plugin_settings( $settings, $current_section ) {
155 |
156 | if ( $this->plugin->get_plugin_slug() === $current_section ) {
157 | $plugin_settings = array();
158 |
159 | $plugin_settings = array(
160 | array(
161 | 'title' => __( 'Store Hours for Local Pickup', 'woocommerce-local-pickup-time-select' ),
162 | 'type' => 'title',
163 | 'desc' => __( 'The following options affect when order pickups begin and end each day, and which days to not allow order pickups.', 'woocommerce-local-pickup-time-select' ),
164 | 'id' => 'local_pickup_hours',
165 | ),
166 | array(
167 | 'title' => __( 'Monday Pickup Start Time', 'woocommerce-local-pickup-time-select' ),
168 | 'desc' => __( 'This sets the pickup start time for Monday. Use 24-hour time format.', 'woocommerce-local-pickup-time-select' ),
169 | 'id' => 'local_pickup_hours_monday_start',
170 | 'css' => 'width:120px;',
171 | 'default' => '10:00',
172 | 'type' => 'time',
173 | 'desc_tip' => true,
174 | ),
175 | array(
176 | 'title' => __( 'Monday Pickup End Time', 'woocommerce-local-pickup-time-select' ),
177 | 'desc' => __( 'This sets the pickup end time for Monday. Use 24-hour time format.', 'woocommerce-local-pickup-time-select' ),
178 | 'id' => 'local_pickup_hours_monday_end',
179 | 'css' => 'width:120px;',
180 | 'default' => '19:00',
181 | 'type' => 'time',
182 | 'desc_tip' => true,
183 | ),
184 | array(
185 | 'title' => __( 'Tuesday Pickup Start Time', 'woocommerce-local-pickup-time-select' ),
186 | 'desc' => __( 'This sets the pickup start time for Tuesday. Use 24-hour time format.', 'woocommerce-local-pickup-time-select' ),
187 | 'id' => 'local_pickup_hours_tuesday_start',
188 | 'css' => 'width:120px;',
189 | 'default' => '10:00',
190 | 'type' => 'time',
191 | 'desc_tip' => true,
192 | ),
193 | array(
194 | 'title' => __( 'Tuesday Pickup End Time', 'woocommerce-local-pickup-time-select' ),
195 | 'desc' => __( 'This sets the pickup end time for Tuesday. Use 24-hour time format.', 'woocommerce-local-pickup-time-select' ),
196 | 'id' => 'local_pickup_hours_tuesday_end',
197 | 'css' => 'width:120px;',
198 | 'default' => '19:00',
199 | 'type' => 'time',
200 | 'desc_tip' => true,
201 | ),
202 | array(
203 | 'title' => __( 'Wednesday Pickup Start Time', 'woocommerce-local-pickup-time-select' ),
204 | 'desc' => __( 'This sets the pickup start time for Wednesday. Use 24-hour time format.', 'woocommerce-local-pickup-time-select' ),
205 | 'id' => 'local_pickup_hours_wednesday_start',
206 | 'css' => 'width:120px;',
207 | 'default' => '10:00',
208 | 'type' => 'time',
209 | 'desc_tip' => true,
210 | ),
211 | array(
212 | 'title' => __( 'Wednesday Pickup End Time', 'woocommerce-local-pickup-time-select' ),
213 | 'desc' => __( 'This sets the pickup end time for Wednesday. Use 24-hour time format.', 'woocommerce-local-pickup-time-select' ),
214 | 'id' => 'local_pickup_hours_wednesday_end',
215 | 'css' => 'width:120px;',
216 | 'default' => '19:00',
217 | 'type' => 'time',
218 | 'desc_tip' => true,
219 | ),
220 | array(
221 | 'title' => __( 'Thursday Pickup Start Time', 'woocommerce-local-pickup-time-select' ),
222 | 'desc' => __( 'This sets the pickup start time for Thursday. Use 24-hour time format.', 'woocommerce-local-pickup-time-select' ),
223 | 'id' => 'local_pickup_hours_thursday_start',
224 | 'css' => 'width:120px;',
225 | 'default' => '10:00',
226 | 'type' => 'time',
227 | 'desc_tip' => true,
228 | ),
229 | array(
230 | 'title' => __( 'Thursday Pickup End Time', 'woocommerce-local-pickup-time-select' ),
231 | 'desc' => __( 'This sets the pickup end time for Thursday. Use 24-hour time format.', 'woocommerce-local-pickup-time-select' ),
232 | 'id' => 'local_pickup_hours_thursday_end',
233 | 'css' => 'width:120px;',
234 | 'default' => '19:00',
235 | 'type' => 'time',
236 | 'desc_tip' => true,
237 | ),
238 | array(
239 | 'title' => __( 'Friday Pickup Start Time', 'woocommerce-local-pickup-time-select' ),
240 | 'desc' => __( 'This sets the pickup start time for Friday. Use 24-hour time format.', 'woocommerce-local-pickup-time-select' ),
241 | 'id' => 'local_pickup_hours_friday_start',
242 | 'css' => 'width:120px;',
243 | 'default' => '10:00',
244 | 'type' => 'time',
245 | 'desc_tip' => true,
246 | ),
247 | array(
248 | 'title' => __( 'Friday Pickup End Time', 'woocommerce-local-pickup-time-select' ),
249 | 'desc' => __( 'This sets the pickup end time for Friday. Use 24-hour time format.', 'woocommerce-local-pickup-time-select' ),
250 | 'id' => 'local_pickup_hours_friday_end',
251 | 'css' => 'width:120px;',
252 | 'default' => '19:00',
253 | 'type' => 'time',
254 | 'desc_tip' => true,
255 | ),
256 | array(
257 | 'title' => __( 'Saturday Pickup Start Time', 'woocommerce-local-pickup-time-select' ),
258 | 'desc' => __( 'This sets the pickup start time for Saturday. Use 24-hour time format.', 'woocommerce-local-pickup-time-select' ),
259 | 'id' => 'local_pickup_hours_saturday_start',
260 | 'css' => 'width:120px;',
261 | 'default' => '10:00',
262 | 'type' => 'time',
263 | 'desc_tip' => true,
264 | ),
265 | array(
266 | 'title' => __( 'Saturday Pickup End Time', 'woocommerce-local-pickup-time-select' ),
267 | 'desc' => __( 'This sets the pickup end time for Saturday. Use 24-hour time format.', 'woocommerce-local-pickup-time-select' ),
268 | 'id' => 'local_pickup_hours_saturday_end',
269 | 'css' => 'width:120px;',
270 | 'default' => '19:00',
271 | 'type' => 'time',
272 | 'desc_tip' => true,
273 | ),
274 | array(
275 | 'title' => __( 'Sunday Pickup Start Time', 'woocommerce-local-pickup-time-select' ),
276 | 'desc' => __( 'This sets the pickup start time for Sunday. Use 24-hour time format.', 'woocommerce-local-pickup-time-select' ),
277 | 'id' => 'local_pickup_hours_sunday_start',
278 | 'css' => 'width:120px;',
279 | 'default' => '10:00',
280 | 'type' => 'time',
281 | 'desc_tip' => true,
282 | ),
283 | array(
284 | 'title' => __( 'Sunday Pickup End Time', 'woocommerce-local-pickup-time-select' ),
285 | 'desc' => __( 'This sets the pickup end time for Sunday. Use 24-hour time format.', 'woocommerce-local-pickup-time-select' ),
286 | 'id' => 'local_pickup_hours_sunday_end',
287 | 'css' => 'width:120px;',
288 | 'default' => '19:00',
289 | 'type' => 'time',
290 | 'desc_tip' => true,
291 | ),
292 | array(
293 | 'type' => 'sectionend',
294 | 'id' => 'local_pickup_hours',
295 | ),
296 | array(
297 | 'title' => __( 'Store Closed for Local Pickup', 'woocommerce-local-pickup-time-select' ),
298 | 'type' => 'title',
299 | 'desc' => __( 'The following options affect which days to not allow order pickups.', 'woocommerce-local-pickup-time-select' ),
300 | 'id' => 'local_pickup_closed',
301 | ),
302 | array(
303 | 'title' => __( 'Store Closing Days (use MM/DD/YYYY format)', 'woocommerce-local-pickup-time-select' ),
304 | 'desc' => __( 'This sets the days the store is closed. Enter one date per line, in format MM/DD/YYYY.', 'woocommerce-local-pickup-time-select' ),
305 | 'id' => 'local_pickup_hours_closings',
306 | 'css' => 'width:250px;height:150px;',
307 | 'default' => '01/01/2014',
308 | 'type' => 'textarea',
309 | 'desc_tip' => true,
310 | ),
311 | array(
312 | 'type' => 'sectionend',
313 | 'id' => 'local_pickup_closed',
314 | ),
315 | array(
316 | 'title' => __( 'Order Pickup Intervals & Delays', 'woocommerce-local-pickup-time-select' ),
317 | 'type' => 'title',
318 | 'desc' => __( 'The following options are used to calculate the available time slots for pickup.', 'woocommerce-local-pickup-time-select' ),
319 | 'id' => 'local_pickup_time_slots',
320 | ),
321 | array(
322 | 'title' => __( 'Pickup Time Interval', 'woocommerce-local-pickup-time-select' ),
323 | 'desc' => __( 'Choose the time interval for allowing local pickup orders.', 'woocommerce-local-pickup-time-select' ),
324 | 'id' => 'local_pickup_hours_interval',
325 | 'css' => 'width:100px;',
326 | 'default' => '30',
327 | 'type' => 'select',
328 | 'class' => 'chosen_select',
329 | 'desc_tip' => true,
330 | 'options' => array(
331 | '5' => __( '5 minutes', 'woocommerce-local-pickup-time-select' ),
332 | '10' => __( '10 minutes', 'woocommerce-local-pickup-time-select' ),
333 | '15' => __( '15 minutes', 'woocommerce-local-pickup-time-select' ),
334 | '20' => __( '20 minutes', 'woocommerce-local-pickup-time-select' ),
335 | '30' => __( '30 minutes', 'woocommerce-local-pickup-time-select' ),
336 | '45' => __( '45 minutes', 'woocommerce-local-pickup-time-select' ),
337 | '60' => __( '1 hour', 'woocommerce-local-pickup-time-select' ),
338 | '120' => __( '2 hours', 'woocommerce-local-pickup-time-select' ),
339 | ),
340 | ),
341 | array(
342 | 'title' => __( 'Pickup Time Delay', 'woocommerce-local-pickup-time-select' ),
343 | 'desc' => __( 'Choose the time delay from the time of ordering for allowing local pickup orders.', 'woocommerce-local-pickup-time-select' ),
344 | 'id' => 'local_pickup_delay_minutes',
345 | 'css' => 'width:100px;',
346 | 'default' => '60',
347 | 'type' => 'select',
348 | 'class' => 'chosen_select',
349 | 'desc_tip' => true,
350 | 'options' => array(
351 | '5' => __( '5 minutes', 'woocommerce-local-pickup-time-select' ),
352 | '10' => __( '10 minutes', 'woocommerce-local-pickup-time-select' ),
353 | '15' => __( '15 minutes', 'woocommerce-local-pickup-time-select' ),
354 | '20' => __( '20 minutes', 'woocommerce-local-pickup-time-select' ),
355 | '30' => __( '30 minutes', 'woocommerce-local-pickup-time-select' ),
356 | '45' => __( '45 minutes', 'woocommerce-local-pickup-time-select' ),
357 | '60' => __( '1 hour', 'woocommerce-local-pickup-time-select' ),
358 | '120' => __( '2 hours', 'woocommerce-local-pickup-time-select' ),
359 | '240' => __( '4 hours', 'woocommerce-local-pickup-time-select' ),
360 | '480' => __( '8 hours', 'woocommerce-local-pickup-time-select' ),
361 | '960' => __( '16 hours', 'woocommerce-local-pickup-time-select' ),
362 | '1440' => __( '24 hours', 'woocommerce-local-pickup-time-select' ),
363 | '2160' => __( '36 hours', 'woocommerce-local-pickup-time-select' ),
364 | '2880' => __( '48 hours', 'woocommerce-local-pickup-time-select' ),
365 | '4320' => __( '3 days', 'woocommerce-local-pickup-time-select' ),
366 | '7200' => __( '5 days', 'woocommerce-local-pickup-time-select' ),
367 | '10080' => __( '1 week', 'woocommerce-local-pickup-time-select' ),
368 | ),
369 | ),
370 | array(
371 | 'title' => __( 'Pickup Time Open Days Ahead', 'woocommerce-local-pickup-time-select' ),
372 | 'desc' => __( 'Choose the number of open days ahead for allowing local pickup orders. This is inclusive of the current day, if timeslots are still available.', 'woocommerce-local-pickup-time-select' ),
373 | 'id' => 'local_pickup_days_ahead',
374 | 'css' => 'width:100px;',
375 | 'default' => '1',
376 | 'type' => 'number',
377 | 'input_attrs' => array(
378 | 'min' => 0,
379 | 'step' => 1,
380 | ),
381 | 'desc_tip' => true,
382 | ),
383 | array(
384 | 'type' => 'sectionend',
385 | 'id' => 'local_pickup_time_slots',
386 | ),
387 | array(
388 | 'title' => __( 'Additional Settings', 'woocommerce-local-pickup-time-select' ),
389 | 'type' => 'title',
390 | 'desc' => __( 'The following options provide additional capabilities for customization.', 'woocommerce-local-pickup-time-select' ),
391 | 'id' => 'local_pickup_additional',
392 | ),
393 | array(
394 | 'title' => __( 'Require Checkout Pickup Time?', 'woocommerce-local-pickup-time-select' ),
395 | 'label' => __( 'Required', 'woocommerce-local-pickup-time-select' ),
396 | 'desc' => __( 'This controls whether a Pickup Time is required during checkout.', 'woocommerce-local-pickup-time-select' ),
397 | 'id' => 'checkout_time_req',
398 | 'type' => 'checkbox',
399 | 'checkboxgroup' => 'start',
400 | 'default' => 'yes',
401 | 'desc_tip' => true,
402 | ),
403 | array(
404 | 'title' => __( 'Limit to Local Pickup Shipping Methods?', 'woocommerce-local-pickup-time-select' ),
405 | 'label' => __( 'Limit', 'woocommerce-local-pickup-time-select' ),
406 | 'desc' => __( 'This controls whether Local Pickup Times are restricted to Local Shipping methods. This requires enabling "Pickup Time" on each individual Local Pickup Shipping method, within each Shiping Zone.', 'woocommerce-local-pickup-time-select' ),
407 | 'id' => 'local_pickup_only',
408 | 'type' => 'checkbox',
409 | 'checkboxgroup' => 'start',
410 | 'default' => 'no',
411 | 'desc_tip' => true,
412 | ),
413 | array(
414 | 'type' => 'sectionend',
415 | 'id' => 'local_pickup_additional',
416 | ),
417 | );
418 |
419 | return $plugin_settings;
420 |
421 | }
422 |
423 | return $settings;
424 | }
425 |
426 | /**
427 | * Optionally adds the Local Pickup Time enabling option to a Local Pickup Shipping method.
428 | *
429 | * @since 1.4.0
430 | *
431 | * @param array $shipping_methods An array of WC_Shipping methods.
432 | *
433 | * @return array
434 | */
435 | public function shipping_methods_settings_override( $shipping_methods ) {
436 |
437 | if ( 'yes' === $this->plugin->get_local_pickup_only() ) {
438 | foreach ( $shipping_methods as $shipping_method => $class_name ) {
439 | if ( 'local_pickup' === $shipping_method ) {
440 | add_filter( 'woocommerce_shipping_instance_form_fields_' . $shipping_method, array( $this, 'shipping_instance_form_add_extra_fields' ) );
441 | }
442 | }
443 | }
444 |
445 | return $shipping_methods;
446 | }
447 |
448 | /**
449 | * Adds a Local Pickup Time flag to a shipping method.
450 | *
451 | * @since 1.4.0
452 | *
453 | * @param array $fields The array of settings fields.
454 | *
455 | * @return array
456 | */
457 | public function shipping_instance_form_add_extra_fields( $fields ) {
458 |
459 | $fields['wclpt_shipping_method_enabled'] = array(
460 | 'title' => __( 'Pickup Time', 'woocommerce-local-pickup-time-select' ),
461 | 'label' => __( 'Enable', 'woocommerce-local-pickup-time-select' ),
462 | 'description' => __( 'This controls whether a Pickup Time is tied to the shipping method.', 'woocommerce-local-pickup-time-select' ),
463 | 'type' => 'checkbox',
464 | 'checkboxgroup' => 'start',
465 | 'default' => 'no',
466 | 'desc_tip' => true,
467 | );
468 |
469 | return $fields;
470 | }
471 |
472 | /**
473 | * Support processing the Local Pickup Time enabled option on Local Pickup shipping instances.
474 | *
475 | * @since 1.4.0
476 | *
477 | * @param array $args The shipping method arguments.
478 | * @param WC_Shipping_Method|null $shipping_method The WC_Shipping_Method instance object.
479 | *
480 | * @return array
481 | */
482 | public function shipping_method_add_rate_pickup_time_args( $args, $shipping_method = null ) {
483 |
484 | if ( empty( $shipping_method ) ) {
485 | return $args;
486 | }
487 |
488 | if ( 'yes' === $this->plugin->get_local_pickup_only() && 'local_pickup' === $shipping_method->get_rate_id() ) {
489 | $args['meta_data']['wclpt_shipping_method_enabled'] = $shipping_method->get_option( 'wclpt_shipping_method_enabled' );
490 | }
491 |
492 | return $args;
493 | }
494 |
495 | /**
496 | * Add a post status for Ready for Pickup for WooCommerce.
497 | *
498 | * @since 1.4.0
499 | *
500 | * @return void
501 | */
502 | public function register_post_status() {
503 | register_post_status(
504 | 'wc-ready-for-pickup',
505 | array(
506 | 'label' => _x( 'Ready for Pickup', 'Order status', 'woocommerce-local-pickup-time-select' ),
507 | 'public' => true,
508 | 'exclude_from_search' => false,
509 | 'show_in_admin_all_list' => true,
510 | 'show_in_admin_status_list' => true,
511 | /* translators: %s: number of orders */
512 | 'label_count' => _n_noop( 'Ready for Pickup (%s)', 'Ready for Pickup (%s)', 'woocommerce-local-pickup-time-select' ),
513 | )
514 | );
515 | }
516 |
517 | /**
518 | * Add a Ready for Pickup Order Status to WooCommerce.
519 | *
520 | * @since 1.4.0
521 | *
522 | * @param array $order_statuses The array of WooCommerce Order Statuses.
523 | *
524 | * @return array
525 | */
526 | public function wc_order_statuses( $order_statuses ) {
527 |
528 | $order_statuses['wc-ready-for-pickup'] = _x( 'Ready for Pickup', 'Order status', 'woocommerce-local-pickup-time-select' );
529 |
530 | return $order_statuses;
531 | }
532 |
533 | /**
534 | * Add a bulk order action to change statuses to Ready for Pickup.
535 | *
536 | * @since 1.4.0
537 | *
538 | * @param array $actions The array of bulk order actions from the Order listing.
539 | *
540 | * @return array
541 | */
542 | public function add_bulk_actions_edit_shop_order( $actions ) {
543 |
544 | $actions['mark_ready-for-pickup'] = __( 'Change status to ready for pickup', 'woocommerce-local-pickup-time-select' );
545 |
546 | return $actions;
547 | }
548 |
549 | /**
550 | * Add a Ready for Pickup Order Status email action to WooCommerce..
551 | *
552 | * @since 1.4.0
553 | *
554 | * @param array $email_actions The array of transactional emails in WooCommerce.
555 | *
556 | * @return array
557 | */
558 | public function woocommerce_email_actions( $email_actions ) {
559 |
560 | $email_actions[] = 'woocommerce_order_status_ready-for-pickup';
561 |
562 | return $email_actions;
563 | }
564 |
565 | /**
566 | * Add a Ready for Pickup Order Status email class to WooCommerce.
567 | *
568 | * @since 1.4.0
569 | *
570 | * @param array $email_classes The array of email class files.
571 | *
572 | * @return array
573 | */
574 | public function woocommerce_email_classes( $email_classes ) {
575 |
576 | $email_classes['WC_Email_Customer_Ready_For_Pickup_Order'] = include __DIR__ . '/emails/class-wc-email-customer-ready-for-pickup-order.php';
577 |
578 | return $email_classes;
579 | }
580 |
581 | /**
582 | * Show Pickup Time in the Order Details in the Admin Screen
583 | *
584 | * @since 1.0.0
585 | *
586 | * @param WC_Order $order The order object.
587 | *
588 | * @return void
589 | */
590 | public function show_metabox( $order ) {
591 |
592 | $order_meta = get_post_custom( $order->get_id() );
593 | $pickup_time = '';
594 | if ( is_array( $order_meta ) ) {
595 | $pickup_time = $order_meta[ $this->plugin->get_order_meta_key() ][0];
596 | }
597 |
598 | $allowed_html = array(
599 | 'p' => array(),
600 | 'strong' => array(),
601 | );
602 |
603 | echo wp_kses( '' . __( 'Pickup Time:', 'woocommerce-local-pickup-time-select' ) . ' ' . esc_html( $this->pickup_time_select_translatable( $pickup_time ) ) . '
', $allowed_html );
604 | }
605 |
606 | /**
607 | * Show Pickup Time on Orders List in Admin Dashboard.
608 | *
609 | * @since 1.3.2
610 | *
611 | * @param array $columns The Orders List columns array.
612 | * @return array $new_columns The updated Orders List columns array.
613 | */
614 | public function add_orders_list_pickup_date_column_header( $columns ) {
615 |
616 | $new_columns = array();
617 |
618 | foreach ( $columns as $column_name => $column_info ) {
619 |
620 | $new_columns[ $column_name ] = $column_info;
621 |
622 | if ( 'order_date' === $column_name ) {
623 | $new_columns[ $this->plugin->get_order_meta_key() ] = __( 'Pickup Time', 'woocommerce-local-pickup-time-select' );
624 | }
625 | }
626 |
627 | return $new_columns;
628 | }
629 |
630 | /**
631 | * Show Pickup Time content on the Orders List in the Admin Dashboard.
632 | *
633 | * @since 1.3.2
634 | *
635 | * @param string $column The column name in the Orders List.
636 | *
637 | * @return void
638 | */
639 | public function add_orders_list_pickup_date_column_content( $column ) {
640 |
641 | global $the_order;
642 |
643 | if ( $this->plugin->get_order_meta_key() === $column ) {
644 | echo esc_html( $this->pickup_time_select_translatable( $the_order->get_meta( $this->plugin->get_order_meta_key() ) ) );
645 | }
646 | }
647 |
648 | /**
649 | * Allow the Pickup Time columns to be sortable on the Orders List in the Admin Dashboard.
650 | *
651 | * @since 1.3.2
652 | *
653 | * @param array $columns The array of Order columns.
654 | * @return array The updated array Order columns.
655 | */
656 | public function add_orders_list_pickup_date_column_sorting( $columns ) {
657 |
658 | $new_columns = array();
659 | $new_columns[ $this->plugin->get_order_meta_key() ] = 'pickup_time';
660 |
661 | return wp_parse_args( $new_columns, $columns );
662 | }
663 |
664 | /**
665 | * Adds Local Pickup Time sorting to the query of the Orders List.
666 | *
667 | * @since 1.3.2
668 | *
669 | * @param WP_Query $query The posts query object.
670 | * @return WP_Query $query The modified query object.
671 | */
672 | public function filter_orders_list_by_pickup_date( $query ) {
673 |
674 | if ( is_admin() && 'shop_order' === $query->query_vars['post_type'] && ! empty( $_GET['orderby'] ) && 'pickup_time' === $_GET['orderby'] ) {
675 | $order = ( ! empty( $_GET['order'] ) ) ? strtoupper( sanitize_key( $_GET['order'] ) ) : 'ASC';
676 | $query->set( 'meta_key', $this->plugin->get_order_meta_key() );
677 | $query->set( 'orderby', 'meta_value_num' );
678 | $query->set( 'order', $order );
679 | }
680 |
681 | return $query;
682 | }
683 |
684 | /**
685 | * Show Pickup Time content on the Order Preview in the Admin Dashboard.
686 | *
687 | * @since 1.3.2
688 | *
689 | * @param WC_Order|array $order_details The array of order data.
690 | * @return WC_Order|array The order details array.
691 | */
692 | public function woocommerce_admin_order_preview_get_order_details( $order_details ) {
693 |
694 | return $order_details;
695 | }
696 |
697 | /**
698 | * Return translatable pickup time
699 | *
700 | * @since 1.3.0
701 | *
702 | * @param string $value The pikcup time meta value for an order.
703 | * @return string The translated value of the order pickup time.
704 | */
705 | public function pickup_time_select_translatable( $value ) {
706 |
707 | // Get an instance of the Public plugin.
708 | $plugin = Local_Pickup_Time::get_instance();
709 |
710 | // Call the Public plugin instance of this method to reduce code redundancy.
711 | return $plugin->pickup_time_select_translatable( $value );
712 | }
713 | }
714 |
--------------------------------------------------------------------------------
/admin/emails/class-wc-email-customer-ready-for-pickup-order.php:
--------------------------------------------------------------------------------
1 | id = 'customer_ready_for_pickup_order';
29 | $this->customer_email = true;
30 | $this->title = __( 'Ready for Pickup order', 'woocommerce-local-pickup-time-select' );
31 | $this->description = __( 'Order ready for pickup emails are sent to the customer when the order is marked Ready for Pickup.', 'woocommerce-local-pickup-time-select' );
32 | $this->template_base = WCLOCALPICKUPTIME_PLUGIN_DIR . 'templates/';
33 | $this->template_html = 'emails/customer-ready-for-pickup-order.php';
34 | $this->template_plain = 'emails/plain/customer-ready-for-pickup-order.php';
35 | $this->placeholders = array(
36 | '{order_date}' => '',
37 | '{order_number}' => '',
38 | );
39 |
40 | // Triggers for this email.
41 | add_action( 'woocommerce_order_status_ready-for-pickup_notification', array( $this, 'trigger' ), 10, 2 );
42 |
43 | // Call parent constructor.
44 | parent::__construct();
45 | }
46 |
47 | /**
48 | * Trigger the sending of this email.
49 | *
50 | * @param int $order_id The order ID.
51 | * @param object|WC_Order|null $order Order object.
52 | *
53 | * @return void
54 | */
55 | public function trigger( $order_id, $order = null ) {
56 | $this->setup_locale();
57 |
58 | if ( ! empty( $order_id ) && empty( $order ) ) {
59 | $order = wc_get_order( $order_id );
60 | }
61 |
62 | if ( ! empty( $order ) && is_object( $order ) && is_a( $order, 'WC_Order' ) ) {
63 | $this->object = $order;
64 | $this->recipient = $this->object->get_billing_email();
65 | $this->placeholders['{order_date}'] = ! empty( $this->object->get_date_created() ) ? wc_format_datetime( $this->object->get_date_created() ) : 'Unknown';
66 | $this->placeholders['{order_number}'] = $this->object->get_order_number();
67 | }
68 |
69 | if ( is_object( $order ) && $this->is_enabled() && $this->get_recipient() ) {
70 | $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
71 | }
72 |
73 | $this->restore_locale();
74 | }
75 |
76 | /**
77 | * Get email subject.
78 | *
79 | * @since 3.1.0
80 | * @return string
81 | */
82 | public function get_default_subject() {
83 | return __( 'Your {site_title} order is now ready for pickup', 'woocommerce-local-pickup-time-select' );
84 | }
85 |
86 | /**
87 | * Get email heading.
88 | *
89 | * @since 3.1.0
90 | * @return string
91 | */
92 | public function get_default_heading() {
93 | return __( 'We look forward to your arrival', 'woocommerce-local-pickup-time-select' );
94 | }
95 |
96 | /**
97 | * Get content html.
98 | *
99 | * @return string
100 | */
101 | public function get_content_html() {
102 | return wc_get_template_html(
103 | $this->template_html,
104 | array(
105 | 'order' => $this->object,
106 | 'email_heading' => $this->get_heading(),
107 | 'additional_content' => $this->get_additional_content(),
108 | 'sent_to_admin' => false,
109 | 'plain_text' => false,
110 | 'email' => $this,
111 | ),
112 | '',
113 | $this->template_base
114 | );
115 | }
116 |
117 | /**
118 | * Get content plain.
119 | *
120 | * @return string
121 | */
122 | public function get_content_plain() {
123 | return wc_get_template_html(
124 | $this->template_plain,
125 | array(
126 | 'order' => $this->object,
127 | 'email_heading' => $this->get_heading(),
128 | 'additional_content' => $this->get_additional_content(),
129 | 'sent_to_admin' => false,
130 | 'plain_text' => true,
131 | 'email' => $this,
132 | ),
133 | '',
134 | $this->template_base
135 | );
136 | }
137 |
138 | /**
139 | * Default content to show below main email content.
140 | *
141 | * @since 3.7.0
142 | * @return string
143 | */
144 | public function get_default_additional_content() {
145 | return __( 'We look forward to your pending arrival.', 'woocommerce-local-pickup-time-select' );
146 | }
147 | }
148 |
149 | }
150 |
151 | return new WC_Email_Customer_Ready_For_Pickup_Order();
152 |
--------------------------------------------------------------------------------
/codecov.yml:
--------------------------------------------------------------------------------
1 | coverage:
2 | status:
3 | project:
4 | default:
5 | target: auto
6 | threshold: 0.5%
7 | patch: off
8 |
9 | comment:
10 | require_changes: true
11 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "wc-local-pickup/woocommerce-local-pickup-time",
3 | "description": "Add an an option to WooCommerce checkout pages for Local Pickup that allows the user to choose a pickup time.",
4 | "type": "wordpress-plugin",
5 | "homepage": "https://github.com/WC-Local-Pickup/woocommerce-local-pickup-time",
6 | "license": "GPL-2.0-or-later",
7 | "authors": [
8 | {
9 | "name": "WC Local Pickup",
10 | "email": "support@wclocalpickup.com",
11 | "homepage": "https://www.wclocalpickup.com/"
12 | },
13 | {
14 | "name": "Tim Nolte",
15 | "email": "tim.nolte@ndigitals.com",
16 | "homepage": "https://www.timnolte.com/"
17 | },
18 | {
19 | "name": "Matt Banks",
20 | "email": "mjbanks@gmail.com",
21 | "homepage": "http://mattbanks.me"
22 | }
23 | ],
24 | "config": {
25 | "platform": {
26 | "php": "8.0"
27 | },
28 | "optimize-autoloader": true,
29 | "sort-packages": true,
30 | "allow-plugins": {
31 | "composer/installers": true,
32 | "automattic/jetpack-autoloader": true,
33 | "dealerdirect/phpcodesniffer-composer-installer": true,
34 | "johnpbloch/wordpress-core-installer": true,
35 | "phpro/grumphp": true,
36 | "phpstan/extension-installer": true,
37 | "boxuk/wp-muplugin-loader": true
38 | }
39 | },
40 | "repositories": [
41 | {
42 | "type": "composer",
43 | "url": "https://wpackagist.org"
44 | }
45 | ],
46 | "require": {
47 | "php": ">=7.4",
48 | "composer/installers": "~1.0|~2.0"
49 | },
50 | "require-dev": {
51 | "php": ">=7.4",
52 | "brain/monkey": "^2.6",
53 | "dealerdirect/phpcodesniffer-composer-installer": "^1.0",
54 | "johnpbloch/wordpress-core": "~6.5.0",
55 | "johnpbloch/wordpress-core-installer": "^2.0",
56 | "mockery/mockery": "^1.5",
57 | "php-stubs/woocommerce-stubs": "~8.7.0",
58 | "php-stubs/wordpress-stubs": "~6.5.0",
59 | "phpro/grumphp": "^1.16",
60 | "phpstan/extension-installer": "^1.3",
61 | "phpstan/phpstan": "^1.10",
62 | "phpstan/phpstan-deprecation-rules": "^1.1",
63 | "phpunit/phpunit": "^9.6.0",
64 | "roave/security-advisories": "dev-master",
65 | "squizlabs/php_codesniffer": "^3.7",
66 | "szepeviktor/phpstan-wordpress": "^1.3",
67 | "woocommerce/action-scheduler": "^3.5.0",
68 | "wp-coding-standards/wpcs": "^3.0.0",
69 | "wp-phpunit/wp-phpunit": "~6.5.0",
70 | "wpackagist-plugin/debug-bar": "*",
71 | "wpackagist-plugin/debug-bar-actions-and-filters-addon": "*",
72 | "wpackagist-plugin/display-environment-type": "*",
73 | "wpackagist-plugin/health-check": "*",
74 | "wpackagist-plugin/query-monitor": "*",
75 | "wpackagist-plugin/transients-manager": "*",
76 | "wpackagist-plugin/woo-order-test": "*",
77 | "wpackagist-plugin/woocommerce": "~8.7.0",
78 | "wpackagist-plugin/wordpress-importer": "*",
79 | "wpackagist-plugin/wp-mail-logging": "*",
80 | "wpackagist-theme/storefront": "*",
81 | "yoast/phpunit-polyfills": "^2.0"
82 | },
83 | "autoload": {
84 | "classmap": [
85 | "woocommerce-local-pickup-time.php",
86 | "admin/",
87 | "public/"
88 | ]
89 | },
90 | "autoload-dev": {
91 | "classmap": [
92 | "tools/local-env/wp-content/plugins/woocommerce/"
93 | ],
94 | "exclude-from-classmap": [
95 | "tools/local-env/wp-content/plugins/woocommerce/includes/legacy",
96 | "tools/local-env/wp-content/plugins/woocommerce/includes/libraries",
97 | "tools/local-env/wp-content/plugins/woocommerce/vendor"
98 | ]
99 | },
100 | "scripts": {
101 | "install-codestandards": [
102 | "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run"
103 | ],
104 | "post-install-cmd": [
105 | "@install-codestandards"
106 | ],
107 | "post-update-cmd": [
108 | "@install-codestandards"
109 | ],
110 | "phpcs": "vendor/bin/phpcs",
111 | "phpcbf": "vendor/bin/phpcbf",
112 | "phpstan": "vendor/bin/phpstan --memory-limit=1024M",
113 | "phpunit": "vendor/bin/phpunit",
114 | "coverage": "@phpunit --coverage-text",
115 | "lint": "@phpcs --report=full .",
116 | "lint-fix": "@phpcbf",
117 | "analyze": "@phpstan analyze .",
118 | "test": "@phpunit"
119 | },
120 | "extra": {
121 | "wordpress-install-dir": "tools/local-env/wp",
122 | "installer-paths": {
123 | "tools/local-env/wp-content/plugins/{$name}": [
124 | "type:wordpress-plugin"
125 | ],
126 | "tools/local-env/wp-content/mu-plugins/{$name}": [
127 | "type:wordpress-muplugin"
128 | ],
129 | "tools/local-env/wp-content/themes/{$name}": [
130 | "type:wordpress-theme"
131 | ]
132 | },
133 | "phpcodesniffer-search-depth": 5
134 | }
135 | }
136 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | # This is the Compose file for command-line services.
2 | # Anything that doesn't need to be run as part of the main `docker-compose up'
3 | # command should reside in here and be invoked by a helper script.
4 | version: "3.7"
5 |
6 | services:
7 | app:
8 | image: ghcr.io/ndigitals/wp-dev-container:php-8.1-node-16
9 | restart: always
10 | depends_on:
11 | - db
12 | - phpmyadmin
13 | - web
14 | - mailhog
15 | working_dir: /workspaces/woocommerce-local-pickup-time
16 | environment: &env
17 | WORDPRESS_DB_HOST: db
18 | WORDPRESS_DB_NAME: wordpress
19 | WORDPRESS_DB_USER: wordpress
20 | WORDPRESS_DB_PASSWORD: wordpress
21 | WORDPRESS_TEST_DB_NAME: wordpress_test
22 | CODESPACES: "${CODESPACES}"
23 | CODESPACE_NAME: "${CODESPACE_NAME}"
24 | GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN: "${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}"
25 | volumes:
26 | - .:/workspaces/woocommerce-local-pickup-time:cached
27 | - ./tools/local-env:/app:cached
28 | - ./tools/php/php-cli.ini:/usr/local/etc/php/php-cli.ini:ro,cached
29 | - .:/app/wp-content/plugins/woocommerce-local-pickup-time-select:ro,cached
30 | - ~/.composer:/root/.composer:cached
31 | - ~/.npm:/root/.npm:cached
32 | networks:
33 | - wclpt-net
34 |
35 | web:
36 | image: httpd
37 | restart: unless-stopped
38 | depends_on:
39 | - db
40 | ports:
41 | - 8080:80
42 | environment:
43 | <<: *env
44 | volumes:
45 | - ./tools/local-env:/app:cached
46 | - .:/app/wp-content/plugins/woocommerce-local-pickup-time-select:ro,cached
47 | - ./tools/apache/httpd.conf:/usr/local/apache2/conf/httpd.conf:ro,cached
48 | networks:
49 | - wclpt-net
50 |
51 | db:
52 | image: mariadb
53 | restart: unless-stopped
54 | ports:
55 | - 3306:3306
56 | environment:
57 | MYSQL_ROOT_PASSWORD: password
58 | MYSQL_DATABASE: wordpress
59 | MYSQL_USER: wordpress
60 | MYSQL_PASSWORD: wordpress
61 | volumes:
62 | - db:/var/lib/mysql
63 | - ./tests/db-wordpress_test.sql:/docker-entrypoint-initdb.d/db-wordpress_test.sql
64 | networks:
65 | - wclpt-net
66 |
67 | phpmyadmin:
68 | image: phpmyadmin
69 | restart: unless-stopped
70 | depends_on:
71 | - db
72 | ports:
73 | - 8081:8081
74 | environment:
75 | PMA_HOST: db
76 | APACHE_PORT: 8081
77 | networks:
78 | - wclpt-net
79 |
80 | ## SMTP Server + Web Interface for viewing and testing emails during development.
81 | mailhog:
82 | image: mailhog/mailhog
83 | restart: unless-stopped
84 | ports:
85 | - 1025:1025 # smtp server
86 | - 8026:8025 # web ui
87 | networks:
88 | - wclpt-net
89 |
90 | volumes:
91 | db:
92 |
93 | networks:
94 | wclpt-net:
95 |
96 |
--------------------------------------------------------------------------------
/grumphp.yml.dist:
--------------------------------------------------------------------------------
1 | # grumphp.yml
2 | grumphp:
3 | hide_circumvention_tip: true
4 | stop_on_failure: true
5 | process_timeout: 120
6 | parallel:
7 | enabled: true
8 | max_workers: 32
9 | fixer:
10 | enabled: false
11 | fix_by_default: false
12 | environment:
13 | variables:
14 | GRUMPHP_BIN_DIR: 'vendor/bin'
15 | paths:
16 | - 'node_modules/.bin'
17 | tasks:
18 | git_blacklist:
19 | keywords:
20 | - 'wp_die('
21 | - 'die('
22 | git_branch_name:
23 | blacklist:
24 | - 'main'
25 | - 'dev*'
26 | allow_detached_head: false
27 | git_commit_message:
28 | allow_empty_message: false
29 | enforce_capitalized_subject: false
30 | max_body_width: 160
31 | max_subject_width: 120
32 | phpcs:
33 | standard: './phpcs.xml.dist'
34 | report: 'summary'
35 | ignore_patterns:
36 | - '/^assets\/(.*)/'
37 | phpstan:
38 | configuration: './phpstan.neon.dist'
39 | level: max
40 | ignore_patterns:
41 | - '/^assets\/(.*)/'
42 | memory_limit: '-1'
43 |
--------------------------------------------------------------------------------
/languages/index.php:
--------------------------------------------------------------------------------
1 | =2 && n<=4) ? 1 : 2;\n"
15 | "X-Generator: GlotPress/2.3.1\n"
16 |
17 | #: admin/class-local-pickup-time-admin.php:120
18 | msgid "Settings"
19 | msgstr ""
20 |
21 | #: admin/class-local-pickup-time-admin.php:141
22 | #, fuzzy
23 | msgid "Local Pickup Time settings"
24 | msgstr "WooCommerce Local Pickup Time Select"
25 |
26 | #: admin/class-local-pickup-time-admin.php:164
27 | #, fuzzy
28 | msgid "Store Hours for Local Pickup"
29 | msgstr "Otvírací doba pro místí vyzvednutí"
30 |
31 | #: admin/class-local-pickup-time-admin.php:166
32 | msgid ""
33 | "The following options affect when order pickups begin and end each day, and "
34 | "which days to not allow order pickups."
35 | msgstr ""
36 | "Pomocí následujících možnosí můžete vybrat, kdy bude možné vyzvednout "
37 | "objednávku na místě."
38 |
39 | #: admin/class-local-pickup-time-admin.php:170
40 | #, fuzzy
41 | msgid "Monday Pickup Start Time"
42 | msgstr "Pondělí - první vyzvednutí v (24 hodin. formát)"
43 |
44 | #: admin/class-local-pickup-time-admin.php:171
45 | msgid "This sets the pickup start time for Monday. Use 24-hour time format."
46 | msgstr ""
47 | "Zde nastavíte pondělní první možný čas vyzvednutí. Použijte 24 hodinový "
48 | "formát."
49 |
50 | #: admin/class-local-pickup-time-admin.php:179
51 | #, fuzzy
52 | msgid "Monday Pickup End Time"
53 | msgstr "Pondělí - poslední vyzvednutí v (24 hodin. formát)"
54 |
55 | #: admin/class-local-pickup-time-admin.php:180
56 | msgid "This sets the pickup end time for Monday. Use 24-hour time format."
57 | msgstr ""
58 | "Zde nastavíte pondělní poslední možný čas vyzvednutí. Použijte 24 hodinový "
59 | "formát."
60 |
61 | #: admin/class-local-pickup-time-admin.php:188
62 | #, fuzzy
63 | msgid "Tuesday Pickup Start Time"
64 | msgstr "Úterý - první vyzvednutí v (24 hodin. formát)"
65 |
66 | #: admin/class-local-pickup-time-admin.php:189
67 | msgid "This sets the pickup start time for Tuesday. Use 24-hour time format."
68 | msgstr ""
69 | "Zde nastavíte úterní první možný čas vyzvednutí. Použijte 24 hodinový formát."
70 |
71 | #: admin/class-local-pickup-time-admin.php:197
72 | #, fuzzy
73 | msgid "Tuesday Pickup End Time"
74 | msgstr "Úterý - poslední vyzvednutí v (24 hodin. formát)"
75 |
76 | #: admin/class-local-pickup-time-admin.php:198
77 | msgid "This sets the pickup end time for Tuesday. Use 24-hour time format."
78 | msgstr ""
79 | "Zde nastavíte úterní poslední možný čas vyzvednutí. Použijte 24 hodinový "
80 | "formát."
81 |
82 | #: admin/class-local-pickup-time-admin.php:206
83 | #, fuzzy
84 | msgid "Wednesday Pickup Start Time"
85 | msgstr "Středa - první vyzvednutí v (24 hodin. formát)"
86 |
87 | #: admin/class-local-pickup-time-admin.php:207
88 | msgid "This sets the pickup start time for Wednesday. Use 24-hour time format."
89 | msgstr ""
90 | "Zde nastavíte středeční první možný čas vyzvednutí. Použijte 24 hodinový "
91 | "formát."
92 |
93 | #: admin/class-local-pickup-time-admin.php:215
94 | #, fuzzy
95 | msgid "Wednesday Pickup End Time"
96 | msgstr "Středa - poslední vyzvednutí v (24 hodin. formát)"
97 |
98 | #: admin/class-local-pickup-time-admin.php:216
99 | msgid "This sets the pickup end time for Wednesday. Use 24-hour time format."
100 | msgstr ""
101 | "Zde nastavíte středeční poslední možný čas vyzvednutí. Použijte 24 hodinový "
102 | "formát."
103 |
104 | #: admin/class-local-pickup-time-admin.php:224
105 | #, fuzzy
106 | msgid "Thursday Pickup Start Time"
107 | msgstr "Čtvrtek - první vyzvednutí v (24 hodin. formát)"
108 |
109 | #: admin/class-local-pickup-time-admin.php:225
110 | msgid "This sets the pickup start time for Thursday. Use 24-hour time format."
111 | msgstr ""
112 | "Zde nastavíte čtvrteční první možný čas vyzvednutí. Použijte 24 hodinový "
113 | "formát."
114 |
115 | #: admin/class-local-pickup-time-admin.php:233
116 | #, fuzzy
117 | msgid "Thursday Pickup End Time"
118 | msgstr "Čtvrtek - poslední vyzvednutí v (24 hodin. formát)"
119 |
120 | #: admin/class-local-pickup-time-admin.php:234
121 | msgid "This sets the pickup end time for Thursday. Use 24-hour time format."
122 | msgstr ""
123 | "Zde nastavíte čtvrteční poslední možný čas vyzvednutí. Použijte 24 hodinový "
124 | "formát."
125 |
126 | #: admin/class-local-pickup-time-admin.php:242
127 | #, fuzzy
128 | msgid "Friday Pickup Start Time"
129 | msgstr "Pátek - první vyzvednutí v (24 hodin. formát)"
130 |
131 | #: admin/class-local-pickup-time-admin.php:243
132 | msgid "This sets the pickup start time for Friday. Use 24-hour time format."
133 | msgstr ""
134 | "Zde nastavíte páteční první možný čas vyzvednutí. Použijte 24 hodinový "
135 | "formát."
136 |
137 | #: admin/class-local-pickup-time-admin.php:251
138 | #, fuzzy
139 | msgid "Friday Pickup End Time"
140 | msgstr "Pátek - poslední vyzvednutí v (24 hodin. formát)"
141 |
142 | #: admin/class-local-pickup-time-admin.php:252
143 | msgid "This sets the pickup end time for Friday. Use 24-hour time format."
144 | msgstr ""
145 | "Zde nastavíte páteční poslední možný čas vyzvednutí. Použijte 24 hodinový "
146 | "formát."
147 |
148 | #: admin/class-local-pickup-time-admin.php:260
149 | #, fuzzy
150 | msgid "Saturday Pickup Start Time"
151 | msgstr "Sobota - poslední vyzvednutí v (24 hodin. formát)"
152 |
153 | #: admin/class-local-pickup-time-admin.php:261
154 | msgid "This sets the pickup start time for Saturday. Use 24-hour time format."
155 | msgstr ""
156 | "Zde nastavíte sobotní první možný čas vyzvednutí. Použijte 24 hodinový "
157 | "formát."
158 |
159 | #: admin/class-local-pickup-time-admin.php:269
160 | #, fuzzy
161 | msgid "Saturday Pickup End Time"
162 | msgstr "Sobota - první vyzvednutí v (24 hodin. formát)"
163 |
164 | #: admin/class-local-pickup-time-admin.php:270
165 | msgid "This sets the pickup end time for Saturday. Use 24-hour time format."
166 | msgstr ""
167 | "Zde nastavíte sobotní poslední možný čas vyzvednutí. Použijte 24 hodinový "
168 | "formát."
169 |
170 | #: admin/class-local-pickup-time-admin.php:278
171 | #, fuzzy
172 | msgid "Sunday Pickup Start Time"
173 | msgstr "Neděle - poslední vyzvednutí v (24 hodin. formát)"
174 |
175 | #: admin/class-local-pickup-time-admin.php:279
176 | msgid "This sets the pickup start time for Sunday. Use 24-hour time format."
177 | msgstr ""
178 | "Zde nastavíte nedělní první možný čas vyzvednutí. Použijte 24 hodinový "
179 | "formát."
180 |
181 | #: admin/class-local-pickup-time-admin.php:287
182 | #, fuzzy
183 | msgid "Sunday Pickup End Time"
184 | msgstr "Neděle - první vyzvednutí v (24 hodin. formát)"
185 |
186 | #: admin/class-local-pickup-time-admin.php:288
187 | msgid "This sets the pickup end time for Sunday. Use 24-hour time format."
188 | msgstr ""
189 | "Zde nastavíte nedělní poslední možný čas vyzvednutí. Použijte 24 hodinový "
190 | "formát."
191 |
192 | #: admin/class-local-pickup-time-admin.php:300
193 | #, fuzzy
194 | msgid "Store Closed for Local Pickup"
195 | msgstr "Otvírací doba pro místí vyzvednutí"
196 |
197 | #: admin/class-local-pickup-time-admin.php:302
198 | #, fuzzy
199 | msgid "The following options affect which days to not allow order pickups."
200 | msgstr ""
201 | "Pomocí následujících možnosí můžete vybrat, kdy bude možné vyzvednout "
202 | "objednávku na místě."
203 |
204 | #: admin/class-local-pickup-time-admin.php:306
205 | msgid "Store Closing Days (use MM/DD/YYYY format)"
206 | msgstr "Dny, kdy je zavřeno (použijte formát MM/DD/YYY formát)"
207 |
208 | #: admin/class-local-pickup-time-admin.php:307
209 | msgid ""
210 | "This sets the days the store is closed. Enter one date per line, in format "
211 | "MM/DD/YYYY."
212 | msgstr ""
213 | "Zde nastavíte dny, kdy bude zavřeno. Zadejte jedno datum na řádek ve formátu "
214 | "MM/DD/YYYY."
215 |
216 | #: admin/class-local-pickup-time-admin.php:319
217 | msgid "Order Pickup Intervals & Delays"
218 | msgstr ""
219 |
220 | #: admin/class-local-pickup-time-admin.php:321
221 | msgid ""
222 | "The following options are used to calculate the available time slots for "
223 | "pickup."
224 | msgstr ""
225 |
226 | #: admin/class-local-pickup-time-admin.php:325
227 | msgid "Pickup Time Interval"
228 | msgstr "Interval času vyzvednutá"
229 |
230 | #: admin/class-local-pickup-time-admin.php:326
231 | msgid "Choose the time interval for allowing local pickup orders."
232 | msgstr "Vyberte interval, podle kterého se vytvoří nabídka časů."
233 |
234 | #: admin/class-local-pickup-time-admin.php:334
235 | #: admin/class-local-pickup-time-admin.php:354
236 | msgid "5 minutes"
237 | msgstr "5 minut"
238 |
239 | #: admin/class-local-pickup-time-admin.php:335
240 | #: admin/class-local-pickup-time-admin.php:355
241 | msgid "10 minutes"
242 | msgstr "10 minut"
243 |
244 | #: admin/class-local-pickup-time-admin.php:336
245 | #: admin/class-local-pickup-time-admin.php:356
246 | msgid "15 minutes"
247 | msgstr "15 minut"
248 |
249 | #: admin/class-local-pickup-time-admin.php:337
250 | #: admin/class-local-pickup-time-admin.php:357
251 | msgid "20 minutes"
252 | msgstr "20 minut"
253 |
254 | #: admin/class-local-pickup-time-admin.php:338
255 | #: admin/class-local-pickup-time-admin.php:358
256 | msgid "30 minutes"
257 | msgstr "30 minut"
258 |
259 | #: admin/class-local-pickup-time-admin.php:339
260 | #: admin/class-local-pickup-time-admin.php:359
261 | msgid "45 minutes"
262 | msgstr "45 minut"
263 |
264 | #: admin/class-local-pickup-time-admin.php:340
265 | #: admin/class-local-pickup-time-admin.php:360
266 | msgid "1 hour"
267 | msgstr "1 hodina"
268 |
269 | #: admin/class-local-pickup-time-admin.php:341
270 | #: admin/class-local-pickup-time-admin.php:361
271 | msgid "2 hours"
272 | msgstr "2 hodiny"
273 |
274 | #: admin/class-local-pickup-time-admin.php:345
275 | msgid "Pickup Time Delay"
276 | msgstr "Odběr možný po"
277 |
278 | #: admin/class-local-pickup-time-admin.php:346
279 | msgid ""
280 | "Choose the time delay from the time of ordering for allowing local pickup "
281 | "orders."
282 | msgstr "Po kolika minutách je možné objednávku vyzvednou po jejím uskutečnění."
283 |
284 | #: admin/class-local-pickup-time-admin.php:362
285 | msgid "4 hours"
286 | msgstr "4 hodiny"
287 |
288 | #: admin/class-local-pickup-time-admin.php:363
289 | msgid "8 hours"
290 | msgstr "8 hodin"
291 |
292 | #: admin/class-local-pickup-time-admin.php:364
293 | msgid "16 hours"
294 | msgstr "16 hodin"
295 |
296 | #: admin/class-local-pickup-time-admin.php:365
297 | msgid "24 hours"
298 | msgstr "24 hodin"
299 |
300 | #: admin/class-local-pickup-time-admin.php:366
301 | msgid "36 hours"
302 | msgstr "36 hodin"
303 |
304 | #: admin/class-local-pickup-time-admin.php:367
305 | msgid "48 hours"
306 | msgstr "48 hodin"
307 |
308 | #: admin/class-local-pickup-time-admin.php:368
309 | msgid "3 days"
310 | msgstr "3 dny"
311 |
312 | #: admin/class-local-pickup-time-admin.php:369
313 | msgid "5 days"
314 | msgstr "5 dnů"
315 |
316 | #: admin/class-local-pickup-time-admin.php:370
317 | msgid "1 week"
318 | msgstr "1 týden"
319 |
320 | #: admin/class-local-pickup-time-admin.php:374
321 | #, fuzzy
322 | msgid "Pickup Time Open Days Ahead"
323 | msgstr "Objednávka dopředu max."
324 |
325 | #: admin/class-local-pickup-time-admin.php:375
326 | #, fuzzy
327 | msgid ""
328 | "Choose the number of open days ahead for allowing local pickup orders. This "
329 | "is inclusive of the current day, if timeslots are still available."
330 | msgstr "Vyberte pro kolik dní dopředu je možné vybrat dobu doručení"
331 |
332 | #: admin/class-local-pickup-time-admin.php:391
333 | msgid "Additional Settings"
334 | msgstr ""
335 |
336 | #: admin/class-local-pickup-time-admin.php:393
337 | msgid ""
338 | "The following options provide additional capabilities for customization."
339 | msgstr ""
340 |
341 | #: admin/class-local-pickup-time-admin.php:397
342 | msgid "Require Checkout Pickup Time?"
343 | msgstr ""
344 |
345 | #: admin/class-local-pickup-time-admin.php:398
346 | msgid "Required"
347 | msgstr ""
348 |
349 | #: admin/class-local-pickup-time-admin.php:399
350 | msgid "This controls whether a Pickup Time is required during checkout."
351 | msgstr ""
352 |
353 | #: admin/class-local-pickup-time-admin.php:407
354 | msgid "Limit to Local Pickup Shipping Methods?"
355 | msgstr ""
356 |
357 | #: admin/class-local-pickup-time-admin.php:408
358 | msgid "Limit"
359 | msgstr ""
360 |
361 | #: admin/class-local-pickup-time-admin.php:409
362 | msgid ""
363 | "This controls whether Local Pickup Times are restricted to Local Shipping "
364 | "methods. This requires enabling \"Pickup Time\" on each individual "
365 | "Local Pickup Shipping method, within each Shiping Zone."
366 | msgstr ""
367 |
368 | #: admin/class-local-pickup-time-admin.php:465
369 | #: admin/class-local-pickup-time-admin.php:632
370 | #: public/class-local-pickup-time.php:863
371 | #: public/class-local-pickup-time.php:941
372 | msgid "Pickup Time"
373 | msgstr "Čas vyzvednutí"
374 |
375 | #: admin/class-local-pickup-time-admin.php:466
376 | msgid "Enable"
377 | msgstr ""
378 |
379 | #: admin/class-local-pickup-time-admin.php:467
380 | msgid "This controls whether a Pickup Time is tied to the shipping method."
381 | msgstr ""
382 |
383 | #. translators: %s: number of orders
384 | #: admin/class-local-pickup-time-admin.php:519
385 | msgid "Ready for Pickup (%s)"
386 | msgid_plural "Ready for Pickup (%s)"
387 | msgstr[0] ""
388 | msgstr[1] ""
389 | msgstr[2] ""
390 |
391 | #: admin/class-local-pickup-time-admin.php:552
392 | msgid "Change status to ready for pickup"
393 | msgstr ""
394 |
395 | #: admin/class-local-pickup-time-admin.php:611
396 | msgid "Pickup Time:"
397 | msgstr "Čas vyzvednutí:"
398 |
399 | #: admin/emails/class-wc-email-customer-ready-for-pickup-order.php:30
400 | msgid "Ready for Pickup order"
401 | msgstr ""
402 |
403 | #: admin/emails/class-wc-email-customer-ready-for-pickup-order.php:31
404 | msgid ""
405 | "Order ready for pickup emails are sent to the customer when the order is "
406 | "marked Ready for Pickup."
407 | msgstr ""
408 |
409 | #: admin/emails/class-wc-email-customer-ready-for-pickup-order.php:85
410 | msgid "Your {site_title} order is now ready for pickup"
411 | msgstr ""
412 |
413 | #: admin/emails/class-wc-email-customer-ready-for-pickup-order.php:95
414 | msgid "We look forward to your arrival"
415 | msgstr ""
416 |
417 | #: admin/emails/class-wc-email-customer-ready-for-pickup-order.php:147
418 | msgid "We look forward to your pending arrival."
419 | msgstr ""
420 |
421 | #: public/class-local-pickup-time.php:598
422 | msgid "Monday"
423 | msgstr "Pondělí"
424 |
425 | #: public/class-local-pickup-time.php:599
426 | msgid "Tuesday"
427 | msgstr "Úterý"
428 |
429 | #: public/class-local-pickup-time.php:600
430 | msgid "Wednesday"
431 | msgstr "Středa"
432 |
433 | #: public/class-local-pickup-time.php:601
434 | msgid "Thursday"
435 | msgstr "Čtvrtek"
436 |
437 | #: public/class-local-pickup-time.php:602
438 | msgid "Friday"
439 | msgstr "Pátek"
440 |
441 | #: public/class-local-pickup-time.php:603
442 | msgid "Saturday"
443 | msgstr "Sobota"
444 |
445 | #: public/class-local-pickup-time.php:604
446 | msgid "Sunday"
447 | msgstr "Neděle"
448 |
449 | #: public/class-local-pickup-time.php:888
450 | #: public/class-local-pickup-time.php:914
451 | msgid "Expired or invalid submission!."
452 | msgstr ""
453 |
454 | #: public/class-local-pickup-time.php:894
455 | msgid "Please select a pickup time."
456 | msgstr "vyberte si čas vyzvednutí."
457 |
458 | #: public/class-local-pickup-time.php:962
459 | msgid "None"
460 | msgstr "Žádná"
461 |
462 | #. translators: %s: Customer first name
463 | #: templates/emails/customer-ready-for-pickup-order.php:32
464 | #: templates/emails/plain/customer-ready-for-pickup-order.php:29
465 | msgid "Hi %s,"
466 | msgstr ""
467 |
468 | #: templates/emails/customer-ready-for-pickup-order.php:33
469 | #: templates/emails/plain/customer-ready-for-pickup-order.php:30
470 | msgid "We have finished preparing your order for pickup."
471 | msgstr ""
472 |
473 | #. Plugin Name of the plugin/theme
474 | msgid "WooCommerce Local Pickup Time Select"
475 | msgstr "WooCommerce Local Pickup Time Select"
476 |
477 | #. Plugin URI of the plugin/theme
478 | msgid "https://github.com/WC-Local-Pickup/woocommerce-local-pickup-time"
479 | msgstr ""
480 |
481 | #. Description of the plugin/theme
482 | msgid ""
483 | "Add an an option to WooCommerce checkout pages for Local Pickup that allows "
484 | "the user to choose a pickup time."
485 | msgstr ""
486 | "Přidejte do WooCommerce možnost výběru času pro místní vyzvednutí na "
487 | "přehledu v pokladně."
488 |
489 | #. Author of the plugin/theme
490 | msgid "Tim Nolte"
491 | msgstr ""
492 |
493 | #. Author URI of the plugin/theme
494 | msgid "https://www.ndigitals.com/"
495 | msgstr ""
496 |
497 | #: admin/class-local-pickup-time-admin.php:513
498 | #: admin/class-local-pickup-time-admin.php:535
499 | msgctxt "Order status"
500 | msgid "Ready for Pickup"
501 | msgstr ""
502 |
503 | #~ msgid "Select time"
504 | #~ msgstr "Vyberte čas"
505 |
506 | #~ msgid "http://mattbanks.me"
507 | #~ msgstr "http://mattbanks.me"
508 |
509 | #~ msgid "Matt Banks"
510 | #~ msgstr "Matt Banks"
511 |
--------------------------------------------------------------------------------
/languages/woocommerce-local-pickup-time-en_US.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/WC-Local-Pickup/woocommerce-local-pickup-time/5350e429c05c5482249eb39c16feb95ca106cebd/languages/woocommerce-local-pickup-time-en_US.mo
--------------------------------------------------------------------------------
/languages/woocommerce-local-pickup-time-en_US.po:
--------------------------------------------------------------------------------
1 | msgid ""
2 | msgstr ""
3 | "Project-Id-Version: WooCommerce Local Pickup Time Select\n"
4 | "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-local-"
5 | "pickup-time\n"
6 | "POT-Creation-Date: 2022-08-03 03:26:11+00:00\n"
7 | "PO-Revision-Date: 2017-05-11 11:03+0200\n"
8 | "Last-Translator: Karolína Vyskočilová \n"
9 | "Language-Team: Matt Banks \n"
10 | "Language: en_US\n"
11 | "MIME-Version: 1.0\n"
12 | "Content-Type: text/plain; charset=UTF-8\n"
13 | "Content-Transfer-Encoding: 8bit\n"
14 | "X-Generator: Poedit 1.8.12\n"
15 | "X-Poedit-Basepath: ..\n"
16 | "X-Poedit-SourceCharset: UTF-8\n"
17 | "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
18 | "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
19 | "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
20 | "Plural-Forms: nplurals=2; plural=(n != 1);\n"
21 | "X-Poedit-SearchPath-0: .\n"
22 |
23 | #: admin/class-local-pickup-time-admin.php:120
24 | msgid "Settings"
25 | msgstr ""
26 |
27 | #: admin/class-local-pickup-time-admin.php:141
28 | msgid "Local Pickup Time settings"
29 | msgstr ""
30 |
31 | #: admin/class-local-pickup-time-admin.php:164
32 | msgid "Store Hours for Local Pickup"
33 | msgstr ""
34 |
35 | #: admin/class-local-pickup-time-admin.php:166
36 | msgid ""
37 | "The following options affect when order pickups begin and end each day, and "
38 | "which days to not allow order pickups."
39 | msgstr ""
40 |
41 | #: admin/class-local-pickup-time-admin.php:170
42 | msgid "Monday Pickup Start Time"
43 | msgstr ""
44 |
45 | #: admin/class-local-pickup-time-admin.php:171
46 | msgid "This sets the pickup start time for Monday. Use 24-hour time format."
47 | msgstr ""
48 |
49 | #: admin/class-local-pickup-time-admin.php:179
50 | msgid "Monday Pickup End Time"
51 | msgstr ""
52 |
53 | #: admin/class-local-pickup-time-admin.php:180
54 | msgid "This sets the pickup end time for Monday. Use 24-hour time format."
55 | msgstr ""
56 |
57 | #: admin/class-local-pickup-time-admin.php:188
58 | msgid "Tuesday Pickup Start Time"
59 | msgstr ""
60 |
61 | #: admin/class-local-pickup-time-admin.php:189
62 | msgid "This sets the pickup start time for Tuesday. Use 24-hour time format."
63 | msgstr ""
64 |
65 | #: admin/class-local-pickup-time-admin.php:197
66 | msgid "Tuesday Pickup End Time"
67 | msgstr ""
68 |
69 | #: admin/class-local-pickup-time-admin.php:198
70 | msgid "This sets the pickup end time for Tuesday. Use 24-hour time format."
71 | msgstr ""
72 |
73 | #: admin/class-local-pickup-time-admin.php:206
74 | msgid "Wednesday Pickup Start Time"
75 | msgstr ""
76 |
77 | #: admin/class-local-pickup-time-admin.php:207
78 | msgid "This sets the pickup start time for Wednesday. Use 24-hour time format."
79 | msgstr ""
80 |
81 | #: admin/class-local-pickup-time-admin.php:215
82 | msgid "Wednesday Pickup End Time"
83 | msgstr ""
84 |
85 | #: admin/class-local-pickup-time-admin.php:216
86 | msgid "This sets the pickup end time for Wednesday. Use 24-hour time format."
87 | msgstr ""
88 |
89 | #: admin/class-local-pickup-time-admin.php:224
90 | msgid "Thursday Pickup Start Time"
91 | msgstr ""
92 |
93 | #: admin/class-local-pickup-time-admin.php:225
94 | msgid "This sets the pickup start time for Thursday. Use 24-hour time format."
95 | msgstr ""
96 |
97 | #: admin/class-local-pickup-time-admin.php:233
98 | msgid "Thursday Pickup End Time"
99 | msgstr ""
100 |
101 | #: admin/class-local-pickup-time-admin.php:234
102 | msgid "This sets the pickup end time for Thursday. Use 24-hour time format."
103 | msgstr ""
104 |
105 | #: admin/class-local-pickup-time-admin.php:242
106 | msgid "Friday Pickup Start Time"
107 | msgstr ""
108 |
109 | #: admin/class-local-pickup-time-admin.php:243
110 | msgid "This sets the pickup start time for Friday. Use 24-hour time format."
111 | msgstr ""
112 |
113 | #: admin/class-local-pickup-time-admin.php:251
114 | msgid "Friday Pickup End Time"
115 | msgstr ""
116 |
117 | #: admin/class-local-pickup-time-admin.php:252
118 | msgid "This sets the pickup end time for Friday. Use 24-hour time format."
119 | msgstr ""
120 |
121 | #: admin/class-local-pickup-time-admin.php:260
122 | msgid "Saturday Pickup Start Time"
123 | msgstr ""
124 |
125 | #: admin/class-local-pickup-time-admin.php:261
126 | msgid "This sets the pickup start time for Saturday. Use 24-hour time format."
127 | msgstr ""
128 |
129 | #: admin/class-local-pickup-time-admin.php:269
130 | msgid "Saturday Pickup End Time"
131 | msgstr ""
132 |
133 | #: admin/class-local-pickup-time-admin.php:270
134 | msgid "This sets the pickup end time for Saturday. Use 24-hour time format."
135 | msgstr ""
136 |
137 | #: admin/class-local-pickup-time-admin.php:278
138 | msgid "Sunday Pickup Start Time"
139 | msgstr ""
140 |
141 | #: admin/class-local-pickup-time-admin.php:279
142 | msgid "This sets the pickup start time for Sunday. Use 24-hour time format."
143 | msgstr ""
144 |
145 | #: admin/class-local-pickup-time-admin.php:287
146 | msgid "Sunday Pickup End Time"
147 | msgstr ""
148 |
149 | #: admin/class-local-pickup-time-admin.php:288
150 | msgid "This sets the pickup end time for Sunday. Use 24-hour time format."
151 | msgstr ""
152 |
153 | #: admin/class-local-pickup-time-admin.php:300
154 | msgid "Store Closed for Local Pickup"
155 | msgstr ""
156 |
157 | #: admin/class-local-pickup-time-admin.php:302
158 | msgid "The following options affect which days to not allow order pickups."
159 | msgstr ""
160 |
161 | #: admin/class-local-pickup-time-admin.php:306
162 | msgid "Store Closing Days (use MM/DD/YYYY format)"
163 | msgstr ""
164 |
165 | #: admin/class-local-pickup-time-admin.php:307
166 | msgid ""
167 | "This sets the days the store is closed. Enter one date per line, in format "
168 | "MM/DD/YYYY."
169 | msgstr ""
170 |
171 | #: admin/class-local-pickup-time-admin.php:319
172 | msgid "Order Pickup Intervals & Delays"
173 | msgstr ""
174 |
175 | #: admin/class-local-pickup-time-admin.php:321
176 | msgid ""
177 | "The following options are used to calculate the available time slots for "
178 | "pickup."
179 | msgstr ""
180 |
181 | #: admin/class-local-pickup-time-admin.php:325
182 | msgid "Pickup Time Interval"
183 | msgstr ""
184 |
185 | #: admin/class-local-pickup-time-admin.php:326
186 | msgid "Choose the time interval for allowing local pickup orders."
187 | msgstr ""
188 |
189 | #: admin/class-local-pickup-time-admin.php:334
190 | #: admin/class-local-pickup-time-admin.php:354
191 | msgid "5 minutes"
192 | msgstr ""
193 |
194 | #: admin/class-local-pickup-time-admin.php:335
195 | #: admin/class-local-pickup-time-admin.php:355
196 | msgid "10 minutes"
197 | msgstr ""
198 |
199 | #: admin/class-local-pickup-time-admin.php:336
200 | #: admin/class-local-pickup-time-admin.php:356
201 | msgid "15 minutes"
202 | msgstr ""
203 |
204 | #: admin/class-local-pickup-time-admin.php:337
205 | #: admin/class-local-pickup-time-admin.php:357
206 | msgid "20 minutes"
207 | msgstr ""
208 |
209 | #: admin/class-local-pickup-time-admin.php:338
210 | #: admin/class-local-pickup-time-admin.php:358
211 | msgid "30 minutes"
212 | msgstr ""
213 |
214 | #: admin/class-local-pickup-time-admin.php:339
215 | #: admin/class-local-pickup-time-admin.php:359
216 | msgid "45 minutes"
217 | msgstr ""
218 |
219 | #: admin/class-local-pickup-time-admin.php:340
220 | #: admin/class-local-pickup-time-admin.php:360
221 | msgid "1 hour"
222 | msgstr ""
223 |
224 | #: admin/class-local-pickup-time-admin.php:341
225 | #: admin/class-local-pickup-time-admin.php:361
226 | msgid "2 hours"
227 | msgstr ""
228 |
229 | #: admin/class-local-pickup-time-admin.php:345
230 | msgid "Pickup Time Delay"
231 | msgstr ""
232 |
233 | #: admin/class-local-pickup-time-admin.php:346
234 | msgid ""
235 | "Choose the time delay from the time of ordering for allowing local pickup "
236 | "orders."
237 | msgstr ""
238 |
239 | #: admin/class-local-pickup-time-admin.php:362
240 | msgid "4 hours"
241 | msgstr ""
242 |
243 | #: admin/class-local-pickup-time-admin.php:363
244 | msgid "8 hours"
245 | msgstr ""
246 |
247 | #: admin/class-local-pickup-time-admin.php:364
248 | msgid "16 hours"
249 | msgstr ""
250 |
251 | #: admin/class-local-pickup-time-admin.php:365
252 | msgid "24 hours"
253 | msgstr ""
254 |
255 | #: admin/class-local-pickup-time-admin.php:366
256 | msgid "36 hours"
257 | msgstr ""
258 |
259 | #: admin/class-local-pickup-time-admin.php:367
260 | msgid "48 hours"
261 | msgstr ""
262 |
263 | #: admin/class-local-pickup-time-admin.php:368
264 | msgid "3 days"
265 | msgstr ""
266 |
267 | #: admin/class-local-pickup-time-admin.php:369
268 | msgid "5 days"
269 | msgstr ""
270 |
271 | #: admin/class-local-pickup-time-admin.php:370
272 | msgid "1 week"
273 | msgstr ""
274 |
275 | #: admin/class-local-pickup-time-admin.php:374
276 | msgid "Pickup Time Open Days Ahead"
277 | msgstr ""
278 |
279 | #: admin/class-local-pickup-time-admin.php:375
280 | msgid ""
281 | "Choose the number of open days ahead for allowing local pickup orders. This "
282 | "is inclusive of the current day, if timeslots are still available."
283 | msgstr ""
284 |
285 | #: admin/class-local-pickup-time-admin.php:391
286 | msgid "Additional Settings"
287 | msgstr ""
288 |
289 | #: admin/class-local-pickup-time-admin.php:393
290 | msgid ""
291 | "The following options provide additional capabilities for customization."
292 | msgstr ""
293 |
294 | #: admin/class-local-pickup-time-admin.php:397
295 | msgid "Require Checkout Pickup Time?"
296 | msgstr ""
297 |
298 | #: admin/class-local-pickup-time-admin.php:398
299 | msgid "Required"
300 | msgstr ""
301 |
302 | #: admin/class-local-pickup-time-admin.php:399
303 | msgid "This controls whether a Pickup Time is required during checkout."
304 | msgstr ""
305 |
306 | #: admin/class-local-pickup-time-admin.php:407
307 | msgid "Limit to Local Pickup Shipping Methods?"
308 | msgstr ""
309 |
310 | #: admin/class-local-pickup-time-admin.php:408
311 | msgid "Limit"
312 | msgstr ""
313 |
314 | #: admin/class-local-pickup-time-admin.php:409
315 | msgid ""
316 | "This controls whether Local Pickup Times are restricted to Local Shipping "
317 | "methods. This requires enabling \"Pickup Time\" on each individual "
318 | "Local Pickup Shipping method, within each Shiping Zone."
319 | msgstr ""
320 |
321 | #: admin/class-local-pickup-time-admin.php:465
322 | #: admin/class-local-pickup-time-admin.php:632
323 | #: public/class-local-pickup-time.php:863
324 | #: public/class-local-pickup-time.php:941
325 | msgid "Pickup Time"
326 | msgstr ""
327 |
328 | #: admin/class-local-pickup-time-admin.php:466
329 | msgid "Enable"
330 | msgstr ""
331 |
332 | #: admin/class-local-pickup-time-admin.php:467
333 | msgid "This controls whether a Pickup Time is tied to the shipping method."
334 | msgstr ""
335 |
336 | #. translators: %s: number of orders
337 | #: admin/class-local-pickup-time-admin.php:519
338 | msgid "Ready for Pickup (%s)"
339 | msgid_plural "Ready for Pickup (%s)"
340 | msgstr[0] ""
341 | msgstr[1] ""
342 |
343 | #: admin/class-local-pickup-time-admin.php:552
344 | msgid "Change status to ready for pickup"
345 | msgstr ""
346 |
347 | #: admin/class-local-pickup-time-admin.php:611
348 | msgid "Pickup Time:"
349 | msgstr ""
350 |
351 | #: admin/emails/class-wc-email-customer-ready-for-pickup-order.php:30
352 | msgid "Ready for Pickup order"
353 | msgstr ""
354 |
355 | #: admin/emails/class-wc-email-customer-ready-for-pickup-order.php:31
356 | msgid ""
357 | "Order ready for pickup emails are sent to the customer when the order is "
358 | "marked Ready for Pickup."
359 | msgstr ""
360 |
361 | #: admin/emails/class-wc-email-customer-ready-for-pickup-order.php:85
362 | msgid "Your {site_title} order is now ready for pickup"
363 | msgstr ""
364 |
365 | #: admin/emails/class-wc-email-customer-ready-for-pickup-order.php:95
366 | msgid "We look forward to your arrival"
367 | msgstr ""
368 |
369 | #: admin/emails/class-wc-email-customer-ready-for-pickup-order.php:147
370 | msgid "We look forward to your pending arrival."
371 | msgstr ""
372 |
373 | #: public/class-local-pickup-time.php:598
374 | msgid "Monday"
375 | msgstr ""
376 |
377 | #: public/class-local-pickup-time.php:599
378 | msgid "Tuesday"
379 | msgstr ""
380 |
381 | #: public/class-local-pickup-time.php:600
382 | msgid "Wednesday"
383 | msgstr ""
384 |
385 | #: public/class-local-pickup-time.php:601
386 | msgid "Thursday"
387 | msgstr ""
388 |
389 | #: public/class-local-pickup-time.php:602
390 | msgid "Friday"
391 | msgstr ""
392 |
393 | #: public/class-local-pickup-time.php:603
394 | msgid "Saturday"
395 | msgstr ""
396 |
397 | #: public/class-local-pickup-time.php:604
398 | msgid "Sunday"
399 | msgstr ""
400 |
401 | #: public/class-local-pickup-time.php:888
402 | #: public/class-local-pickup-time.php:914
403 | msgid "Expired or invalid submission!."
404 | msgstr ""
405 |
406 | #: public/class-local-pickup-time.php:894
407 | msgid "Please select a pickup time."
408 | msgstr ""
409 |
410 | #: public/class-local-pickup-time.php:962
411 | msgid "None"
412 | msgstr ""
413 |
414 | #. translators: %s: Customer first name
415 | #: templates/emails/customer-ready-for-pickup-order.php:32
416 | #: templates/emails/plain/customer-ready-for-pickup-order.php:29
417 | msgid "Hi %s,"
418 | msgstr ""
419 |
420 | #: templates/emails/customer-ready-for-pickup-order.php:33
421 | #: templates/emails/plain/customer-ready-for-pickup-order.php:30
422 | msgid "We have finished preparing your order for pickup."
423 | msgstr ""
424 |
425 | #. Plugin Name of the plugin/theme
426 | msgid "WooCommerce Local Pickup Time Select"
427 | msgstr ""
428 |
429 | #. Plugin URI of the plugin/theme
430 | msgid "https://github.com/WC-Local-Pickup/woocommerce-local-pickup-time"
431 | msgstr ""
432 |
433 | #. Description of the plugin/theme
434 | msgid ""
435 | "Add an an option to WooCommerce checkout pages for Local Pickup that allows "
436 | "the user to choose a pickup time."
437 | msgstr ""
438 |
439 | #. Author of the plugin/theme
440 | msgid "Tim Nolte"
441 | msgstr ""
442 |
443 | #. Author URI of the plugin/theme
444 | msgid "https://www.ndigitals.com/"
445 | msgstr ""
446 |
447 | #: admin/class-local-pickup-time-admin.php:513
448 | #: admin/class-local-pickup-time-admin.php:535
449 | msgctxt "Order status"
450 | msgid "Ready for Pickup"
451 | msgstr ""
452 |
--------------------------------------------------------------------------------
/languages/woocommerce-local-pickup-time.pot:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2022 Tim Nolte
2 | # This file is distributed under the GPL-2.0+.
3 | msgid ""
4 | msgstr ""
5 | "Project-Id-Version: WooCommerce Local Pickup Time Select 1.4.2\n"
6 | "Report-Msgid-Bugs-To: "
7 | "https://wordpress.org/support/plugin/woocommerce-local-pickup-time\n"
8 | "POT-Creation-Date: 2022-08-03 03:26:11+00:00\n"
9 | "MIME-Version: 1.0\n"
10 | "Content-Type: text/plain; charset=utf-8\n"
11 | "Content-Transfer-Encoding: 8bit\n"
12 | "PO-Revision-Date: 2022-MO-DA HO:MI+ZONE\n"
13 | "Last-Translator: FULL NAME \n"
14 | "Language-Team: LANGUAGE \n"
15 | "Language: en\n"
16 | "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17 | "X-Poedit-Country: United States\n"
18 | "X-Poedit-SourceCharset: UTF-8\n"
19 | "X-Poedit-KeywordsList: "
20 | "__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
21 | "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
22 | "X-Poedit-Basepath: ../\n"
23 | "X-Poedit-SearchPath-0: .\n"
24 | "X-Poedit-Bookmarks: \n"
25 | "X-Textdomain-Support: yes\n"
26 | "X-Generator: grunt-wp-i18n 1.0.3\n"
27 |
28 | #: admin/class-local-pickup-time-admin.php:120
29 | msgid "Settings"
30 | msgstr ""
31 |
32 | #: admin/class-local-pickup-time-admin.php:141
33 | msgid "Local Pickup Time settings"
34 | msgstr ""
35 |
36 | #: admin/class-local-pickup-time-admin.php:164
37 | msgid "Store Hours for Local Pickup"
38 | msgstr ""
39 |
40 | #: admin/class-local-pickup-time-admin.php:166
41 | msgid ""
42 | "The following options affect when order pickups begin and end each day, and "
43 | "which days to not allow order pickups."
44 | msgstr ""
45 |
46 | #: admin/class-local-pickup-time-admin.php:170
47 | msgid "Monday Pickup Start Time"
48 | msgstr ""
49 |
50 | #: admin/class-local-pickup-time-admin.php:171
51 | msgid "This sets the pickup start time for Monday. Use 24-hour time format."
52 | msgstr ""
53 |
54 | #: admin/class-local-pickup-time-admin.php:179
55 | msgid "Monday Pickup End Time"
56 | msgstr ""
57 |
58 | #: admin/class-local-pickup-time-admin.php:180
59 | msgid "This sets the pickup end time for Monday. Use 24-hour time format."
60 | msgstr ""
61 |
62 | #: admin/class-local-pickup-time-admin.php:188
63 | msgid "Tuesday Pickup Start Time"
64 | msgstr ""
65 |
66 | #: admin/class-local-pickup-time-admin.php:189
67 | msgid "This sets the pickup start time for Tuesday. Use 24-hour time format."
68 | msgstr ""
69 |
70 | #: admin/class-local-pickup-time-admin.php:197
71 | msgid "Tuesday Pickup End Time"
72 | msgstr ""
73 |
74 | #: admin/class-local-pickup-time-admin.php:198
75 | msgid "This sets the pickup end time for Tuesday. Use 24-hour time format."
76 | msgstr ""
77 |
78 | #: admin/class-local-pickup-time-admin.php:206
79 | msgid "Wednesday Pickup Start Time"
80 | msgstr ""
81 |
82 | #: admin/class-local-pickup-time-admin.php:207
83 | msgid "This sets the pickup start time for Wednesday. Use 24-hour time format."
84 | msgstr ""
85 |
86 | #: admin/class-local-pickup-time-admin.php:215
87 | msgid "Wednesday Pickup End Time"
88 | msgstr ""
89 |
90 | #: admin/class-local-pickup-time-admin.php:216
91 | msgid "This sets the pickup end time for Wednesday. Use 24-hour time format."
92 | msgstr ""
93 |
94 | #: admin/class-local-pickup-time-admin.php:224
95 | msgid "Thursday Pickup Start Time"
96 | msgstr ""
97 |
98 | #: admin/class-local-pickup-time-admin.php:225
99 | msgid "This sets the pickup start time for Thursday. Use 24-hour time format."
100 | msgstr ""
101 |
102 | #: admin/class-local-pickup-time-admin.php:233
103 | msgid "Thursday Pickup End Time"
104 | msgstr ""
105 |
106 | #: admin/class-local-pickup-time-admin.php:234
107 | msgid "This sets the pickup end time for Thursday. Use 24-hour time format."
108 | msgstr ""
109 |
110 | #: admin/class-local-pickup-time-admin.php:242
111 | msgid "Friday Pickup Start Time"
112 | msgstr ""
113 |
114 | #: admin/class-local-pickup-time-admin.php:243
115 | msgid "This sets the pickup start time for Friday. Use 24-hour time format."
116 | msgstr ""
117 |
118 | #: admin/class-local-pickup-time-admin.php:251
119 | msgid "Friday Pickup End Time"
120 | msgstr ""
121 |
122 | #: admin/class-local-pickup-time-admin.php:252
123 | msgid "This sets the pickup end time for Friday. Use 24-hour time format."
124 | msgstr ""
125 |
126 | #: admin/class-local-pickup-time-admin.php:260
127 | msgid "Saturday Pickup Start Time"
128 | msgstr ""
129 |
130 | #: admin/class-local-pickup-time-admin.php:261
131 | msgid "This sets the pickup start time for Saturday. Use 24-hour time format."
132 | msgstr ""
133 |
134 | #: admin/class-local-pickup-time-admin.php:269
135 | msgid "Saturday Pickup End Time"
136 | msgstr ""
137 |
138 | #: admin/class-local-pickup-time-admin.php:270
139 | msgid "This sets the pickup end time for Saturday. Use 24-hour time format."
140 | msgstr ""
141 |
142 | #: admin/class-local-pickup-time-admin.php:278
143 | msgid "Sunday Pickup Start Time"
144 | msgstr ""
145 |
146 | #: admin/class-local-pickup-time-admin.php:279
147 | msgid "This sets the pickup start time for Sunday. Use 24-hour time format."
148 | msgstr ""
149 |
150 | #: admin/class-local-pickup-time-admin.php:287
151 | msgid "Sunday Pickup End Time"
152 | msgstr ""
153 |
154 | #: admin/class-local-pickup-time-admin.php:288
155 | msgid "This sets the pickup end time for Sunday. Use 24-hour time format."
156 | msgstr ""
157 |
158 | #: admin/class-local-pickup-time-admin.php:300
159 | msgid "Store Closed for Local Pickup"
160 | msgstr ""
161 |
162 | #: admin/class-local-pickup-time-admin.php:302
163 | msgid "The following options affect which days to not allow order pickups."
164 | msgstr ""
165 |
166 | #: admin/class-local-pickup-time-admin.php:306
167 | msgid "Store Closing Days (use MM/DD/YYYY format)"
168 | msgstr ""
169 |
170 | #: admin/class-local-pickup-time-admin.php:307
171 | msgid ""
172 | "This sets the days the store is closed. Enter one date per line, in format "
173 | "MM/DD/YYYY."
174 | msgstr ""
175 |
176 | #: admin/class-local-pickup-time-admin.php:319
177 | msgid "Order Pickup Intervals & Delays"
178 | msgstr ""
179 |
180 | #: admin/class-local-pickup-time-admin.php:321
181 | msgid ""
182 | "The following options are used to calculate the available time slots for "
183 | "pickup."
184 | msgstr ""
185 |
186 | #: admin/class-local-pickup-time-admin.php:325
187 | msgid "Pickup Time Interval"
188 | msgstr ""
189 |
190 | #: admin/class-local-pickup-time-admin.php:326
191 | msgid "Choose the time interval for allowing local pickup orders."
192 | msgstr ""
193 |
194 | #: admin/class-local-pickup-time-admin.php:334
195 | #: admin/class-local-pickup-time-admin.php:354
196 | msgid "5 minutes"
197 | msgstr ""
198 |
199 | #: admin/class-local-pickup-time-admin.php:335
200 | #: admin/class-local-pickup-time-admin.php:355
201 | msgid "10 minutes"
202 | msgstr ""
203 |
204 | #: admin/class-local-pickup-time-admin.php:336
205 | #: admin/class-local-pickup-time-admin.php:356
206 | msgid "15 minutes"
207 | msgstr ""
208 |
209 | #: admin/class-local-pickup-time-admin.php:337
210 | #: admin/class-local-pickup-time-admin.php:357
211 | msgid "20 minutes"
212 | msgstr ""
213 |
214 | #: admin/class-local-pickup-time-admin.php:338
215 | #: admin/class-local-pickup-time-admin.php:358
216 | msgid "30 minutes"
217 | msgstr ""
218 |
219 | #: admin/class-local-pickup-time-admin.php:339
220 | #: admin/class-local-pickup-time-admin.php:359
221 | msgid "45 minutes"
222 | msgstr ""
223 |
224 | #: admin/class-local-pickup-time-admin.php:340
225 | #: admin/class-local-pickup-time-admin.php:360
226 | msgid "1 hour"
227 | msgstr ""
228 |
229 | #: admin/class-local-pickup-time-admin.php:341
230 | #: admin/class-local-pickup-time-admin.php:361
231 | msgid "2 hours"
232 | msgstr ""
233 |
234 | #: admin/class-local-pickup-time-admin.php:345
235 | msgid "Pickup Time Delay"
236 | msgstr ""
237 |
238 | #: admin/class-local-pickup-time-admin.php:346
239 | msgid ""
240 | "Choose the time delay from the time of ordering for allowing local pickup "
241 | "orders."
242 | msgstr ""
243 |
244 | #: admin/class-local-pickup-time-admin.php:362
245 | msgid "4 hours"
246 | msgstr ""
247 |
248 | #: admin/class-local-pickup-time-admin.php:363
249 | msgid "8 hours"
250 | msgstr ""
251 |
252 | #: admin/class-local-pickup-time-admin.php:364
253 | msgid "16 hours"
254 | msgstr ""
255 |
256 | #: admin/class-local-pickup-time-admin.php:365
257 | msgid "24 hours"
258 | msgstr ""
259 |
260 | #: admin/class-local-pickup-time-admin.php:366
261 | msgid "36 hours"
262 | msgstr ""
263 |
264 | #: admin/class-local-pickup-time-admin.php:367
265 | msgid "48 hours"
266 | msgstr ""
267 |
268 | #: admin/class-local-pickup-time-admin.php:368
269 | msgid "3 days"
270 | msgstr ""
271 |
272 | #: admin/class-local-pickup-time-admin.php:369
273 | msgid "5 days"
274 | msgstr ""
275 |
276 | #: admin/class-local-pickup-time-admin.php:370
277 | msgid "1 week"
278 | msgstr ""
279 |
280 | #: admin/class-local-pickup-time-admin.php:374
281 | msgid "Pickup Time Open Days Ahead"
282 | msgstr ""
283 |
284 | #: admin/class-local-pickup-time-admin.php:375
285 | msgid ""
286 | "Choose the number of open days ahead for allowing local pickup orders. This "
287 | "is inclusive of the current day, if timeslots are still available."
288 | msgstr ""
289 |
290 | #: admin/class-local-pickup-time-admin.php:391
291 | msgid "Additional Settings"
292 | msgstr ""
293 |
294 | #: admin/class-local-pickup-time-admin.php:393
295 | msgid "The following options provide additional capabilities for customization."
296 | msgstr ""
297 |
298 | #: admin/class-local-pickup-time-admin.php:397
299 | msgid "Require Checkout Pickup Time?"
300 | msgstr ""
301 |
302 | #: admin/class-local-pickup-time-admin.php:398
303 | msgid "Required"
304 | msgstr ""
305 |
306 | #: admin/class-local-pickup-time-admin.php:399
307 | msgid "This controls whether a Pickup Time is required during checkout."
308 | msgstr ""
309 |
310 | #: admin/class-local-pickup-time-admin.php:407
311 | msgid "Limit to Local Pickup Shipping Methods?"
312 | msgstr ""
313 |
314 | #: admin/class-local-pickup-time-admin.php:408
315 | msgid "Limit"
316 | msgstr ""
317 |
318 | #: admin/class-local-pickup-time-admin.php:409
319 | msgid ""
320 | "This controls whether Local Pickup Times are restricted to Local Shipping "
321 | "methods. This requires enabling \"Pickup Time\" on each individual "
322 | "Local Pickup Shipping method, within each Shiping Zone."
323 | msgstr ""
324 |
325 | #: admin/class-local-pickup-time-admin.php:465
326 | #: admin/class-local-pickup-time-admin.php:632
327 | #: public/class-local-pickup-time.php:863
328 | #: public/class-local-pickup-time.php:941
329 | msgid "Pickup Time"
330 | msgstr ""
331 |
332 | #: admin/class-local-pickup-time-admin.php:466
333 | msgid "Enable"
334 | msgstr ""
335 |
336 | #: admin/class-local-pickup-time-admin.php:467
337 | msgid "This controls whether a Pickup Time is tied to the shipping method."
338 | msgstr ""
339 |
340 | #: admin/class-local-pickup-time-admin.php:519
341 | #. translators: %s: number of orders
342 | msgid "Ready for Pickup (%s)"
343 | msgid_plural "Ready for Pickup (%s)"
344 | msgstr[0] ""
345 | msgstr[1] ""
346 |
347 | #: admin/class-local-pickup-time-admin.php:552
348 | msgid "Change status to ready for pickup"
349 | msgstr ""
350 |
351 | #: admin/class-local-pickup-time-admin.php:611
352 | msgid "Pickup Time:"
353 | msgstr ""
354 |
355 | #: admin/emails/class-wc-email-customer-ready-for-pickup-order.php:30
356 | msgid "Ready for Pickup order"
357 | msgstr ""
358 |
359 | #: admin/emails/class-wc-email-customer-ready-for-pickup-order.php:31
360 | msgid ""
361 | "Order ready for pickup emails are sent to the customer when the order is "
362 | "marked Ready for Pickup."
363 | msgstr ""
364 |
365 | #: admin/emails/class-wc-email-customer-ready-for-pickup-order.php:85
366 | msgid "Your {site_title} order is now ready for pickup"
367 | msgstr ""
368 |
369 | #: admin/emails/class-wc-email-customer-ready-for-pickup-order.php:95
370 | msgid "We look forward to your arrival"
371 | msgstr ""
372 |
373 | #: admin/emails/class-wc-email-customer-ready-for-pickup-order.php:147
374 | msgid "We look forward to your pending arrival."
375 | msgstr ""
376 |
377 | #: public/class-local-pickup-time.php:598
378 | msgid "Monday"
379 | msgstr ""
380 |
381 | #: public/class-local-pickup-time.php:599
382 | msgid "Tuesday"
383 | msgstr ""
384 |
385 | #: public/class-local-pickup-time.php:600
386 | msgid "Wednesday"
387 | msgstr ""
388 |
389 | #: public/class-local-pickup-time.php:601
390 | msgid "Thursday"
391 | msgstr ""
392 |
393 | #: public/class-local-pickup-time.php:602
394 | msgid "Friday"
395 | msgstr ""
396 |
397 | #: public/class-local-pickup-time.php:603
398 | msgid "Saturday"
399 | msgstr ""
400 |
401 | #: public/class-local-pickup-time.php:604
402 | msgid "Sunday"
403 | msgstr ""
404 |
405 | #: public/class-local-pickup-time.php:888
406 | #: public/class-local-pickup-time.php:914
407 | msgid "Expired or invalid submission!."
408 | msgstr ""
409 |
410 | #: public/class-local-pickup-time.php:894
411 | msgid "Please select a pickup time."
412 | msgstr ""
413 |
414 | #: public/class-local-pickup-time.php:962
415 | msgid "None"
416 | msgstr ""
417 |
418 | #: templates/emails/customer-ready-for-pickup-order.php:32
419 | #: templates/emails/plain/customer-ready-for-pickup-order.php:29
420 | #. translators: %s: Customer first name
421 | msgid "Hi %s,"
422 | msgstr ""
423 |
424 | #: templates/emails/customer-ready-for-pickup-order.php:33
425 | #: templates/emails/plain/customer-ready-for-pickup-order.php:30
426 | msgid "We have finished preparing your order for pickup."
427 | msgstr ""
428 |
429 | #. Plugin Name of the plugin/theme
430 | msgid "WooCommerce Local Pickup Time Select"
431 | msgstr ""
432 |
433 | #. Plugin URI of the plugin/theme
434 | msgid "https://github.com/WC-Local-Pickup/woocommerce-local-pickup-time"
435 | msgstr ""
436 |
437 | #. Description of the plugin/theme
438 | msgid ""
439 | "Add an an option to WooCommerce checkout pages for Local Pickup that allows "
440 | "the user to choose a pickup time."
441 | msgstr ""
442 |
443 | #. Author of the plugin/theme
444 | msgid "Tim Nolte"
445 | msgstr ""
446 |
447 | #. Author URI of the plugin/theme
448 | msgid "https://www.ndigitals.com/"
449 | msgstr ""
450 |
451 | #: admin/class-local-pickup-time-admin.php:513
452 | #: admin/class-local-pickup-time-admin.php:535
453 | msgctxt "Order status"
454 | msgid "Ready for Pickup"
455 | msgstr ""
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "woocommerce-local-pickup-time",
3 | "version": "1.4.2",
4 | "description": "Add an an option to WooCommerce checkout pages for Local Pickup that allows the user to choose a pickup time.",
5 | "main": "Gruntfile.js",
6 | "repository": {
7 | "type": "git",
8 | "url": "https://github.com/WC-Local-Pickup/woocommerce-local-pickup-time"
9 | },
10 | "keywords": [
11 | "wordpress",
12 | "woocommerce"
13 | ],
14 | "author": "Tim Nolte",
15 | "license": "GPL-2.0+",
16 | "bugs": {
17 | "url": "https://github.com/WC-Local-Pickup/woocommerce-local-pickup-time/issues"
18 | },
19 | "homepage": "https://github.com/WC-Local-Pickup/woocommerce-local-pickup-time#readme",
20 | "dependencies": {
21 | "dev-require": "^0.1.0"
22 | },
23 | "engines": {
24 | "node": ">=14.0.0 <18",
25 | "npm": ">=6.0.0 <9"
26 | },
27 | "devDependencies": {
28 | "@floatwork/grunt-po2mo": "^0.4.1",
29 | "@ndigitals/grunt-checkrepo": "^0.2.5",
30 | "@wordpress/scripts": "^26.19.0",
31 | "check-node-version": "^4.2.1",
32 | "grunt": "~1.5.3",
33 | "grunt-checkbranch": "^1.0.4",
34 | "grunt-checktextdomain": "^1.0.1",
35 | "grunt-cli": "^1.4.3",
36 | "grunt-contrib-clean": "^2.0.1",
37 | "grunt-contrib-copy": "^1.0.0",
38 | "grunt-gitinfo": "^0.1.9",
39 | "grunt-shell": "^4.0.0",
40 | "grunt-version": "^3.0.1",
41 | "grunt-wp-i18n": "^1.0.3",
42 | "grunt-wp-readme-to-markdown": "^2.1.0",
43 | "load-grunt-tasks": "^3.5.2",
44 | "puppeteer": "^1.20.0",
45 | "typescript": "^3.9.10"
46 | },
47 | "resolutions": {
48 | "getobject": "^1.0.0",
49 | "shelljs": "^0.8.5"
50 | },
51 | "scripts": {
52 | "preinstall": "npx force-resolutions --yes",
53 | "setup:wc-data": "npm run wp -- \"import wp-content/plugins/woocommerce/sample-data/sample_products.xml --authors=create\"",
54 | "build": "npm run grunt build",
55 | "build:i18n": "npm run grunt i18n",
56 | "release": "npm run grunt release",
57 | "version": "npm run grunt version",
58 | "version:bump": "npm version --no-git-tag-version",
59 | "grunt": "node_modules/.bin/grunt",
60 | "check:engines": "wp-scripts check-engines",
61 | "check:licenses": "wp-scripts check-licenses",
62 | "check:i18n": "npm run grunt checktextdomain",
63 | "composer": "docker-compose run composer",
64 | "test": "npm run grunt test"
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/phpcs.xml.dist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Generally-applicable sniffs for WordPress plugins
9 |
10 |
16 |
17 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 | .
44 |
45 | */dist/*
46 | */node_modules/*
47 | */tools/*
48 | */vendor/*
49 |
50 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
66 |
67 |
70 |
71 |
72 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 | tests/
104 | tests/*
105 |
106 |
107 |
108 |
109 |
110 |
--------------------------------------------------------------------------------
/phpstan.neon.dist:
--------------------------------------------------------------------------------
1 | parameters:
2 | level: max
3 | inferPrivatePropertyTypeFromConstructor: true
4 | reportUnmatchedIgnoredErrors: false
5 |
6 | bootstrapFiles:
7 | - tests/phpstan-bootstrap.php
8 | - %rootDir%/../../php-stubs/wordpress-stubs/wordpress-stubs.php
9 | - %rootDir%/../../php-stubs/woocommerce-stubs/woocommerce-stubs.php
10 |
11 | paths:
12 | - ./
13 | - admin/
14 | - public/
15 |
16 | excludePaths:
17 | analyse:
18 | - node_modules/
19 | - scripts/
20 | - tests/
21 | - vendor/
22 | analyseAndScan:
23 | - tools/
24 |
25 | dynamicConstantNames:
26 | - DOING_AJAX
27 |
28 | ignoreErrors:
29 | # Uses func_get_args()
30 | # - '#^Function apply_filters(_ref_array)? invoked with [34567] parameters, 2 required\.$#'
31 | # Fixed in WordPress 5.3
32 | # - '#^Function do_action(_ref_array)? invoked with [3456] parameters, 1-2 required\.$#'
33 | # - '#^Function current_user_can invoked with 2 parameters, 1 required\.$#'
34 | # - '#^Function add_query_arg invoked with [123] parameters?, 0 required\.$#'
35 | # - '#^Function wp_sprintf invoked with [23456] parameters, 1 required\.$#'
36 | # - '#^Function add_post_type_support invoked with [345] parameters, 2 required\.$#'
37 | # - '#^Function ((get|add)_theme_support|current_theme_supports) invoked with [2345] parameters, 1 required\.$#'
38 | # https://core.trac.wordpress.org/ticket/43304
39 | # - '/^Parameter #2 \$deprecated of function load_plugin_textdomain expects string, false given\.$/'
40 | # WP-CLI accepts a class as callable
41 | # - '/^Parameter #2 \$callable of static method WP_CLI::add_command\(\) expects callable\(\): mixed, \S+ given\.$/'
42 | # Please consider commenting ignores: issue URL or reason for ignoring
43 |
--------------------------------------------------------------------------------
/phpunit.xml.dist:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
15 |
16 |
17 | tests/phpunit/woocommerce-local-pickup-time_test.php
18 |
19 |
20 | tests/phpunit/admin/
21 |
22 |
23 | tests/phpunit/public/
24 |
25 |
26 |
27 |
28 | woocommerce-local-pickup-time.php
29 | admin/
30 | public/
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/readme.txt:
--------------------------------------------------------------------------------
1 | === WooCommerce Local Pickup Time Select ===
2 | Contributors: tnolte, mjbanks, vyskoczilova
3 | Donate link: https://www.ndigitals.com/donate/
4 | Tags: woocommcerce, shipping, local pickup, checkout fields, ecommerce, e-commerce, wordpress ecommerce
5 | Requires at least: 4.9
6 | Tested up to: 6.0.1
7 | Stable tag: 1.4.2
8 | Requires PHP: 7.2
9 | License: GPLv2 or later
10 | License URI: http://www.gnu.org/licenses/gpl-2.0.html
11 |
12 | 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.
13 |
14 | == Description ==
15 |
16 | Local Pickup Time extends the [WooCommerce](http://wordpress.org/plugins/woocommerce/) Local Pickup shipping option to allow users to choose a pickup time.
17 |
18 | 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.
19 |
20 | = Features =
21 |
22 | - **Daily Pickup Available Start/End Time:** Set the starting time and ending time for each day that pickups are available.
23 | - **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.
24 | - **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.
25 | - **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.
26 | - **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.
27 | - **Ability to limit to specific Shipping Zones.** Pickup Time can be limited to only specific Shipping Zones.
28 | - **"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.
29 | - **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".
30 |
31 | == Installation ==
32 |
33 | = Using The WordPress Dashboard =
34 |
35 | 1. Navigate to the 'Add New' in the plugins dashboard
36 | 2. Search for 'WooCommerce Local Pickup Time Select'
37 | 3. Click 'Install Now'
38 | 4. Activate the plugin on the Plugin dashboard
39 |
40 | = Uploading in WordPress Dashboard =
41 |
42 | 1. Download a zip file of the plugins, which can be done from the WordPress plugin directory
43 | 2. Navigate to 'Add New' in the plugins dashboard
44 | 3. Click on the "Upload Plugin" button
45 | 4. Choose the downloaded Zip file from your computer with "Choose File"
46 | 5. Click 'Install Now'
47 | 6. Activate the plugin in the Plugin dashboard
48 |
49 | = Using FTP =
50 |
51 | 1. Download a zip file of the plugins, which can be done from the WordPress plugin directory
52 | 2. Extract the Zip file to a directory on your computer
53 | 3. Upload the `woocommerce-local-pickup-time-select` directory to the `/wp-content/plugins/` directory
54 | 4. Activate the plugin in the Plugin dashboard
55 |
56 | === Usage ===
57 |
58 | 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.
59 |
60 | == Frequently Asked Questions ==
61 |
62 | = Things aren't displaying properly =
63 |
64 | - Go to `WooCommerce -> Settings -> Shipping -> Local Pickup Time settings` and "Save Changes" to trigger the options to update.
65 | - Make sure to set your Timezone on the WordPress Admin Settings page to a proper value that is not a UTC offset.
66 | - 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.
67 |
68 | = How do I change the location of the pickup time select box during checkout? =
69 |
70 | The location, by default, is hooked to `woocommerce_after_order_notes`. This can be overridden using the `local_pickup_time_select_location` filter. [A list of available hooks can be seen in the WooCommerce documentation](http://docs.woothemes.com/document/hooks/).
71 |
72 | = How do I change the location of the pickup time shown in the admin Order Details screen? =
73 |
74 | The location, by default, is hooked to `woocommerce_admin_order_data_after_billing_address`. This can be overridden using the `local_pickup_time_admin_location` filter. [A list of available hooks can be seen in the WooCommerce documentation](http://docs.woothemes.com/document/hooks/).
75 |
76 | == Screenshots ==
77 |
78 | 1. Frontend Display on Checkout Page
79 | 2. Shipping Settings -> Local Pickup Time Settings Screen
80 | 3. Local Pickup Shipping Method Settings Screen
81 | 4. Order Listing Includes Pickup Date/Time
82 | 5. Order Details Screen Includes Pickup Date/Time
83 | 6. Ready for Pickup Order Email Notification
84 |
85 | == Changelog ==
86 |
87 | ### 1.4.2
88 | #### Fixed
89 | - Checkout prevented on non-Local Shipping methods.
90 | - Updated WordPress Supported Versions.
91 |
92 | ### 1.4.1
93 | #### Changed
94 | - Updated the README to provide details and usage on the latest functionality and features.
95 |
96 | #### Fixed
97 | - Possible PHP Fatal Error when using new Local Pickup association functionality.
98 |
99 | #### Added
100 | - Added new screenshot for "Ready for Pickup" email notification.
101 |
102 | ### 1.4.0
103 | #### Changed
104 | - Updated WordPress & WooCommerce Supported Versions.
105 |
106 | #### Fixed
107 | - Updated Plugin Development Dependencies
108 |
109 | #### Added
110 | - Added New Ready for Pickup Order Status & Customer Email
111 | - Added Pickup Time Required & Local Pickup Link Capabilities
112 |
113 | --------
114 |
115 | [See the previous changelogs here](https://github.com/WC-Local-Pickup/woocommerce-local-pickup-time/blob/main/CHANGELOG.md#changelog)
116 |
--------------------------------------------------------------------------------
/templates/emails/customer-ready-for-pickup-order.php:
--------------------------------------------------------------------------------
1 | get_billing_first_name() ) ); /* @phpstan-ignore-line */
33 | $email_order_note = esc_html__( 'We have finished preparing your order for pickup.', 'woocommerce-local-pickup-time-select' );
34 |
35 | $email_content = <<{$email_salutation}
37 | {$email_order_note}
38 | HTML;
39 |
40 | echo wp_kses( $email_content, array( array( '' ) ) );
41 |
42 | /*
43 | * @hooked WC_Emails::order_details() Shows the order details table.
44 | * @hooked WC_Structured_Data::generate_order_data() Generates structured data.
45 | * @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
46 | *
47 | * @since 1.4.0
48 | */
49 | /* @phpstan-ignore-next-line */
50 | do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
51 |
52 | /*
53 | * @hooked WC_Emails::order_meta() Shows order meta data.
54 | */
55 | /* @phpstan-ignore-next-line */
56 | do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
57 |
58 | /*
59 | * @hooked WC_Emails::customer_details() Shows customer details
60 | * @hooked WC_Emails::email_address() Shows email address
61 | */
62 | /* @phpstan-ignore-next-line */
63 | do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
64 |
65 | /**
66 | * Show user-defined additional content - this is set in each email's settings.
67 | */
68 | /* @phpstan-ignore-next-line */
69 | if ( $additional_content ) {
70 | echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
71 | }
72 |
73 | /*
74 | * @hooked WC_Emails::email_footer() Output the email footer
75 | */
76 | /* @phpstan-ignore-next-line */
77 | do_action( 'woocommerce_email_footer', $email );
78 |
--------------------------------------------------------------------------------
/templates/emails/plain/customer-ready-for-pickup-order.php:
--------------------------------------------------------------------------------
1 | get_billing_first_name() ) ) . "\n\n"; /* @phpstan-ignore-line */
30 | echo esc_html__( 'We have finished preparing your order for pickup.', 'woocommerce-local-pickup-time-select' ) . "\n\n";
31 |
32 | /*
33 | * @hooked WC_Emails::order_details() Shows the order details table.
34 | * @hooked WC_Structured_Data::generate_order_data() Generates structured data.
35 | * @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
36 | * @since 1.4.0
37 | */
38 | /* @phpstan-ignore-next-line */
39 | do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
40 |
41 | echo "\n----------------------------------------\n\n";
42 |
43 | /*
44 | * @hooked WC_Emails::order_meta() Shows order meta data.
45 | */
46 | /* @phpstan-ignore-next-line */
47 | do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
48 |
49 | /*
50 | * @hooked WC_Emails::customer_details() Shows customer details
51 | * @hooked WC_Emails::email_address() Shows email address
52 | */
53 | /* @phpstan-ignore-next-line */
54 | do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
55 |
56 | echo "\n\n----------------------------------------\n\n";
57 |
58 | /**
59 | * Show user-defined additional content - this is set in each email's settings.
60 | */
61 | /* @phpstan-ignore-next-line */
62 | if ( $additional_content ) {
63 | echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
64 | echo "\n\n----------------------------------------\n\n";
65 | }
66 |
67 | echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );
68 |
--------------------------------------------------------------------------------
/tests/db-wordpress_test.sql:
--------------------------------------------------------------------------------
1 | CREATE DATABASE IF NOT EXISTS wordpress_test;
2 | GRANT ALL PRIVILEGES ON wordpress_test.* TO 'wordpress'@'localhost' IDENTIFIED BY 'wordpress';
3 | GRANT ALL PRIVILEGES ON wordpress_test.* TO 'wordpress'@'%' IDENTIFIED BY 'wordpress';
4 | FLUSH PRIVILEGES;
5 |
--------------------------------------------------------------------------------
/tests/phpstan-bootstrap.php:
--------------------------------------------------------------------------------
1 |
7 | * @author Tim Nolte
8 | * @copyright 2014-2024 WC Local Pickup Time
9 | * @license http://www.gnu.org/licenses/gpl-2.0.txt GPL-2.0+
10 | * @link https://github.com/WC-Local-Pickup
11 | */
12 |
13 | // Define whether running under WP-CLI.
14 | defined( 'WP_CLI' ) || define( 'WP_CLI', false );
15 |
16 | // Define WooCommerce path for autoloading in phpstan.
17 | defined( 'WC_ABSPATH' ) || define( 'WC_ABSPATH', 'tools/local-dev/wp-content/plugins/woocommerce/' );
18 |
19 | // Define WordPress language directory.
20 | defined( 'WP_LANG_DIR' ) || define( 'WP_LANG_DIR', 'tools/local-dev/wp/wp-includes/languages/' );
21 |
22 | // Define Plugin base directory.
23 | defined( 'WCLOCALPICKUPTIME_PLUGIN_BASE' ) || define( 'WCLOCALPICKUPTIME_PLUGIN_BASE', '.' );
24 |
25 | // Define Plugin base path.
26 | defined( 'WCLOCALPICKUPTIME_PLUGIN_DIR' ) || define( 'WCLOCALPICKUPTIME_PLUGIN_DIR', dirname( __DIR__ ) );
27 |
--------------------------------------------------------------------------------
/tests/phpunit/admin/class-local-pickup-time-admin_test.php:
--------------------------------------------------------------------------------
1 | assertInstanceOf( Local_Pickup_Time_Admin::class, $plugin_admin->get_instance() );
42 | */
43 |
44 | $this->assertTrue( true, 'Needs Unit Tests.' );
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/tests/phpunit/admin/email/class-wc-email-customer-ready-for-pickup-order_test.php:
--------------------------------------------------------------------------------
1 | assertTrue( true, 'Needs Unit Tests.' );
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/tests/phpunit/bootstrap.php:
--------------------------------------------------------------------------------
1 | assertInstanceOf( Local_Pickup_Time::class, $plugin->get_instance() );
42 | */
43 |
44 | $this->assertTrue( true, 'Needs Unit Tests.' );
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/tests/phpunit/woocommerce-local-pickup-time_test.php:
--------------------------------------------------------------------------------
1 | assertTrue( true, 'Needs Unit Tests.' );
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/tests/phpunit/wp-tests-config.php:
--------------------------------------------------------------------------------
1 | for detailed information.
5 | # In particular, see
6 | #
7 | # for a discussion of each configuration directive.
8 | #
9 | # Do NOT simply read the instructions in here without understanding
10 | # what they do. They're here only as hints or reminders. If you are unsure
11 | # consult the online docs. You have been warned.
12 | #
13 | # Configuration and logfile names: If the filenames you specify for many
14 | # of the server's control files begin with "/" (or "drive:/" for Win32), the
15 | # server will use that explicit path. If the filenames do *not* begin
16 | # with "/", the value of ServerRoot is prepended -- so "logs/access_log"
17 | # with ServerRoot set to "/usr/local/apache2" will be interpreted by the
18 | # server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log"
19 | # will be interpreted as '/logs/access_log'.
20 |
21 | #
22 | # ServerRoot: The top of the directory tree under which the server's
23 | # configuration, error, and log files are kept.
24 | #
25 | # Do not add a slash at the end of the directory path. If you point
26 | # ServerRoot at a non-local disk, be sure to specify a local disk on the
27 | # Mutex directive, if file-based mutexes are used. If you wish to share the
28 | # same ServerRoot for multiple httpd daemons, you will need to change at
29 | # least PidFile.
30 | #
31 | ServerRoot "/usr/local/apache2"
32 |
33 | #
34 | # Mutex: Allows you to set the mutex mechanism and mutex file directory
35 | # for individual mutexes, or change the global defaults
36 | #
37 | # Uncomment and change the directory if mutexes are file-based and the default
38 | # mutex file directory is not on a local disk or is not appropriate for some
39 | # other reason.
40 | #
41 | # Mutex default:logs
42 |
43 | #
44 | # Listen: Allows you to bind Apache to specific IP addresses and/or
45 | # ports, instead of the default. See also the
46 | # directive.
47 | #
48 | # Change this to Listen on specific IP addresses as shown below to
49 | # prevent Apache from glomming onto all bound IP addresses.
50 | #
51 | #Listen 12.34.56.78:80
52 | Listen 80
53 |
54 | #
55 | # Dynamic Shared Object (DSO) Support
56 | #
57 | # To be able to use the functionality of a module which was built as a DSO you
58 | # have to place corresponding `LoadModule' lines at this location so the
59 | # directives contained in it are actually available _before_ they are used.
60 | # Statically compiled modules (those listed by `httpd -l') do not need
61 | # to be loaded here.
62 | #
63 | # Example:
64 | # LoadModule foo_module modules/mod_foo.so
65 | #
66 | LoadModule mpm_event_module modules/mod_mpm_event.so
67 | #LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
68 | #LoadModule mpm_worker_module modules/mod_mpm_worker.so
69 | LoadModule authn_file_module modules/mod_authn_file.so
70 | #LoadModule authn_dbm_module modules/mod_authn_dbm.so
71 | #LoadModule authn_anon_module modules/mod_authn_anon.so
72 | #LoadModule authn_dbd_module modules/mod_authn_dbd.so
73 | #LoadModule authn_socache_module modules/mod_authn_socache.so
74 | LoadModule authn_core_module modules/mod_authn_core.so
75 | LoadModule authz_host_module modules/mod_authz_host.so
76 | LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
77 | LoadModule authz_user_module modules/mod_authz_user.so
78 | #LoadModule authz_dbm_module modules/mod_authz_dbm.so
79 | #LoadModule authz_owner_module modules/mod_authz_owner.so
80 | #LoadModule authz_dbd_module modules/mod_authz_dbd.so
81 | LoadModule authz_core_module modules/mod_authz_core.so
82 | #LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
83 | #LoadModule authnz_fcgi_module modules/mod_authnz_fcgi.so
84 | LoadModule access_compat_module modules/mod_access_compat.so
85 | LoadModule auth_basic_module modules/mod_auth_basic.so
86 | #LoadModule auth_form_module modules/mod_auth_form.so
87 | #LoadModule auth_digest_module modules/mod_auth_digest.so
88 | #LoadModule allowmethods_module modules/mod_allowmethods.so
89 | #LoadModule isapi_module modules/mod_isapi.so
90 | #LoadModule file_cache_module modules/mod_file_cache.so
91 | #LoadModule cache_module modules/mod_cache.so
92 | #LoadModule cache_disk_module modules/mod_cache_disk.so
93 | #LoadModule cache_socache_module modules/mod_cache_socache.so
94 | #LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
95 | #LoadModule socache_dbm_module modules/mod_socache_dbm.so
96 | #LoadModule socache_memcache_module modules/mod_socache_memcache.so
97 | #LoadModule socache_redis_module modules/mod_socache_redis.so
98 | #LoadModule watchdog_module modules/mod_watchdog.so
99 | #LoadModule macro_module modules/mod_macro.so
100 | #LoadModule dbd_module modules/mod_dbd.so
101 | #LoadModule bucketeer_module modules/mod_bucketeer.so
102 | #LoadModule dumpio_module modules/mod_dumpio.so
103 | #LoadModule echo_module modules/mod_echo.so
104 | #LoadModule example_hooks_module modules/mod_example_hooks.so
105 | #LoadModule case_filter_module modules/mod_case_filter.so
106 | #LoadModule case_filter_in_module modules/mod_case_filter_in.so
107 | #LoadModule example_ipc_module modules/mod_example_ipc.so
108 | #LoadModule buffer_module modules/mod_buffer.so
109 | #LoadModule data_module modules/mod_data.so
110 | #LoadModule ratelimit_module modules/mod_ratelimit.so
111 | LoadModule reqtimeout_module modules/mod_reqtimeout.so
112 | #LoadModule ext_filter_module modules/mod_ext_filter.so
113 | #LoadModule request_module modules/mod_request.so
114 | #LoadModule include_module modules/mod_include.so
115 | LoadModule filter_module modules/mod_filter.so
116 | #LoadModule reflector_module modules/mod_reflector.so
117 | #LoadModule substitute_module modules/mod_substitute.so
118 | #LoadModule sed_module modules/mod_sed.so
119 | #LoadModule charset_lite_module modules/mod_charset_lite.so
120 | #LoadModule deflate_module modules/mod_deflate.so
121 | #LoadModule xml2enc_module modules/mod_xml2enc.so
122 | #LoadModule proxy_html_module modules/mod_proxy_html.so
123 | #LoadModule brotli_module modules/mod_brotli.so
124 | LoadModule mime_module modules/mod_mime.so
125 | #LoadModule ldap_module modules/mod_ldap.so
126 | LoadModule log_config_module modules/mod_log_config.so
127 | #LoadModule log_debug_module modules/mod_log_debug.so
128 | #LoadModule log_forensic_module modules/mod_log_forensic.so
129 | #LoadModule logio_module modules/mod_logio.so
130 | #LoadModule lua_module modules/mod_lua.so
131 | LoadModule env_module modules/mod_env.so
132 | #LoadModule mime_magic_module modules/mod_mime_magic.so
133 | #LoadModule cern_meta_module modules/mod_cern_meta.so
134 | #LoadModule expires_module modules/mod_expires.so
135 | LoadModule headers_module modules/mod_headers.so
136 | #LoadModule ident_module modules/mod_ident.so
137 | #LoadModule usertrack_module modules/mod_usertrack.so
138 | #LoadModule unique_id_module modules/mod_unique_id.so
139 | LoadModule setenvif_module modules/mod_setenvif.so
140 | LoadModule version_module modules/mod_version.so
141 | #LoadModule remoteip_module modules/mod_remoteip.so
142 | LoadModule proxy_module modules/mod_proxy.so
143 | #LoadModule proxy_connect_module modules/mod_proxy_connect.so
144 | #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
145 | #LoadModule proxy_http_module modules/mod_proxy_http.so
146 | LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
147 | #LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
148 | #LoadModule proxy_uwsgi_module modules/mod_proxy_uwsgi.so
149 | #LoadModule proxy_fdpass_module modules/mod_proxy_fdpass.so
150 | #LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
151 | #LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
152 | #LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
153 | #LoadModule proxy_express_module modules/mod_proxy_express.so
154 | #LoadModule proxy_hcheck_module modules/mod_proxy_hcheck.so
155 | #LoadModule session_module modules/mod_session.so
156 | #LoadModule session_cookie_module modules/mod_session_cookie.so
157 | #LoadModule session_crypto_module modules/mod_session_crypto.so
158 | #LoadModule session_dbd_module modules/mod_session_dbd.so
159 | #LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
160 | #LoadModule slotmem_plain_module modules/mod_slotmem_plain.so
161 | #LoadModule ssl_module modules/mod_ssl.so
162 | #LoadModule optional_hook_export_module modules/mod_optional_hook_export.so
163 | #LoadModule optional_hook_import_module modules/mod_optional_hook_import.so
164 | #LoadModule optional_fn_import_module modules/mod_optional_fn_import.so
165 | #LoadModule optional_fn_export_module modules/mod_optional_fn_export.so
166 | #LoadModule dialup_module modules/mod_dialup.so
167 | #LoadModule http2_module modules/mod_http2.so
168 | #LoadModule proxy_http2_module modules/mod_proxy_http2.so
169 | #LoadModule md_module modules/mod_md.so
170 | #LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
171 | #LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
172 | #LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
173 | #LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
174 | LoadModule unixd_module modules/mod_unixd.so
175 | #LoadModule heartbeat_module modules/mod_heartbeat.so
176 | #LoadModule heartmonitor_module modules/mod_heartmonitor.so
177 | #LoadModule dav_module modules/mod_dav.so
178 | LoadModule status_module modules/mod_status.so
179 | LoadModule autoindex_module modules/mod_autoindex.so
180 | #LoadModule asis_module modules/mod_asis.so
181 | #LoadModule info_module modules/mod_info.so
182 | #LoadModule suexec_module modules/mod_suexec.so
183 |
184 | #LoadModule cgid_module modules/mod_cgid.so
185 |
186 |
187 | #LoadModule cgi_module modules/mod_cgi.so
188 |
189 | #LoadModule dav_fs_module modules/mod_dav_fs.so
190 | #LoadModule dav_lock_module modules/mod_dav_lock.so
191 | #LoadModule vhost_alias_module modules/mod_vhost_alias.so
192 | #LoadModule negotiation_module modules/mod_negotiation.so
193 | LoadModule dir_module modules/mod_dir.so
194 | #LoadModule imagemap_module modules/mod_imagemap.so
195 | #LoadModule actions_module modules/mod_actions.so
196 | #LoadModule speling_module modules/mod_speling.so
197 | #LoadModule userdir_module modules/mod_userdir.so
198 | LoadModule alias_module modules/mod_alias.so
199 | LoadModule rewrite_module modules/mod_rewrite.so
200 |
201 |
202 | #
203 | # If you wish httpd to run as a different user or group, you must run
204 | # httpd as root initially and it will switch.
205 | #
206 | # User/Group: The name (or #number) of the user/group to run httpd as.
207 | # It is usually good practice to create a dedicated user and group for
208 | # running httpd, as with most system services.
209 | #
210 | User www-data
211 | Group www-data
212 |
213 |
214 |
215 | # 'Main' server configuration
216 | #
217 | # The directives in this section set up the values used by the 'main'
218 | # server, which responds to any requests that aren't handled by a
219 | # definition. These values also provide defaults for
220 | # any containers you may define later in the file.
221 | #
222 | # All of these directives may appear inside containers,
223 | # in which case these default settings will be overridden for the
224 | # virtual host being defined.
225 | #
226 |
227 | #
228 | # ServerAdmin: Your address, where problems with the server should be
229 | # e-mailed. This address appears on some server-generated pages, such
230 | # as error documents. e.g. admin@your-domain.com
231 | #
232 | ServerAdmin you@example.com
233 |
234 | #
235 | # ServerName gives the name and port that the server uses to identify itself.
236 | # This can often be determined automatically, but we recommend you specify
237 | # it explicitly to prevent problems during startup.
238 | #
239 | # If your host doesn't have a registered DNS name, enter its IP address here.
240 | #
241 | #ServerName www.example.com:80
242 |
243 | #
244 | # Deny access to the entirety of your server's filesystem. You must
245 | # explicitly permit access to web content directories in other
246 | # blocks below.
247 | #
248 |
249 | AllowOverride none
250 | Require all denied
251 |
252 |
253 | #
254 | # Note that from this point forward you must specifically allow
255 | # particular features to be enabled - so if something's not working as
256 | # you might expect, make sure that you have specifically enabled it
257 | # below.
258 | #
259 |
260 | #
261 | # DocumentRoot: The directory out of which you will serve your
262 | # documents. By default, all requests are taken from this directory, but
263 | # symbolic links and aliases may be used to point to other locations.
264 | #
265 | DocumentRoot "/app"
266 |
267 |
268 | #
269 | # Possible values for the Options directive are "None", "All",
270 | # or any combination of:
271 | # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
272 | #
273 | # Note that "MultiViews" must be named *explicitly* --- "Options All"
274 | # doesn't give it to you.
275 | #
276 | # The Options directive is both complicated and important. Please see
277 | # http://httpd.apache.org/docs/2.4/mod/core.html#options
278 | # for more information.
279 | #
280 | Options Indexes FollowSymLinks
281 |
282 | #
283 | # AllowOverride controls what directives may be placed in .htaccess files.
284 | # It can be "All", "None", or any combination of the keywords:
285 | # AllowOverride FileInfo AuthConfig Limit
286 | #
287 | AllowOverride All
288 |
289 | #
290 | # Controls who can get stuff from this server.
291 | #
292 | Require all granted
293 |
294 | DirectoryIndex index.php
295 |
296 | # If the php file doesn't exist, disable the proxy handler.
297 | # This will allow .htaccess rewrite rules to work and
298 | # the client will see the default 404 page of Apache
299 | #RewriteCond %{REQUEST_FILENAME} \.php$
300 | #RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI} !-f
301 | #RewriteRule (.*) - [H=text/html]
302 |
303 |
304 | # This is to forward all PHP to php-fpm.
305 |
306 | SetHandler "proxy:fcgi://app:9000"
307 |
308 |
309 | #
310 | # DirectoryIndex: sets the file that Apache will serve if a directory
311 | # is requested.
312 | #
313 |
314 | DirectoryIndex index.html
315 |
316 |
317 | #
318 | # The following lines prevent .htaccess and .htpasswd files from being
319 | # viewed by Web clients.
320 | #
321 |
322 | Require all denied
323 |
324 |
325 | #
326 | # ErrorLog: The location of the error log file.
327 | # If you do not specify an ErrorLog directive within a
328 | # container, error messages relating to that virtual host will be
329 | # logged here. If you *do* define an error logfile for a
330 | # container, that host's errors will be logged there and not here.
331 | #
332 | ErrorLog /proc/self/fd/2
333 |
334 | #
335 | # LogLevel: Control the number of messages logged to the error_log.
336 | # Possible values include: debug, info, notice, warn, error, crit,
337 | # alert, emerg.
338 | #
339 | LogLevel warn
340 |
341 |
342 | #
343 | # The following directives define some format nicknames for use with
344 | # a CustomLog directive (see below).
345 | #
346 | LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
347 | LogFormat "%h %l %u %t \"%r\" %>s %b" common
348 |
349 |
350 | # You need to enable mod_logio.c to use %I and %O
351 | LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
352 |
353 |
354 | #
355 | # The location and format of the access logfile (Common Logfile Format).
356 | # If you do not define any access logfiles within a
357 | # container, they will be logged here. Contrariwise, if you *do*
358 | # define per- access logfiles, transactions will be
359 | # logged therein and *not* in this file.
360 | #
361 | CustomLog /proc/self/fd/1 common
362 |
363 | #
364 | # If you prefer a logfile with access, agent, and referer information
365 | # (Combined Logfile Format) you can use the following directive.
366 | #
367 | #CustomLog "logs/access_log" combined
368 |
369 |
370 |
371 | #
372 | # Redirect: Allows you to tell clients about documents that used to
373 | # exist in your server's namespace, but do not anymore. The client
374 | # will make a new request for the document at its new location.
375 | # Example:
376 | # Redirect permanent /foo http://www.example.com/bar
377 |
378 | #
379 | # Alias: Maps web paths into filesystem paths and is used to
380 | # access content that does not live under the DocumentRoot.
381 | # Example:
382 | # Alias /webpath /full/filesystem/path
383 | #
384 | # If you include a trailing / on /webpath then the server will
385 | # require it to be present in the URL. You will also likely
386 | # need to provide a section to allow access to
387 | # the filesystem path.
388 |
389 | #
390 | # ScriptAlias: This controls which directories contain server scripts.
391 | # ScriptAliases are essentially the same as Aliases, except that
392 | # documents in the target directory are treated as applications and
393 | # run by the server when requested rather than as documents sent to the
394 | # client. The same rules about trailing "/" apply to ScriptAlias
395 | # directives as to Alias.
396 | #
397 | ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
398 |
399 |
400 |
401 |
402 | #
403 | # ScriptSock: On threaded servers, designate the path to the UNIX
404 | # socket used to communicate with the CGI daemon of mod_cgid.
405 | #
406 | #Scriptsock cgisock
407 |
408 |
409 | #
410 | # "/usr/local/apache2/cgi-bin" should be changed to whatever your ScriptAliased
411 | # CGI directory exists, if you have that configured.
412 | #
413 |
414 | AllowOverride None
415 | Options None
416 | Require all granted
417 |
418 |
419 |
420 | #
421 | # Avoid passing HTTP_PROXY environment to CGI's on this or any proxied
422 | # backend servers which have lingering "httpoxy" defects.
423 | # 'Proxy' request header is undefined by the IETF, not listed by IANA
424 | #
425 | RequestHeader unset Proxy early
426 |
427 |
428 |
429 | #
430 | # TypesConfig points to the file containing the list of mappings from
431 | # filename extension to MIME-type.
432 | #
433 | TypesConfig conf/mime.types
434 |
435 | #
436 | # AddType allows you to add to or override the MIME configuration
437 | # file specified in TypesConfig for specific file types.
438 | #
439 | #AddType application/x-gzip .tgz
440 | #
441 | # AddEncoding allows you to have certain browsers uncompress
442 | # information on the fly. Note: Not all browsers support this.
443 | #
444 | #AddEncoding x-compress .Z
445 | #AddEncoding x-gzip .gz .tgz
446 | #
447 | # If the AddEncoding directives above are commented-out, then you
448 | # probably should define those extensions to indicate media types:
449 | #
450 | AddType application/x-compress .Z
451 | AddType application/x-gzip .gz .tgz
452 |
453 | #
454 | # AddHandler allows you to map certain file extensions to "handlers":
455 | # actions unrelated to filetype. These can be either built into the server
456 | # or added with the Action directive (see below)
457 | #
458 | # To use CGI scripts outside of ScriptAliased directories:
459 | # (You will also need to add "ExecCGI" to the "Options" directive.)
460 | #
461 | #AddHandler cgi-script .cgi
462 |
463 | # For type maps (negotiated resources):
464 | #AddHandler type-map var
465 |
466 | #
467 | # Filters allow you to process content before it is sent to the client.
468 | #
469 | # To parse .shtml files for server-side includes (SSI):
470 | # (You will also need to add "Includes" to the "Options" directive.)
471 | #
472 | #AddType text/html .shtml
473 | #AddOutputFilter INCLUDES .shtml
474 |
475 |
476 | #
477 | # The mod_mime_magic module allows the server to use various hints from the
478 | # contents of the file itself to determine its type. The MIMEMagicFile
479 | # directive tells the module where the hint definitions are located.
480 | #
481 | #MIMEMagicFile conf/magic
482 |
483 | #
484 | # Customizable error responses come in three flavors:
485 | # 1) plain text 2) local redirects 3) external redirects
486 | #
487 | # Some examples:
488 | #ErrorDocument 500 "The server made a boo boo."
489 | #ErrorDocument 404 /missing.html
490 | #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
491 | #ErrorDocument 402 http://www.example.com/subscription_info.html
492 | #
493 |
494 | #
495 | # MaxRanges: Maximum number of Ranges in a request before
496 | # returning the entire resource, or one of the special
497 | # values 'default', 'none' or 'unlimited'.
498 | # Default setting is to accept 200 Ranges.
499 | #MaxRanges unlimited
500 |
501 | #
502 | # EnableMMAP and EnableSendfile: On systems that support it,
503 | # memory-mapping or the sendfile syscall may be used to deliver
504 | # files. This usually improves server performance, but must
505 | # be turned off when serving from networked-mounted
506 | # filesystems or if support for these functions is otherwise
507 | # broken on your system.
508 | # Defaults: EnableMMAP On, EnableSendfile Off
509 | #
510 | #EnableMMAP off
511 | #EnableSendfile on
512 |
513 | # Supplemental configuration
514 | #
515 | # The configuration files in the conf/extra/ directory can be
516 | # included to add extra features or to modify the default configuration of
517 | # the server, or you may simply copy their contents here and change as
518 | # necessary.
519 |
520 | # Server-pool management (MPM specific)
521 | #Include conf/extra/httpd-mpm.conf
522 |
523 | # Multi-language error messages
524 | #Include conf/extra/httpd-multilang-errordoc.conf
525 |
526 | # Fancy directory listings
527 | #Include conf/extra/httpd-autoindex.conf
528 |
529 | # Language settings
530 | #Include conf/extra/httpd-languages.conf
531 |
532 | # User home directories
533 | #Include conf/extra/httpd-userdir.conf
534 |
535 | # Real-time info on requests and configuration
536 | #Include conf/extra/httpd-info.conf
537 |
538 | # Virtual hosts
539 | #Include conf/extra/httpd-vhosts.conf
540 |
541 | # Local access to the Apache HTTP Server Manual
542 | #Include conf/extra/httpd-manual.conf
543 |
544 | # Distributed authoring and versioning (WebDAV)
545 | #Include conf/extra/httpd-dav.conf
546 |
547 | # Various default settings
548 | #Include conf/extra/httpd-default.conf
549 |
550 | # Configure mod_proxy_html to understand HTML4/XHTML1
551 |
552 | Include conf/extra/proxy-html.conf
553 |
554 |
555 | # Secure (SSL/TLS) connections
556 | #Include conf/extra/httpd-ssl.conf
557 | #
558 | # Note: The following must must be present to support
559 | # starting without SSL on platforms with no /dev/random equivalent
560 | # but a statically compiled-in mod_ssl.
561 | #
562 |
563 | SSLRandomSeed startup builtin
564 | SSLRandomSeed connect builtin
565 |
566 |
567 |
--------------------------------------------------------------------------------
/tools/local-env/.htaccess:
--------------------------------------------------------------------------------
1 | # BEGIN WordPress
2 | # The directives (lines) between "BEGIN WordPress" and "END WordPress" are
3 | # dynamically generated, and should only be modified via WordPress filters.
4 | # Any changes to the directives between these markers will be overwritten.
5 |
6 | RewriteEngine On
7 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
8 | RewriteBase /
9 | RewriteRule ^index\.php$ - [L]
10 | RewriteCond %{REQUEST_FILENAME} !-f
11 | RewriteCond %{REQUEST_FILENAME} !-d
12 | RewriteRule . /index.php [L]
13 |
14 |
15 | # END WordPress
16 |
--------------------------------------------------------------------------------
/tools/local-env/index.php:
--------------------------------------------------------------------------------
1 | Host = SMTP_HOST;
31 |
32 | defined( 'SMTP_PORT' ) || define( 'SMTP_PORT', 1025 );
33 | // PHPMailer doesn't follow WordPress naming conventions so this can be ignored.
34 | // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
35 | $phpmailer->Port = SMTP_PORT;
36 |
37 | $phpmailer->IsSMTP();
38 |
39 | }
40 | add_action( 'phpmailer_init', 'mailhog_phpmailer_setup', 10, 1 );
41 |
42 | if ( defined('WP_CLI' ) ) {
43 | WP_CLI::add_wp_hook(
44 | 'wp_mail_from',
45 | function () {
46 | return SMTP_FROM;
47 | }
48 | );
49 | } else {
50 | add_filter(
51 | 'wp_mail_from',
52 | function () {
53 | return SMTP_FROM;
54 | }
55 | );
56 | }
57 |
58 |
--------------------------------------------------------------------------------
/tools/local-env/wp-content/mu-plugins/wp-cfm.php:
--------------------------------------------------------------------------------
1 |