Skip to main content

Pickup Stores

Sometimes, your eCommerce platform has a set of predefined pickup stores that you want to be propagated to Simpler Checkout.

This can be achieved by implementing either of the Pickup Stores API.

There are three available strategies allowing fine grained control on how the results will be embedded in the Simpler Checkout form.

src/Controller/Simpler/PickupStoresController.php
class SimplerPickupStoresController extends AbstractController
{
public function getData(Request $request): Response
{
$response = [
[
"strategy" => "append",
"title" => "Title",
"stores" => [
[
"id" => "1",
"title" => "store 1"
],
[
"id" => "2",
"title" => "store 2"
]
]
],
[
"strategy" => "expand",
"shippingId" => "parent",
"title" => "Title 2",
"stores" => [
[
"id" => "3",
"title" => "store 3"
],
[
"id" => "4",
"title" => "store 4"
]
]
],
[
"strategy" => "merge",
"stores" => [
[
"id" => "5",
"title" => "store 5"
]
]
]
];

return $this->json($response);
}
}

Strategies

Each strategy defines how stores will be embedded on the Simpler Checkout form, jointly with the returned Quote shipping_option

Append

Given stores will be added on the Simpler Checkout form regardless of the returned shipping options.

Use this strategy when your quote response doesn't know anything about pickup stores.

Expand

Requires attribute shippingId.

Given stores will replace the returned shipping option where shipping_option.id == shippingId.

Use this strategy when your quote response returns a local pickup shipping option without any information of what the stores for this option are.

Merge

Given stores will overwrite the returned shipping option where shipping_option.id == stores[].id.

Use this strategy when your quote response returns a local pickup shipping option but you want to enhance how this option is presented on Simpler checkout.