Git Product home page Git Product logo

oclz's Introduction

SKEO Opencart-Lazada-Shopee-WooCommerce Extension Accessory

Setup

Configure config.ini and fill up the sections for Lazada, Opencart, WooCommerce and Shopee.

Environment

Using docker setup

  1. Install docker

  2. Run the app:

    • Make: make docker-run ARGS="--help"
    • Bash: ./scripts/docker_run --help

Using local machine setup

  1. Setup and put your credentials in config.ini file. To disable a system, just comment it out in the .ini file.
[Common]
Store=../skeo_sync.db
DefaultSystem=Opencart
EnableLazadaToShopeeUpload=1

[Lazada]
Domain=
AppKey=
AppSecret=

[Shopee]
ShopID=
PartnerID=
PartnerKey=

[Opencart]
Domain=
Username=
Password=

[WooCommerce]
Domain=
ConsumerKey=
ConsumerSecret=
  1. Run with make, which will install pypy and pip and requirements.txt
# For testing and check config only.
$ make pypy3-run ARGS="chkconfig"
# For syncing in read-only mode (no write).
$ make pypy3-run ARGS="sync --readonly"
# For syncing using a different config.
$ make pypy3-run ARGS="sync --config=config.prod.ini"

Formatter

Use black formatter please.

Troubleshooting

I got an error when syncing Shopee: your access to shop has expired. What do?

You need to refresh your app's authorization to your shop. Check out the Shopee Open Platform Docs on how to setup Shop Authorization.

There's a script included here to generate the URL that you need to visit:

$ make pypy3-run ARGS="shreauth --config=config.prod.ini"

How do I get / setup the access and refresh tokens for Lazada?

  1. Open you app on the APP Console
  2. In App Management > Auth Management, add your authorized seller whitelist.
  3. Open this link to redirect to your seller authorization:
    https://auth.lazada.com/oauth/authorize?response_type=code&force_auth=true&redirect_uri=${app call back url}&client_id=${appkey}
    
    Replace ${app_call_back_url} and ${appkey} respectively.
  4. Authorize and take note of the redirected URL and get the code part. For example:
    https://127.0.0.1/?code=0_xxxxxxxxxxxx
    
  5. Run the following:
    $ make pypy3-run ARGS="lzreauth --config=config.prod.ini --token=0_xxxxxxxxxxxx"

My Lazada item stocks does not update?

As of Feb 2021, using the update endpoint sometimes will not work if the quantity is set to something lower than an arbitrary number. This number is of unknown origin. Real great.

Update from Mar 2021: Lazada Open API support replied to our query and said that this was a known issue and escalated to the regional support. ๐Ÿฅณ Now we wait.

Workarounds

  1. Manual quantity changes should only be made in Lazada; or
  2. Distribute quantity changes in Lazada and another system (e.g 50 in Lazada, 50 in Opencart = 100)

oclz's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

oclz's Issues

Implement Oauth token refresh on Lazada API

this probably needs a new table to track oauth tokens

type OauthTokens struct {
  system string
  accessToken string
  refreshToken string
  expiresIn date
}

Most likely implement in sync.py

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.