Jump to content

SnipWire - Snipcart integration for ProcessWire


Gadgetto

Recommended Posts

SnipWire - Snipcart integration for ProcessWire

snipwire-logo.png.feda01eced6c5fdf0f113e7e7282ba6e.pngSnipcart is a powerful 3rd party, developer-first HTML/JavaScript shopping cart platform. SnipWire is the missing link between Snipcart and the content management framework ProcessWire.
With SnipWire, you can quickly turn any ProcessWire site into a Snipcart online shop. The SnipWire plugin helps you to get your store up and running in no time. Detailed knowledge of the Snipcart system is not required.

SnipWire is free and open source licensed under Mozilla Public License 2.0! A lot of work and effort has gone into development. It would be nice if you could donate an amount to support further development:

btn_donate_LG.gif.c8f4961c98cd4b5e8f81d517f5e68864.gif

Status update links (inside this thread) for SnipWire development

  • 2020-07-03 -- SnipWire 0.8.7 (beta) released! Fixes some small bugs and adds an indicator for TEST mode
  • 2020-04-06 -- SnipWire 0.8.6 (beta) released! Adds support for Snipcart subscriptions and also fixes some problems
  • 2020-03-21 -- SnipWire 0.8.5 (beta) released! Improves SnipWires webhooks interface and provides some other fixes and additions
  • 2020-03-03 -- SnipWire 0.8.4 (beta) released! Improves compatibility for Windows based Systems.
  • 2020-03-01 -- SnipWire 0.8.3 (beta) released! The installation and uninstallation process has been heavily revised.
  • 2020-02-08 -- SnipWire 0.8.2 (beta) released! Added a feature to change the cart and catalogue currency by GET, POST or SESSION param
  • 2020-02-03 -- SnipWire 0.8.1 (beta) released! All custom classes moved into their own namespaces.
  • 2020-02-01 -- SnipWire is now available via ProcessWire's module directory!
  • 2020-01-30 -- SnipWire 0.8.0 (beta) first public release! (module just submitted to the PW modules directory)
  • 2020-01-28 -- added Custom Order Fields feature (first SnipWire release version is near!)
  • 2020-01-21 -- Snipcart v3 - when will the new cart system be implemented?
  • 2020-01-19 -- integrated taxes provider finished (+ very flexible shipping taxes handling)
  • 2020-01-14 -- new date range picker, discount editor, order notifiactions, order statuses, and more ...
  • 2019-11-15 -- orders filter, order details, download + resend invoices, refunds
  • 2019-10-18 -- list filters, REST API improvements, new docs platform, and more ...
  • 2019-08-08 -- dashboard interface, currency selector, managing Orders, Customers and Products, Added a WireTabs, refinded caching behavior
  • 2019-06-15 -- taxes provider, shop templates update, multiCURL implementation, and more ...
  • 2019-06-02 -- FieldtypeSnipWireTaxSelector
  • 2019-05-25 -- SnipWire will be free and open source

Plugin Key Features

  • Fast and simple store setup
  • Full integration of the Snipcart dashboard into the ProcessWire backend (no need to leave the ProcessWire admin area)
  • Browse and manage orders, customers, discounts, abandoned carts, and more
  • Multi currency support
  • Custom order and cart fields
  • Process refunds and send customer notifications from within the ProcessWire backend
  • Process Abandoned Carts + sending messages to customers from within the ProcessWire backend
  • Complete Snipcart webhooks integration (all events are hookable via ProcessWire hooks)
  • Integrated taxes provider (which is more flexible then Snipcart own provider)

Useful Links

 

SnipWire-dashboard.thumb.png.a6344a9a024d6a39ef786a5705b332aa.png

 

---- INITIAL POST FROM 2019-05-25 ----

Spoiler

I wanted to let you know that I am currently working on a new ProcessWire module that fully integrates the Snipcart Shopping Cart System into ProcessWire. (this is a customer project, so I had to postpone the development of my other module GroupMailer).

