LokiCheckout_InPost
This Magento 2 module is an add-on package to the LokiCheckout.
Installation
Install this package via composer:
composer require loki-checkout/magento2-in-post
Next, enable this module:
bin/magento module:enable LokiCheckout_InPost
What this module does
This module makes the official InPost module smartmage/inpost work with the Loki Checkout. Rates, ShipX shipments, labels, dispatch orders and tracking are still handled by Smartmage_Inpost. This module adds the checkout part (comparable to Snowdog Hyva-Checkout-Inpost):
- A parcel locker picker (dropdown and map) for all
inpostlocker_*methods, based on the public InPost points API (sandbox or production, followingshipping/inpost/mode). - Only suitable points are listed: operating points, POP points only when
popenabledis set, points with payment for cash on delivery, and 24/7 parcel lockers for weekend delivery. - The selected locker is stored in
inpost_locker_idon the quote and the order. This is thetarget_pointthat Smartmage sends to ShipX. - The shipping address is replaced with the locker address, keeping the shopper's phone number (InPost sends the pickup code to it).
- The locker is removed when the shopper switches to another shipping method.
- Before an order is placed, the data needed for a ShipX shipment is checked:
- a locker is selected and fits the method;
- the phone is a Polish number of 9 digits (it is normalized, for example
+48 600 100 200); - the address is in Poland;
- courier orders have a building number.
- When
shipping/inpost/change_shipping_addressis enabled, a failing InPost API call in Smartmage no longer blocks the order. - InPost icons are shown for the shipping methods.
Configuration
Configure Smartmage_Inpost under Stores > Configuration > Sales > Shipping Settings > InPost and Sales > Delivery Methods:
shipping/inpost/mode(testorprod),organization_idandaccess_token(needed for shipments and labels).- For each method you offer (for example
carriers/inpostlocker/standard):active,name,price,max_cart_weight,default_way_sendinganddefault_sending_point. - Products need a weight (
shipping/inpost/weight_attribute_code). Carts abovemax_cart_weightdo not get the method. - Optional:
carriers/inpostlocker/loki_point_limit(number of lockers to list, default 25).
Tests
- Unit tests:
Test/Unit - Integration tests:
Test/Integration.ShipXSandboxTestcreates a real ShipX shipment and label, but only whenINPOST_SANDBOX_TOKENandINPOST_SANDBOX_ORGANIZATION_IDare set. - Playwright:
Test/Playwright(uses the public InPost sandbox points API)
Current status
@dev
to the composer command.
Support
For getting support, create an Issue under the following project URL:
https://gitlab.yireo.com/loki-checkout/LokiCheckout_InPost.git
Loki Components
The following LokiComponents are created or references in this module:
loki-checkout.shipping.methods.inpostlocker_standard.form
loki-checkout.shipping.methods.inpostlocker_standard.form.map
loki-checkout.shipping.methods.inpostlocker_standardcod.form
loki-checkout.shipping.methods.inpostlocker_standardcod.form.map
loki-checkout.shipping.methods.inpostlocker_standardeow.form
loki-checkout.shipping.methods.inpostlocker_standardeow.form.map
loki-checkout.shipping.methods.inpostlocker_standardeowcod.form
loki-checkout.shipping.methods.inpostlocker_standardeowcod.form.map
loki-checkout.shipping.methods.inpostlocker_economic.form
loki-checkout.shipping.methods.inpostlocker_economic.form.map
loki-checkout.shipping.methods.inpostlocker_economiccod.form
loki-checkout.shipping.methods.inpostlocker_economiccod.form.map
Module Dependencies
The following dependencies are declared in the module its `etc/module.xml` file:
LokiCheckout_Core
LokiCheckout_ShippingMaps
Loki_Base
Loki_Components
Loki_CssUtils
Loki_FieldComponents
Loki_MapComponents
Magento_Backend
Magento_Catalog
Magento_Checkout
Magento_CheckoutAgreements
Magento_Config
Magento_Customer
Magento_Directory
Magento_Eav
Magento_Newsletter
Magento_Payment
Magento_Quote
Magento_Sales
Magento_Shipping
Magento_Store
Magento_Tax
Magento_Theme
Magento_Vault
Smartmage_Inpost
Yireo_CspUtilities
Composer details
LokiCheckout_InPostloki-checkout/magento2-in-post
ext-json: *
ext-pcre: *
loki-checkout/magento2-core: ^2.5
loki-checkout/magento2-shipping-maps: ^1.0
loki/magento2-components: ^2.6
loki/magento2-css-utils: ^1.0
loki/magento2-map-components: ^1.0
magento/framework: ^103.0
magento/module-directory: ^100.4
magento/module-quote: ^101.0
magento/module-sales: ^103.0
magento/module-store: ^101.0
psr/log: ^1.0 || ^2.0 || ^3.0
smartmage/inpost: ^1.24
php: >=8.2 <8.6