LokiCheckout_Bring
This Magento 2 module is an add-on package to the LokiCheckout.
Installation
Install this package via composer:
composer require loki-checkout/magento2-bring
Next, enable this module:
bin/magento module:enable LokiCheckout_Bring
This module adds the shipping carrier Bring (Posten Norge) to Magento, without depending on any other Bring extension:
- Rates from the Bring Shipping Guide API (v2), with the expected delivery date in the method title
- A pickup point picker (dropdown and map) for Pakke til hentested (
bring_5800) in the Loki Checkout. The selected pickup point becomes the shipping address of the order and is stored on the quote and order (bring_pickup_point) - A Bring icon next to every Bring method in the Loki Checkout
- Shipping labels via the native Magento Create Shipping Label flow (Bring Booking API): the PDF label and the consignment number (tracking number) are stored on the shipment
- Tracking via the Bring Tracking API
Requirements
- A Mybring user with an API key (Mybring > Account settings > API)
- A Bring customer number for net prices and for creating shipping labels. Without a customer number, the checkout shows Bring list prices and label creation is refused
- The store information (name, phone) and shipping origin (Stores > Configuration > Sales > Shipping Settings > Origin) must be complete, because Magento uses them as sender of the shipping labels
Configuration
Go to Stores > Configuration > Sales > Delivery Methods > Bring:
- Mybring Login (API User ID): the e-mail address of your Mybring user (
X-Mybring-API-Uid) - API Key: stored encrypted (
X-Mybring-API-Key) - Customer Number: optional, see above
- Test Mode: shipping labels are booked as test consignments (header
X-Bring-Test-Indicator), which Bring does not invoice or collect. Rates, pickup points and tracking are not affected - Bring Services: Pickup parcel (5800), Home delivery parcel (5600), Mailbox parcel (3584), Mailbox parcel with tracking (3570), Express next day (4850) and Business parcel (5000). Only services that Bring returns a price for are shown
- Default Package Weight and dimensions: used when the cart has no weight or a package has no dimensions
- Handling fee, free shipping threshold, sender name/phone/e-mail overrides, timeouts, cache lifetime and the usual country restrictions
The API key, user ID and customer number can be set per environment with bin/magento config:set (the API key is a
sensitive value). When the Bring API fails or times out, the Bring methods are left out of the checkout (see
var/log/loki-checkout-bring.log); the checkout keeps working with the other carriers.
Tests
The integration and Playwright tests use a fake Bring API. The Playwright tests need the fixture module
LokiCheckout_BringTestFixture (Test/Fixture/BringTestFixture), which is installed via hersir-additional.sh and
.gitlab-ci/composer-additional.sh. Never install it in production. The live tests in Test/Integration/Live only run
when BRING_API_UID and BRING_API_KEY are set (and BRING_CUSTOMER_NUMBER for a test booking).
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_Bring.git
Module Dependencies
The following dependencies are declared in the module its `etc/module.xml` file:
LokiCheckout_Core
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_Vault
Yireo_CspUtilities
Composer details
LokiCheckout_Bringloki-checkout/magento2-bring
ext-json: *
ext-pcre: *
guzzlehttp/guzzle: ^7.4.5
loki-checkout/magento2-core: ^2.7
loki-checkout/magento2-shipping-maps: ^1.0
loki/magento2-components: ^2.8
loki/magento2-css-utils: ^1.1
loki/magento2-map-components: ^1.0
magento/framework: ^103.0
magento/module-backend: ^102.0
magento/module-catalog-inventory: ^100.4
magento/module-config: ^101.2
magento/module-directory: ^100.4
magento/module-quote: ^101.2
magento/module-sales: ^103.0
magento/module-shipping: ^100.4
magento/module-store: ^101.1
psr/log: ^1.0 | ^2.0 | ^3.0
php: >=8.2 <8.6