The new module SnipWire offers full integration of the Snipcart Shopping Cart System into ProcessWire.

Here are some highlights:

  • simple setup with (optional) pre-installed templates, product fields, sample products (quasi a complete shop system to get started immediately)
  • store dashboard with all data from the snipcart system (no change to the snipcart dashboard itself required)
  • Integrated REST API for controlling and querying snipcart data
  • webhooks to trigger events from Snipcart (new order, new customer, etc.)
  • multi currency support
  • self-defined/configurable tax rates
  • etc.

Development is already well advanced and I plan to release the module in the next 2-3 months.
I'm not sure yet if this will be a "Pro" module or if it will be made available for free.

I would be grateful for suggestions and hints!

Please have a look at the screenshots to get an idea what I'm talking about (open spoiler):
(Please note: these screenshots are from an early development state of SnipWire. To see actual screens please have a look at later posts below!)

SnipWire_Settings.jpg

SnipWire_Dashboard1.jpg

Snipcart_Shop.jpg

Snipcart_Shop_Cart.jpg

 

  • Like 24
  • Thanks 4
Link to comment
Share on other sites

Hi @Gadgetto, this looks great!

I've played around with Snipcart and Foxycart quite a lot and then built my own solution (which was quite a pain as well ? ). Snipcart definitely looked best IMHO but it is also quite expensive. But it may be worth that price if we have a good working module that integrates well and saves us lots of time during development.

20 hours ago, Gadgetto said:

I'm not sure yet if this will be a "Pro" module or if it will be made available for free. I would be grateful for suggestions and hints!

Well... free sounds great ? No idea how much money one can make by selling a pro module to the community - I've never heard any numbers and there have been several discussions about that. So I'm not even sure if it makes sense at all to sell anything to the pw community. It's also more effort to setup some kind of selling process, api key verificaton etc. (well, maybe not for you now that you can use SnipWire for that ? ); I decided to release RockGrid free for example so that others can use it easily in their modules (didn't happen as far as I know), but I stated that extended support is not for free. But RockGrid is totally different. A shopping cart is of course much more mainstream and has a broader audience for sure. I could be a possible customer one day ? 

 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

This looks great! I've set up my fair share of Snipcart sites, but never bothered to abstract any of it into a module. So thanks for making this available in whichever form you're comfortable with, free or paid.

My Snipcart styles have usually been very tightly linked to the site stylesheets (shared SASS variables and mixins) and ended up in the global site stylesheet. Maybe the stylesheet URL input shouldn't be mandatory for sites that already have the Snipcart CSS embedded? Just a thought.

  • Like 2
Link to comment
Share on other sites

13 hours ago, d'Hinnisdaël said:

This looks great! I've set up my fair share of Snipcart sites, but never bothered to abstract any of it into a module. So thanks for making this available in whichever form you're comfortable with, free or paid.

My Snipcart styles have usually been very tightly linked to the site stylesheets (shared SASS variables and mixins) and ended up in the global site stylesheet. Maybe the stylesheet URL input shouldn't be mandatory for sites that already have the Snipcart CSS embedded? Just a thought.

Done! ?

1775980080_Bildschirmfoto2019-05-25um11_16_44.thumb.png.7519ed0e0449add26e92ca3fc9a355a8.png

  • Like 3
Link to comment
Share on other sites

UPDATE

OK, after I've faced that for and against again, I've decided to make the module freely available.

If you are interested, you can test the current state of development. I already put the module on GitHub. Please note that the software is not yet intended for use in a production system. (Alpha version). For example, the configuration and handling of the VAT rates are still missing. Also the dashboard is still incomplete. And many other things needs to be improved and implemented... ?

If you like, you can also submit feature requests and suggestions for improvement. I also accept pull requests.

https://github.com/gadgetto/SnipWire

  • Like 13
Link to comment
Share on other sites

  • 2 weeks later...

