antonythorpe/silvershop-unleashed

Silvershop submodule that integrates with Unleashed Software Inventory Management

Installs: 9

Dependents: 0

Suggesters: 0

Stars: 1

Watchers: 2

Forks: 3

Open Issues: 0

Type:silverstripe-vendormodule

1.0.4 2018-03-01 04:49 UTC

README

Silvershop submodule that integrates with Unleashed Software Inventory Management

Build Status Scrutinizer Code Quality Latest Stable Version Total Downloads License

Features

  • Build Tasks to sync Products, Product Categories and Sales Orders with Unleashed
  • Creates new Customers and Sales Orders in Unleashed upon the payment of a SilverShop order (includes Guest customers)

Use Case

Keeps Silvershop in alignment with an external source of truth - the inventory system. Save time with updating product prices in Silvershop; simply run the BuildTask and review the report. When an order is paid, the new Customer and Order are sent to Unleashed, saving time/data entry mistakes.

How it works

  • Adds a GUID property to Product, ProductCategory, OrderItem, OrderModifier, and Member classes. The Product, ProductCategory, and Order dataobjects are updated via the Build Tasks. This saves the Unleashed GUID in the database to identify changes found in results from API calls.
  • Upon payment of an Order, the module checks the Customer's email address with Unleashed and obtains the GUID. This is used with the Sales Order post. A couple of config settings are needed for the modifiers to flow through to Unleashed as an order item.
  • The Order Build Task keeps the order status up to date.
  • Uses Guzzle to make the API calls (though easily replaced with another system).

Creating a Sales Order in Unleashed

Note regarding getting/creating a Customer

  • The customer is logged in and has a Guid from Unleashed?
    • true: use Guid of the Customer for the Sales Order
    • false: GET Customer filtered by the email address
      • if a Customer is returned. Use the returned Guid of the Customer for the Sales Order
      • if a Customer is not returned. As there might already be another customer with the same Customer Code then GET Customer filtered by the Customer Code (the Company name or the first & last name)
        • a Customer is returned. Is the delivery address the same?
          • true: It must be the same one. Use the returned Guid of the Customer for the Sales Order.
          • false: Add a random digit to the Customer Code. POST Customer and use the returned Guid for the Sales Order
        • a Customer is not returned. POST Customer and use the returned Guid for the Sales Order

Adding an Order

  • Post SalesOrders with order data

Limitations

  • Assumes that the Silvershop product prices exclude Tax
  • Does not utilise the 'Charge' line type for Shipping when Sales Orders are created
  • Discounts hardcoded to NIL in the Sales Order Items
  • The Product/Product Categories Build Tasks only sync existing items within Unleashed. New ones need to be added manually, via upload or modification to the existing Build Task.
  • Will only send modifiers with a value to Unleashed. NIL values are automatically skipped.
  • If a user is logged in and changes the email address in the checkout form, then this new email address will not be passed onto Unleashed - no PUT Customer calls are available with Unleashed.
  • If a Guest purchases a second time with a unique email and delivery address then a new Customer will be created in Unleashed. A random number will be attached to its Customer Code to avoid double ups.

Requirements

Documentation

Index

Support

None sorry.

Change Log

Link

Contributing

Link

License

MIT