GithubHelp home page GithubHelp logo

pakettikauppa / pakettikauppa-magento-2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from filipkunjadic/pakettikauppa-magento-2

0.0 2.0 4.0 125 KB

Magento 2 shipping module for Pakettikauppa

Home Page: https://www.pakettikauppa.fi/

License: MIT License

PHP 64.40% HTML 23.49% JavaScript 12.12%

pakettikauppa-magento-2's Introduction

Pakettikauppa (M2) shipping module

Installation:

composer require pakettikauppa/pakettikauppa-magento-2

Configuration

  • Activate module (but module should be activated by default)
  • Insert your API credentials: Stores -> Configuration -> Pakettikauppa
  • Enable shipping methods: Stores- > Configuration -> Sales -> Shipping Methods

How to use:

  1. Add item to cart and go to checkout
  2. Fill in billing and shipping details
  3. Choose from one of shipping methods that are based on your shipping zip code
  4. If you want to use another pickup point zip insert new zip into field and click search
  5. Once pickup point is selected, finish the order
  6. Now login to Magento (admin) and see your order. Beside shipping address you will see Pickup Point details.
  7. Once shipment is sent, tracking code will be added automatically

pakettikauppa-magento-2's People

Contributors

chlignell avatar filipkunjadic avatar joosev avatar rkioski avatar tarasyyyk avatar taskula avatar

Watchers

 avatar  avatar

pakettikauppa-magento-2's Issues

Pickup point data not populated in sales_order

This is somewhat vague issue as we haven't yet figured out how it can be replicated, but I've decided to report it anyway in case someone else is experiencing the same problem.

The issue is that every now and then pickup_point_* fields in sales_order table do not get populated. When store staff attempt to create a new shipment, such order dies with an error "Error: 533, Unsupported product code: empty"

Since we don't know how the bug occurs, we've placed following SQL query in a cronjob to populate the missing fields when ever necessary. It helps the store staff by giving them the ability to reliably process shipments, but of course does not fix the root cause of this issue.

update sales_order set 
pickup_point_id=regexp_replace(shipping_method, '^pktkppickuppoint_', ''),
paketikauppa_smc=(case when shipping_description like '%Posti -%' then 2103 when shipping_description like '%Matkahuolto -%' then 90080 when shipping_description like '%DB -%' then 80010 end),
pickup_point_provider=(case when shipping_description like '%Posti -%' then "Posti" when shipping_description like '%Matkahuolto -%' then "Matkahuolto" when shipping_description like '%DB -%' then "DB Schenker" end),
pickup_point_name=shipping_description,
pickup_point_street_address=regexp_replace(regexp_replace(shipping_description, '^.*: ', ''), ',.*' ,''),
pickup_point_postcode=regexp_substr(shipping_description, '([0-9]){5}'),
pickup_point_city=regexp_replace(regexp_replace(shipping_description, '^.*,', ''), ' -.*', ''),
pickup_point_country="FI"
where shipping_method like 'pktkppickuppoint_%' and pickup_point_id is NULL

The empty fields in sales_order are

pickuppoint_zip | home_delivery_service_provider | pickup_point_provider | pickup_point_location | pickup_point_id | pickup_point_name | pickup_point_street_address | pickup_point_postcode | pickup_point_city | pickup_point_country | pickup_point_description | paketikauppa_smc

The following fields do get populated (these are what our SQL query uses for populating the missing fields)

shipping_description | shipping_method

Any idea what could be causing this bug?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.