diff --git a/README.md b/README.md index 38385f32..c4b79549 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,12 @@ ## Introduction This is the MyParcel delivery options module for use in any e-commerce platform's checkout, by [MyParcel], [SendMyParcel] and [Flespakket] customers. It's used to show your customers the possible delivery and/or pickup options for their location, based on your settings. It only has the bare minimum css styling so it should integrate with the design of your webshop easily. +- [Sandbox](#sandbox) - [Installation](#installation) -- [Example](#example) - [Usage](#usage) +- [Examples](#examples) +- [Contribute](#contribute) +- [Support](#support) ![screenshot](screenshots/example1.png) ![screenshot](screenshots/example2.png) @@ -15,7 +18,7 @@ This is the MyParcel delivery options module for use in any e-commerce platform' ### Browser support This app is written in [Vue.js], it supports IE9 and up. -## Example +## Sandbox An example of the delivery options functionality can be found in our [sandbox]. Here you can try out every combination of settings and copy the code for use in your project. ## Installation @@ -32,8 +35,6 @@ An example of the delivery options functionality can be found in our [sandbox]. ## Usage - - ### All options ```js window.MyParcelConfig = { @@ -215,7 +216,20 @@ You'll often want to use the delivery options module in a checkout form in your #### Integration examples -##### Attach data to an order using a hidden input +##### Our WooCommerce implementation +Files that can help you get started: + +- Backend: [/includes/frontend/class-wcmp-checkout.php](https://github.com/myparcelnl/woocommerce/blob/master/includes/frontend/class-wcmp-checkout.php) +- Frontend: [/assets/js/wcmp-frontend.js](https://github.com/myparcelnl/woocommerce/blob/master/assets/js/wcmp-frontend.js) + +##### Our Magento 2 implementation +Files that can help you get started: + +Note: It's more complex in Magento 2 because of the way shipping methods work. +- Backend: [/Model/Checkout/DeliveryOptionsToShippingMethods.php](https://github.com/myparcelnl/magento/blob/develop/Model/Checkout/DeliveryOptionsToShippingMethods.php) +- Frontend: [/view/frontend/web/js/view/delivery-options.js](https://github.com/myparcelnl/magento/blob/develop/view/frontend/web/js/view/delivery-options.js) + +#### Attach data to an order using a hidden input In WooCommerce and Magento 2 we injected a hidden text input inside the checkout `