DecoNetwork External Checkout Integration - PHP Example

This read-me is just a quick information about the example code in php;
For the complete information about the integration, please read the documentation at https://help.deconetwork.com/hc/en-us/articles/360002700173

Workflow:

1 - PARAMETERS.PHP
1.1 - In this page you need to set your own parameters to be able to start using the External Checkout Integration.

2 - INDEX.PHP
2.1 - Your customer will be browsing your external website, viewing products. The products will be a mix of non-decoratable products that you are selling already, and DecoNetwork products;
2.2 - The customer clicks on a DecoNetwork product.

3 - After clicking on a DecoNetwork product, the customer is directed to the DecoNetwork website, specifying the product/size and color;
3.1 - The customer decorates the specified product and clicks “Add to cart”;
3.2 - This page will call the callback.php.

4 - CALLBACK.PHP
4.1 - This is the URL defined on API Settings / Enable External Cart Integration / Add To Cart callback url;
4.2 - The customer is redirected back to the external website with details about the product just added;
4.3 - This page will call the add_cart.php;
4.4 - And afterwards it will redirect to view_cart.php.

5 - ADD_CART.PHP
5.1 - The external website will parse the parameters and add an entry to the cart to represent the line item just added through DecoNetwork. The parameters contain a unique id, thumbnail url, edit url and other description/pricing fields which can be used to display the line item in the external cart.

6 - VIEW_CART.php
6.1 - This page will show all products added into the customer's cart;
6.2 - The customer is able to continue shopping, being direct to index.php;
6.2.1 - The customer continues browsing on the external website.
6.3 - The customer is able to clean the cart, being direct to empty_cart.php;
6.4 - The customer is able to checkout the order, being direct to checkout.php;
6.4.1 - The customer checks out on the external website and pays for the order;
6.4.2 - Money is taken through the external website.

7 - CHECKOUT.php
7.1 - The external website then makes a direct call using HTTPS to the DecoNetwork website to “commit” the order lines that have been just purchased. This call is server to server.

8 - EMPTY_CART.php
8.1 - Empty the cart and clear the session;
8.2 - Redirect to index.php.