ANOTHER UPDATE

SnipWires Taxes (VAT) configurator is ready!

I added a new custom Fieldtype FieldtypeSnipWireTaxSelector based on an idea of @BitPoet - thanks for that!

Also I created a full featured repeater for module config editor including drag&drop handling. Have a look at the animated GIF below. The taxes you configure here will be available as select option list in product page editor. The first tax in the configured list will be used a s the default tax in the custom field.

taxes-repeater.thumb.gif.75d243e965efeae179a1c794fe0564ba.gif

  • Like 9
Link to comment
Share on other sites

  • 2 weeks later...

UPDATE 2019-06-15

The taxes repeater field in module config editor was updated:

  • changed to a grid view for more flexibility
  • added field validation
  • prepared the taxes-repeater field code to become a standalone flexible Inputfield module for general use (Array/JSON repeater input field which stores its values in a single text field)

The taxes handling is completed! SnipWire now acts as a full flexible taxes-provider for Snipcart (we use Webhooks for this). No configuration needed in Snipcart dashboard. SnipCart orders are now fully working (except shipping handling).

The sample shop templates got an update:

  • customer login/logout
  • customer dashboard link/button to view orders history and subscriptions
  • editing of customer profile

Other updates and fixes:

  • The SnipWire Dashboard was updated (Charts, Orders, Customers, ...) --> see screenshot below.
    The Dashboard fetches its data from Snipcart via CURL multi - the response time for a fresh load is now under 2 seconds
  • The Webhooks handler now supports all Snipcart events via hookable methods.
  • Snipwire now supports all major Admin themes (Uikit, Reno and Default)
  • All module classes/files are more structured (e.g. separate helper and service classes)
  • Under the hood many bugs are fixed and code is updated to prevent unexpected errors.
  • Added a crispy SVG logo for all SnipCart back-end pages ?

Screen-recording of updated taxes-repeater:

Taxes-Repeater-Update.thumb.gif.44ecf707f735f142c43a9df47e7a7980.gif

 

Screenshot of SnipWire Dashboard:

SnipWire-Dashboard.thumb.png.51584acdbcfdaaf95c6fac2f6fcccc0d.png

  • Like 11
Link to comment
Share on other sites

8 hours ago, bernhard said:

Did you build it as a module (or have thought about that) or is it implemented manually?

Hi Bernhard,

currently integrated directly. But having this as module is a nice idea. The problem is, this thing has over 150 config parameters so packing it into a module will be quite a bit of work...

Link to comment
Share on other sites

You mean the config of the chart? Like type of chart, data, colors etc?

Of course it would not make sense to put all that into the module config. But it could make sense to have a fieldtype (or at least an inputfield) that can easily be added to a process module (or page edit screen) and that makes it easier and more streamlined to build those charts. In RockGrid (which also has lots of options) I use a PHP file to get the data (via RockFinder) and a JS file for the grid config.

I've started building a Chart module earlier this year, but did not release it: https://github.com/BernhardBaumrock/FieldtypeRockCharts Maybe you want to have a look and grab some ideas?

 

Link to comment
Share on other sites

23 minutes ago, bernhard said:

Of course it would not make sense to put all that into the module config. But it could make sense to have a fieldtype (or at least an inputfield) that can easily be added to a process module (or page edit screen) and that makes it easier and more streamlined to build those charts. In RockGrid (which also has lots of options) I use a PHP file to get the data (via RockFinder) and a JS file for the grid config.

I've started building a Chart module earlier this year, but did not release it: https://github.com/BernhardBaumrock/FieldtypeRockCharts Maybe you want to have a look and grab some ideas?

 

I'll first need to release SnipWire and in the phase of fine-tuning I would like to move some of the functionality into separate modules. A chart module could be such a candidate. I'm gonna check out your module and see how you were thinking of implementing that. Thanks for your hint!

The first separate module will be a fully configurable array/json repeater Inputfield which stores its values in a single text field. 

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

