Express Pasts Shipping Extension for OpenCart 3.x

OpenCart extension documentation

Short Description

This shipping extension allows you to define shipping to post offices, Circle K stations in Latvia, Latvia Post parcel terminals in Latvia, Lithuania post offices and more than 100 parcel terminals in Lithuania.

Pre-Installation for OpenCart version 3.0.3.6

Replace the system/modification.xml file with the modification file you can get here: https://github.com/kenfai/opencart/blob/d31b4ebe3fd29dcc8861725d4934c6e3dd68e019/upload/system/modification.xml

Installation And Setup

If you are installing more than one of Partneris.net shipping modules (such as Omniva, DPD Pickup, Latvijas Pasts), then you only need to activate one ocmod file (does not matter which one). Everything else needs to be disabled.

  1. Make backup of store files and database before you install the module (just a healthy habit).

  2. Go to admin Extensions -> Extension Installer and upload file latvijas-pasts-shipping-oc3.0.x_v.x.x.x.ocmod.zip.

  3. Refresh modifications - go to Extensions -> Modifications and click the Refresh button at the top right of the page.

  4. If You have Journal 3:

    • open the file catalog/view/theme/journal3/js/checkout.js

    • find:

save: function (confirm) {

    • add before if you have Journal 3.1.x version:

saveLatvijasPastsCirclek: function (confirm) {

this.error = {};

if (window['_QuickCheckoutAjaxSave']) {

window['_QuickCheckoutAjaxSave'].abort();

}

if (confirm) {

loader('.quick-checkout-wrapper', true);

}

if ($('#shipping_method_address_latvijas_pasts_circlek').val()) {

$('#latvijas_pasts_circlek').prop('checked', '');

$('#latvijas_pasts_circlek').attr('value', $('#shipping_method_address_latvijas_pasts_circlek').val());

$('#latvijas_pasts_circlek').prop('checked', 'checked');

this.$data.order_data['shipping_code'] = $('#shipping_method_address_latvijas_pasts_circlek').val();

} else {

$('#latvijas_pasts_circlek').prop('checked', 'checked');

this.$data.order_data['shipping_code'] = $('#latvijas_pasts_circlek').attr('value');

}

window['_QuickCheckoutAjaxSave'] = this.ajax({

url: 'index.php?route=journal3/checkout/save' + (confirm ? '&confirm=true' : ''),

data: {

checkout_id: this.checkout_id,

account: this.account,

order_data: this.order_data,

password: this.password,

password2: this.password2,

same_address: this.same_address,

newsletter: this.newsletter,

privacy: this.privacy,

agree: this.agree,

payment_address_type: this.payment_address_type,

shipping_address_type: this.shipping_address_type,

coupon: this.coupon,

voucher: this.voucher,

reward: this.reward

},

success: function (json) {

window['_QuickCheckoutAjaxSave'] = null;

this.update(json, confirm);

}.bind(this)

});

},

saveLatvijasPastsTerminals: function (confirm) {

this.error = {};

if (window['_QuickCheckoutAjaxSave']) {

window['_QuickCheckoutAjaxSave'].abort();

}

if (confirm) {

loader('.quick-checkout-wrapper', true);

}

if ($('#shipping_method_address_latvijas_pasts_terminals').val()) {

$('#latvijas_pasts_terminals').prop('checked', '');

$('#latvijas_pasts_terminals').attr('value', $('#shipping_method_address_latvijas_pasts_terminals').val());

$('#latvijas_pasts_terminals').prop('checked', 'checked');

this.$data.order_data['shipping_code'] = $('#shipping_method_address_latvijas_pasts_terminals').val();

} else {

$('#latvijas_pasts_terminals').prop('checked', 'checked');

this.$data.order_data['shipping_code'] = $('#latvijas_pasts_terminals').attr('value');

}

window['_QuickCheckoutAjaxSave'] = this.ajax({

url: 'index.php?route=journal3/checkout/save' + (confirm ? '&confirm=true' : ''),

data: {

checkout_id: this.checkout_id,

account: this.account,

order_data: this.order_data,

password: this.password,

password2: this.password2,

same_address: this.same_address,

newsletter: this.newsletter,

privacy: this.privacy,

agree: this.agree,

payment_address_type: this.payment_address_type,

shipping_address_type: this.shipping_address_type,

coupon: this.coupon,

voucher: this.voucher,

reward: this.reward

},

success: function (json) {

window['_QuickCheckoutAjaxSave'] = null;

this.update(json, confirm);

}.bind(this)

});

},

saveLatvijasPastsOffices: function (confirm) {

this.error = {};

if (window['_QuickCheckoutAjaxSave']) {

window['_QuickCheckoutAjaxSave'].abort();

}

if (confirm) {

loader('.quick-checkout-wrapper', true);

}

if ($('#shipping_method_address_latvijas_pasts_offices').val()) {

$('#latvijas_pasts_offices').prop('checked', '');

$('#latvijas_pasts_offices').attr('value', $('#shipping_method_address_latvijas_pasts_offices').val());

$('#latvijas_pasts_offices').prop('checked', 'checked');

this.$data.order_data['shipping_code'] = $('#shipping_method_address_latvijas_pasts_offices').val();

} else {

$('#latvijas_pasts_offices').prop('checked', 'checked');

this.$data.order_data['shipping_code'] = $('#latvijas_pasts_offices').attr('value');

}

window['_QuickCheckoutAjaxSave'] = this.ajax({

url: 'index.php?route=journal3/checkout/save' + (confirm ? '&confirm=true' : ''),

data: {

checkout_id: this.checkout_id,

account: this.account,

order_data: this.order_data,

password: this.password,

password2: this.password2,

same_address: this.same_address,

newsletter: this.newsletter,

privacy: this.privacy,

agree: this.agree,

payment_address_type: this.payment_address_type,

shipping_address_type: this.shipping_address_type,

coupon: this.coupon,

voucher: this.voucher,

reward: this.reward

},

success: function (json) {

window['_QuickCheckoutAjaxSave'] = null;

this.update(json, confirm);

}.bind(this)

});

},

    • if you have Journal 3.1.x version: find

this.shipping_methods = json.response.shipping_methods;

    • add after:

this.latvijas_pasts_offices_addresses = json.response.latvijas_pasts_offices_addresses;

this.latvijas_pasts_terminals_addresses = json.response.latvijas_pasts_terminals_addresses;

this.latvijas_pasts_circlek_addresses = json.response.latvijas_pasts_circlek_addresses;

    • if you have Journal 3.1.x version: find

order_data: this.order_data,

    • add after:

latvijas_pasts_offices_addresses: this.latvijas_pasts_offices_addresses,

latvijas_pasts_terminals_addresses: this.latvijas_pasts_terminals_addresses,

latvijas_pasts_circlek_addresses: this.latvijas_pasts_circlek_addresses,

  1. Go to admin Extensions -> Extensions -> [Shipping] -> Ⓟ Latvijas Pasts Circle K and click "Install" .

  2. Find "Ⓟ Latvijas Pasts Circle K" and click "Edit" .

  3. A page will open with a form you need to fill:

      • Max. Weight - write max allowed product weight(➊);

      • Cost: write cost for delivery(➋);

      • Free shipping after: free shipping from certain amount of cart(➌);

      • Tax Class: select tax class that will apply to cost(➍);

      • Geo Zone: Select the Geo Zone That represents the corresponding country (➎).

      • Status - select status "Enabled"(❻);

      • URL to file for import addresses of Latvijas Pasts Circle K - there will be an URL to CSV file for import "Circle K" addresses in Latvia; This url may change in future, so you can then change it here(❼). At this moment the url is https://express.pasts.lv/dusApi/index

      • Sort Order - enter sort order(❽).

  1. Save changes by clicking "Save".

  2. Go to admin Extensions -> Extensions -> [Shipping] -> Ⓟ Latvijas Pasts offices and click "Install" .

  3. Find "Ⓟ Latvijas Pasts offices" and click "Edit" .

  4. A page will open with a form you need to fill:

    • General:

      • Max. Weight - write max allowed product weight(➊);

      • Status - select status "Enabled"(➋);

      • Sort Order - enter sort order(➌).

    • After that you need to fill fields in the each of geo zones:

      • Geo Zone: Select the Geo Zone That represents the corresponding country (➊).

      • Tax Class: select tax class that will apply to cost(➋);

      • Cost: write cost for delivery(➌);

      • Free shipping after: free shipping from certain amount of cart(➍);

      • URL to file for import addresses of Latvijas Pasts offices - there will be an URL to CSV file for import "Latvijas Pasts offices" addresses in Latvia or Lithuania; This url may change in future, so you can then change it here(➎). At this moment the url for Latvia is https://express.pasts.lv/postOfficeApi and for Lithuania the url is https://express.pasts.lv/postOfficeApi/lt

      • Status - select status "Enabled" (❻);

  1. Save changes by clicking "Save".

  2. Go to admin Extensions -> Extensions -> [Shipping] -> Ⓟ Latvijas Pasts terminals and click "Install" .

  3. Find "Ⓟ Latvijas Pasts terminals" and click "Edit" .

  4. A page will open with a form you need to fill:

    • General:

      • Max. Dimensions (L x W x H) - write maximum allowed product dimensions (➊);

      • Max. Weight - write max allowed product weight(➋);

      • Status - select status "Enabled"(➌);

      • Sort Order - enter sort order(➍).

    • After that you need to fill fields in the each of geo zones:

      • Geo Zone: Select the Geo Zone That represents the corresponding country (➊).

      • Tax Class: select tax class that will apply to cost(➋);

      • Cost: write cost for delivery(➌);

      • Free shipping after: free shipping from certain amount of cart(➍);

      • URL to file for import addresses of Latvijas Pasts terminals - there will be an URL to CSV file for import "Latvijas Pasts terminals" addresses in Latvia or Lithuania; This url may change in future, so you can then change it here(➎). At this moment the url for Latvia is https://express.pasts.lv/stationApi/index and for Lithuania the url is https://express.pasts.lv/terminalApi/index

      • Status - select status "Enabled" (❻);

  1. Save changes by clicking "Save".

Now you can use the module!

Checkout Screenshot

Update "Latvijas Pasts Circle K" destination addresses

  1. Go to admin Extensions->Extensions->[Shipping]-> Latvijas Pasts Circle K and click "Edit" .

  2. Click the button "Save". The list of available Latvijas Pasts Circle K addresses will be updated from the link in URL to file for import addresses of Latvijas Pasts Circle K (see Installation step 7).

Update "Latvijas Pasts offices" destination addresses

  1. Go to admin Extensions->Extensions->[Shipping]-> Latvijas Pasts offices and click "Edit" .

  2. Click the button "Save". The list of available Latvijas Pasts offices addresses will be updated from the link in URL to file for import addresses of Latvijas Pasts offices (see Installation step 11).

Update "Latvijas Pasts terminals" destination addresses

  1. Go to admin Extensions->Extensions->[Shipping]-> Latvijas Pasts terminals and click "Edit" .

  2. Click the button "Save". The list of available Latvijas Pasts terminals will be updated from the link in URL to file for import addresses of Latvijas Pasts terminals (see Installation step 15).

Extension upgrade

  1. Install the new package following exactly the same steps described in the Installation And Setup section above.

  2. Does not show the delivery station list anymore in the admin panel.

Release history

  • 1.4.0: 2022-01-12: added compatibility with Quick Checkout extension.

  • 1.2.0: 2021-12-28: added compatibility with ModulePoints Quick Checkout.

  • 1.1.0: 2021-09-10: added compatibility with Simple Checkout extension.

  • 1.0.0: 2021-05-06: initial version for OpenCart 3.0.x

Last updated