Skip to content

Commerce Foundations is our pre-built Craft Commerce store. See what it includes

Craft CMS plugins

Foster Checkout

A drop-in checkout for Craft Commerce, with its copy and settings managed from the control panel.

Detecting a pickup order

A pickup order ships to the Commerce store location. No flag is stored on the order; the plugin recognizes one by comparing the shipping address to that location.

In PHP#

isCustomerPickup() on the checkout service answers for any order. A module can use it to leave carrier rates off a pickup order, here with Postie:

<?php

namespace modules\site;

use fostercommerce\fostercheckout\FosterCheckout;
use verbb\postie\events\ModifyShippingMethodsEvent;
use verbb\postie\services\Service as PostieService;
use yii\base\Event;

Event::on(
    PostieService::class,
    PostieService::EVENT_BEFORE_REGISTER_SHIPPING_METHODS,
    static function (ModifyShippingMethodsEvent $modifyShippingMethodsEvent): void {
        $isCustomerPickup = FosterCheckout::getInstance()?->getCheckout()->isCustomerPickup($modifyShippingMethodsEvent->order);

        if ($isCustomerPickup) {
            $modifyShippingMethodsEvent->shippingMethods = [];
        }
    }
);

In Twig#

{% if craft.fostercheckout.isCustomerPickup(cart) %}
    <p>Collect this order from our warehouse.</p>
{% endif %}

In the cart response#

The single-page checkout’s cart JSON carries the same answer as fosterCheckout.customerPickup, alongside the shipping methods and totals.

See the user guide for turning pickup on and pricing it.

We can take it from here.

We take on the Craft and Craft Commerce sites you built, so you can get back to building. Introduce a client who signs a management contract and you get a $3,000 partnership fee.

How the Dev Partnership Program works
See if we’re a fit