UPDATE 2019-08-08

The module has made hug steps forward and we are nearing a first beta release version. So for those of you who are interested, I wanted to let you know what happened in the meantime ?

  • The dashboard interface was refined.
  • Currency selector for switching dashboard currency (based on your currency fields)
  • Added dashboard sections for managing Orders, Customers and Products
  • Added a WireTabs interface to easily switch between the different dashboard sections.
  • Orders, Customers and Product-details are opened and edited in ProcessWire Panels
  • Added further properties to SnipCart product anchors like: categories, product dimensions, weight, and so on.
  • Added field selector to SnipWire settings for choosing the desired field (FieldtypePage) to be used for categories handling.
  • Refinded caching behavior. *)

*) the proper caching of SnipCart data fetched through their REST API is giving me headaches. I'm still not sure what to cache and how long. For example, think of retrieving the list of purchase orders and creating a pagination. Every single page has to be cached. What if new orders are added when flipping backwards? Then the page numbers could get out of hand. (this only as an example).

As SnipCart has relativ slow API response times (about 1.8-2.5 seconds for a request), I'm even thinking about developing a separate background job runner which continuously fetches data from SnipCart and caches it locally. Our SnipWire module could then only use locally stored data only.

What needs to be done:

  • As SnipCart has a totally broken presentation of multi currency values in it's dashboard (for example: they simply sum up order values in different currencies!) I need to calculate performance values manually. And this will be a huge job as the data comes from different REST API calls...
  • Orders, Customers and Products detail editors (order status update, setting the order tracking number, add metadata information, creating notifications on the specified orders, ...)
  • Order refunds handling through the SnipWire dashboard
  • Integration of external shipping providers
  • Integration of external taxes providers
  • Subscription handling through the SnipWire dashboard
  • Discount creation and handling through the SnipWire dashboard
  • Documentation, documentation, documentation!
  • and much more ...

Here are some fresh screens:

Spoiler

1-SnipWire-Dashboard.thumb.png.69ff1a7167f554302a321584289c0907.png

2-SniWire-Orders.thumb.png.6d3d9b11d0b5999e0906299d8e2374ab.png

3-SnipWire-Customers.thumb.png.65fcb3c61a51a98c2f07525640823c55.png

4-SnipWire-Products.thumb.png.4bb91757649570fe38e6c77b407c94a8.png

5-SnipWire-Settings.thumb.png.7a26e5422ffad6620b4f038a860b7dc9.png

6-SnipWire-Dashboard-daterangepicker.thumb.png.a3984e5c48da8e430391d545d3b10992.png

 

 

 

  • Like 10
Link to comment
Share on other sites

Very nice — I'm really impressed about how this is coming along. I particularly like how you manage to pack as many features into it while successfully staying within ProcessWire's visual language.

I wish I had a little more time on my hands to try it out in depth and give useful feedback.

Quote

As SnipCart has relativ slow API response times (about 1.8-2.5 seconds for a request), I'm even thinking about developing a separate background job runner which continuously fetches data from SnipCart and caches it locally. Our SnipWire module could then only use locally stored data only.

That sounds like a logical next step to me: using LazyCron to auto-fetch certain data. While it will increase complexity in the short term, it will probably make your job a lot easier in the long run and make for a better experience using the module.

  • Like 1
Link to comment
Share on other sites

5 minutes ago, d'Hinnisdaël said:

Very nice — I'm really impressed about how this is coming along. I particularly like how you manage to pack as many features into it while successfully staying within ProcessWire's visual language.

Thank your for the kind words! ?

6 minutes ago, d'Hinnisdaël said:

That sounds like a logical next step to me: using LazyCron to auto-fetch certain data. While it will increase complexity in the short term, it will probably make your job a lot easier in the long run and make for a better experience using the module.

I don't know if this will make it into the first release version but it seems to be a necessary step.

