Omniva Shipping Extension for OpenCart 3.0.x

OpenCart extension documentation

Short Description

This shipping extension allows to define shipping to self-service post terminals “Omniva”. Customer can select “Omniva” station’s address from a list for Latvia, Estonia and Lithuania.

Installation And Setup

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

  2. 2. Go to admin Extensions -> Extension Installer and upload the installation package.

  3. Refresh your modifications on the same page.

  • If You have Journal 3.0.x:

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

    • find:

save: function (confirm) {

  • add before:

saveOmniva: function (confirm) {
this.error = {};
if (window['_QuickCheckoutAjaxSave']) {
window['_QuickCheckoutAjaxSave'].abort();
}
if (confirm) {
loader('.quick-checkout-wrapper', true);
}
if ($('#shipping_method_address_omniva').val()) {
$('#omniva').prop('checked', '');
$('#omniva').attr('value', $('#shipping_method_address_omniva').val());
$('#omniva').prop('checked', 'checked');
this.$data.order_data['shipping_code'] = $('#shipping_method_address_omniva').val();
} else {
$('#omniva').prop('checked', 'checked');
this.$data.order_data['shipping_code'] = $('#omniva').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)
});
},
    • find:

this.shipping_methods = json.response.shipping_methods;

    • add after

this.omniva_addresses = json.response.omniva_addresses;

    • find:

order_data: this.order_data,

    • add after

omniva_addresses: this.omniva_addresses,

  • If You have Journal 3.1.x:

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

    • find:

save: function (confirm) {

  • add before:

saveOmniva: function (confirm) {
this.error = {};
if (window['_QuickCheckoutAjaxSave']) {
window['_QuickCheckoutAjaxSave'].abort();
}
if (confirm) {
loader('.quick-checkout-wrapper', true);
}
var data = JSON.parse(JSON.stringify({
checkout_id: this.checkout_id,
account: this.account,
order_data: this.order_data,
omniva_addresses: this.omniva_addresses,
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
}));
if ($('#shipping_method_address_omniva').val()) {
$('#omniva').attr('value', $('#shipping_method_address_omniva').val());
$('#omniva').prop('checked', 'checked');
data['order_data']['shipping_code'] = $('#shipping_method_address_omniva').val();
} else {
$('#omniva').prop('checked', 'checked');
data['order_data']['shipping_code'] = $('#omniva').attr('value');
}
console.log('shipping_code = ' + data['order_data']['shipping_code']);
data['order_data']['comment'] = $('.section-comments textarea').val();
data['captcha'] = $('[name="captcha"]').val();
data['g-recaptcha-response'] = $('[name="g-recaptcha-response"]').val();
window['_QuickCheckoutAjaxSave'] = this.ajax({
url: 'index.php?route=journal3/checkout/save' + (confirm ? '&confirm=true' : ''),
data: data,
success: function (json) {
window['_QuickCheckoutAjaxSave'] = null;
this.update(json, confirm);
}.bind(this)
});
},
    • find:

this.shipping_methods = json.response.shipping_methods;

    • add after

this.omniva_addresses = json.response.omniva_addresses;

  1. Go to admin Extensions -> Shipping, find “Omniva” and click “Install”.

  2. Find “Omniva” and click “Edit”.

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

4. General:

  • Api URL - get info from Omniva (➊);

  • Username - get info from Omniva(➋);

  • Password - get info from Omniva (➌);

  • Services (➍)

Parcel Terminals (check it if you want Omniva terminals enabled on checkout)

Courier (check it if you want Omniva courier enabled on checkout);

  • Label type - select A4 (4 labels) or Single label (➎);

  • Sender name - write your company name (➏);

  • Sender address - write your company address (❼);

  • Sender postcode - write your company postcode (➑);

  • Sender city - write your company city (➒);

  • Sender country code - write your company country code (❿);

  • Sender phone - write your company phone (⓫);

  • COD status - cash on delivery enabled or disabled (⓬);

  • Company Name - write your company name (⓭);

  • Bank Account - write your company bank account (⓮);

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

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

  • URL to CSV file for import addresses - there will be an URL to CSV file for import “Omniva” addresses in Latvia, Lithuania and Estonia; This url may change in future, so you can then change it here (⓱).

  • Status - select status “Enabled” (⓲);

  • Sort Order - enter sort order (⓳).

  • After that you need to fill fields in each of the geo zones (Shipping Latvia, Shipping Lithuania and Shipping Estonia):

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

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

  • Parcel Terminal Cost: write cost for delivery (➌);

  • Parcel Terminal Free shipping after: write the cart amount from which the shipping is free (➍)

  • Courier Cost: write cost for delivery (❺);

  • Courier Free shipping after: write the cart amount from which the shipping is free (❻)

  • Status - select status “Enabled” (❼);

5. Save changes by clicking “Save” (❽).

Now you can use the module!

Extension upgrade

  1. Go to admin Extensions -> Extension Installer and upload the installation package;

  2. Refresh your modifications on the same page.

Support

If you need support, click here.

Features

Support simple checkout extension https://simpleopencart.com/

Support mpcheckout

Support Journal3 theme Quick Checkout

Support Onepage Checkout

Support Ajax Quick Checkout by Dreamvention

Release history

  • 1.0.0: 2019-01-08: Initial version for OpenCart 3.0.x

Last updated