Code Monkey home page Code Monkey logo

vendure-advanced-shipping's Introduction

Vendure Advanced Shipping

Publish Build & Test semantic-release Crowdin

πŸ“¦ A series of plugins for Vendure to add features to shipping using boxes and shipping based on product dimensions.

🌟 Features

  • CRUD of packages/boxes. (Both admin UI / GQL)
  • Ability to add dimensions in Product (Using Custom Fields)
  • A table in the database to register all packages of an order.
  • A ShippingPackages service helper to calculate which box to use in Order and update the order in the database

βš™οΈ Install

1. Install and configure Vendure

Here you can find out how to install

2. Install the core package

npm install @vendure-advanced-shipping/core --save

2.1 Install the optional packages or create one. (Optional)

You can find the list of available packages compatible with this repo in the list PACKAGES above.

3. Add all plugins in Vendure configuration

import { AdvancedShippingCorePlugin } from '@vendure-advanced-shipping/core';
const config: VendureConfig = {
  ...
  plugins: [
    AdvancedShippingCorePlugin
  ]
}

4. Extend the UI plugin (optional)

You need to extend the UI adding the uiExtensions in the compileUiExtensions of the AdminUiPlugin. You can read more about how to config here

import { AdvancedShippingCorePlugin } from '@vendure-advanced-shipping/core';
const config: VendureConfig = {
  ...
  plugins: [
    ...
    AdminUiPlugin.init({
      ...
      app: compileUiExtensions({
        ...
        extensions: [AdvancedShippingCorePlugin.uiExtensions],
      })
    })
  ]
}

5. Enjoy!

It's done!

πŸ“š How to use?

1. Create your first package box

Step 1.1 Step 1.2 Step 1.3

2. Configure your products dimensions

Step 2

3. Configure your shipping products

Step 2

4. Done, enjoy!

πŸ“– Packages

npm (scoped) @vendure-advanced-shipping/core

This package contains the core features of Advanced Shipping.

npm (scoped) @vendure-advanced-shipping/melhor-envio

A plugin using the Advanced Shipping for calculate shipping using Melhor Envio as provider

npm (scoped) @vendure-advanced-shipping/rodonaves

A plugin using the Advanced Shipping for calculate shipping using Rodonaves as provider

npm (scoped) @vendure-advanced-shipping/ups-brazil

A plugin using the Advanced Shipping for calculate shipping using UPS Brazil as provider

npm (scoped) @vendure-advanced-shipping/pickup-in-store

A plugin to pickup order in store.

  • A ShippingCalculator to create multiple stores to customer pickup the order based on Postal Code.
  • A PickupInStoreCronService that adds a cronjob that checks every day at mid night orders that its in the state of Packed in the interval of 7 days and that the shipping method its pickup-in-store (the same from the ShippingCalculator) after get, the service will cancel all of then.
  • A PickupInStoreCancelOrder event that fired whenever an Order is cancelled by Cron Job

πŸ‘¨πŸ»β€πŸ’» Creating a shipping calculator / plugin

It's really easy to create a ShippingCalculator in Vendure and this project takes advantage of it. You just need to create a new ShippingCalculator class that will inject in his init function, your ShippingPackagesService so that you can get which packages boxes to use in this order. You can get here an example to how to do it.

🏒 Structure

This project is a monorepo managed with Lerna. Several npm packages are published from this repo, which can be found in the packages/ directory.

βœ… Testing

Server Unit Tests

The core and several other packages have unit tests which are can be run all together by running npm test from the root directory, or individually by running it from the package directory.

Unit tests are co-located with the files which they test, and have the suffix .spec.ts.

End-to-end Tests

Certain packages have e2e tests, which are located at /packages/<name>/e2e/. All e2e tests can be run by running yarn e2e from the root directory, or individually by running it from the package directory.

e2e tests use the @vendure/testing package. For details of how the setup works, see the Testing docs

🌐 Localization

This project localization its hosted in Crowdin.

❗️ License

MIT

vendure-advanced-shipping's People

Contributors

jonyw4 avatar renovate-bot avatar

Stargazers

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

vendure-advanced-shipping's Issues

New ShippingMethod Pickup in store

A ShippingMethod to user pickup order based on postal code. Args in configuration:

  • Address
  • Opening Hours
  • Postal code range
  • Ajustment value

In metadata must return opening hours and address.

Extra

  • A cronjob to cancel automatically orders that customer doesn't pickup based on deadline

Generate print label for shipping

UPS Brasil and Melhor Envio need to generate label before shipping the order. We need to create a script to generate them based on information in the order. To resolves this issue we need:

  • Wait to implement a state machine in Fulfillment
  • Transform all shipping methods to plugins
  • Remove all custom states of the plugin
  • Move all keys to plugin
  • Create custom CustomFulfillmentProcess for UPS Brasil plugin
  • Create custom CustomFulfillmentProcess for MelhorEnvio plugin

Add new Order states and functions

Add new states in Vendure order to work properly with the carriers:

Fulfilled and PartiallyFulfilled (already in Vendure)

Can go to: Packed

πŸ“¦ Packed

When order it's ready to be shipped. You can use the transition state from Fulfilled and PartiallyFulfilled to this state to emit a Brazilian NFe.

Can go to: Shipped, Delivered (in case the order is picked up at the store) or Cancel

🚚 Shipped

When carrier is in the process of shipping of the order.

  • Add helper fn to cancel shipping in transit and refund
  • When go to packed need to remove all tracking code
    Can go to: Cancel (when user wants to cancel the order), Delivered or Packed (when the carrier returns the order)

πŸ“₯ Delivered

Can go to: Cancel (when user wants to cancel the order)

Update README

  • Add lerna badge
  • Add github action badge
  • Development
  • License

Publish problem

! [remote rejected] @vendure-advanced-shipping/common-v1.0.0 -> @vendure-advanced-shipping/common-v1.0.0 (failed)

Update UPS plugin

UPS plugin is not showing error information. we need to update the plugin

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two-Factor Authentication, make configure the auth-only level is supported. semantic-release cannot publish with the default auth-and-writes level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

Advanced Shipping: Time Rules

Add a new area in Vendure Admin UI to create manage delivery time of shipping methods based on postal code range.

Fields

  • Name
  • Description
  • Postal Code Range (from / to)
  • Shipping Methods
  • Conditions (The same from promotion)
  • Days to add

Advanced Shipping: Discount Rules

Add a new area in Vendure Admin UI to create discount in shipping methods values based on postal code range.

Fields

  • Name
  • Description
  • Postal Code Range (from / to)
  • Shipping Methods
  • Conditions (The same from promotion)
  • Percent of discount (0 ~ 100%)

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.