LazyCron, on the other hand, does not seem to be well suited. This would cause delays for website visitors. I was thinking more of a separate worker process, or multiple parallel processes, running asynchronously and externally triggered by a cron job or by Javascript runner. I have already implemented something like this for a newsletter module for MODX.

  • Like 3
Link to comment
Share on other sites

1 hour ago, Gadgetto said:

LazyCron, on the other hand, does not seem to be well suited. This would cause delays for website visitors.

Doesn't LazyCron hook into ProcessPageView::finished to avoid this exact problem? What I've done in the past to avoid long-running requests is to merely use LazyCron to trigger the time-intensive action via curl or wget, making it asynchronous.

Link to comment
Share on other sites

12 hours ago, d'Hinnisdaël said:

Doesn't LazyCron hook into ProcessPageView::finished to avoid this exact problem? What I've done in the past to avoid long-running requests is to merely use LazyCron to trigger the time-intensive action via curl or wget, making it asynchronous.

To my best knowledge it is still same request and visitor has to wait before actual content is ready to be served. Lazycron is (in my opinion) usable for very quick cleanup type of things only. Much better to use actual cron or other background process to do that kind of stuff.

SnipWire looks fantastic! Great that PW will have multiple e-commerce options available!

  • Like 1
Link to comment
Share on other sites

1 hour ago, apeisa said:

To my best knowledge it is still same request and visitor has to wait before actual content is ready to be served. Lazycron is (in my opinion) usable for very quick cleanup type of things only. Much better to use actual cron or other background process to do that kind of stuff.

You are right, it's a single process. Hooking into any method will still be in the same process and the visitor will need to consume the request time. I'll need to "launch" a new (background) process which will do the heavy lifting.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
On 5/15/2019 at 7:47 PM, Gadgetto said:

Status update links (inside this thread) for SnipWire development will be always posted here:

2019-08-08
2019-06-15
2019-06-02
2019-05-25

If you are interested, you can test the current state of development:

https://github.com/gadgetto/SnipWire

Please note that the software is not yet intended for use in a production system (alpha version).
If you like, you can also submit feature requests and suggestions for improvement. I also accept pull requests.

---- INITIAL POST FROM 2019-05-25 ----

I wanted to let you know that I am currently working on a new ProcessWire module that fully integrates the Snipcart Shopping Cart System into ProcessWire. (this is a customer project, so I had to postpone the development of my other module GroupMailer).

The new module SnipWire offers full integration of the Snipcart Shopping Cart System into ProcessWire.

Here are some highlights:

  • simple setup with (optional) pre-installed templates, product fields, sample products (quasi a complete shop system to get started immediately)
  • store dashboard with all data from the snipcart system (no change to the snipcart dashboard itself required)
  • Integrated REST API for controlling and querying snipcart data
  • webhooks to trigger events from Snipcart (new order, new customer, etc.)
  • multi currency support
  • self-defined/configurable tax rates
  • etc.

Development is already well advanced and I plan to release the module in the next 2-3 months.
I'm not sure yet if this will be a "Pro" module or if it will be made available for free.

I would be grateful for suggestions and hints!

(please have a look at the screenshots to get an idea what I'm talking about)

 

SnipWire_Settings.jpg

SnipWire_Dashboard1.jpg

Snipcart_Shop.jpg

Snipcart_Shop_Cart.jpg

This is really amazing work you have done. Congrats and keep it up 

Link to comment
Share on other sites

  • 1 month later...

UPDATE 2019-10-18

Some time has passed since the last update. But don't worry I've been working on it!

A good back of time devoured the development of our new documentation platform.

The new docs website can be found here:
https://docs.bitego.com (of course it runs under ProcessWire)

Most contents of existing projects are already imported. And I just started with the documentation for SnipWire.

Of course development on SnipWire itself has been continued as well:

  • the stability of the REST queries and their processing has been significantly improved
  • the filter (search) functions for the list views (orders, customers, products) have been implemented.
  • native ProcessWire pagination for list views has been implemented
  • more snipcart fields have been added to the product definition
  • several bugs have been fixed

169252132_Bildschirmfoto2019-10-18um21_48_35.thumb.png.367c614a4cf4ca657312e5c8e0bc99e0.png

Next steps:

  • finishing detail-views for Customers, Products and Orders
  • development of a parallel process that continuously fetches data from Snipcart and makes it available as a local cache. (this should significantly minimize the waiting time for REST queries)
  • implementation of Abandoned Carts Handling
  • implementation of Refunds Handling

Thats it for now! I also hope some of you will find the time and testing the current status. I would be very grateful for your feedback.

  • Like 9
Link to comment
Share on other sites

What I forgot to tell:

Snipcart recently became even more interesting in terms of cost!

Snipcart removed the Pro Pack bundle (70 USD/month) from their pricing. All Pro features will be available on Standard plan:

  • Abandoned carts recovery
  • Real-time shipping estimates
  • Inventory management
  • Custom email templates
  • TaxCloud & TaxJar integrations
  • Like 7
Link to comment
Share on other sites

12 hours ago, Gadgetto said:

Snipcart removed the Pro Pack bundle (70 USD/month) from their pricing. All Pro features will be available on Standard plan

Looks like they went back to their previous pricing model without a premium plan. This will make it a lot easier to suggest Snipcart in the future — paying 70$ a month for custom email templates was really limiting the number of customers that were a good fit for it.

Link to comment
Share on other sites

  • 3 weeks later...

@Gadgetto Snipwire looks awesome. Many many thanks. I will give it a test run. May I ask you two questions.

- with snipcart/snipwire is it easily posible to calculate price reductions before checkout. let's say you buy two t-shirts and like to reduce the second shirt by 10%?

- I've seen the dashboard has links for bills. Are those in PDF Format and in case can one customize the PDF template?

Much Kudos again! Great working and sharing!

Link to comment
Share on other sites

Thanks for the kind words!

1 hour ago, toni said:

- with snipcart/snipwire is it easily posible to calculate price reductions before checkout. let's say you buy two t-shirts and like to reduce the second shirt by 10%?

Snipcart has a lot of different discount features! Here is a cut out from my process module which should show what's possible:

$this->discountsTypes = array(
    'FixedAmount' => $this->_('Fixed amount deducted from order total'),
    'Rate' => $this->_('Percentage rebate on order total'),
    'AlternatePrice' => $this->_('Discount price provided by alternate price list'),
    'Shipping' => $this->_('Discount on shipping'),
    'FixedAmountOnItems' => $this->_('Fixed amount deducted on specified products'),
    'RateOnItems' => $this->_('Rate deducted on specified products'),
    'FixedAmountOnCategory' => $this->_('Fixed amount deducted on items of specified categories'),
    'RateOnCategory' => $this->_('Rate deducted on products of specified categories'),
    'GetFreeItems' => $this->_('Free products when customer buys specified quantity of product'),
    'AmountOnSubscription' => $this->_('Fixed amount on subscription'),
    'RateOnSubscription' => $this->_('Rate on subscription'),
);
$this->discountsTriggers = array(
    'Code' => $this->_('Enter discount code'),
    'Product' => $this->_('Specific product added'),
    'Total' => $this->_('Order reaches specific amount'),
    'QuantityOfAProduct' => $this->_('Product added a number of times'),
    'CartContainsOnlySpecifiedProducts' => $this->_('Cart only contains specified products'),
    'CartContainsSomeSpecifiedProducts' => $this->_('Cart contains some of specified products'),
    'CartContainsAtLeastAllSpecifiedProducts' => $this->_('Cart contains at least all specified products'),
);
1 hour ago, toni said:

- I've seen the dashboard has links for bills. Are those in PDF Format and in case can one customize the PDF template?

Yes, invoices can be downloaded in PDF format and the layout is customizable via the Snipcart dashboard!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...