Jump to content
Gadgetto

SnipWire - Snipcart integration for ProcessWire

Recommended Posts

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

2019-10-18
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

  • Like 22
  • Thanks 3

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
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 12

Share this post


Link to post
Share on other sites

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 8

Share this post


Link to post
Share on other sites
On 5/25/2019 at 10:35 AM, Gadgetto said:

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

Thank you.

  • Like 4

Share this post


Link to post
Share on other sites

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 9

Share this post


Link to post
Share on other sites

Looking great! Thx!

Nice to see apex charts in action. Did you build it as a module (or have thought about that) or is it implemented manually?

Share this post


Link to post
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...

Share this post


Link to post
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?

 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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 7

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
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 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By eelkenet
      Hi! I've created a small Inputfield module called InputfieldFloatRange which allows you to use an HTML5 <input type="range" ../> slider as an InputField. I needed something like this for a project where the client needs to be able to tweak this value more based on 'a feeling' than just entering a boring old number. Maybe more people can use this so I'm hereby releasing it into the wild. 
      EDIT: You can now install it directly from the Modules directory: http://modules.processwire.com/modules/inputfield-float-range/
       
      What is it?
      The missing range slider Inputfield for Processwire. 
      What does it do?
      This module extends InputfieldFloat and allows you to use HTML5 range sliders for number fields in your templates.
      It includes a visible and editable value field, to override/tweak the value if required.  
      Features
      Min/max values Precision (number of decimals) Optional step value (Read more) Optional manual override of the selected value (will still adhere to the rules above) Configurable rounding of manually entered values (floor, round, ceil, disable) Usage
      Clone / zip repo Install FieldtypeFloatRange, this automatically installs the Inputfield Create new field of type `Float (range)` or convert an existing `Float`, `Integer` or `Text` field. To render the field's value simply echo `$page->field` Demo
      A field with Min=0, Max=1, Step=0.2, Precision=2

      Field with settings Min=0, Max=200, Step=0.25, Precision=2

       
      Todo
      Make the display-field's size configurable (will use the Input Size field setting)  Hopefully become redundant  
      Changelog
      005 (current version)
      - Fix bug where the Inputfield would not work properly within repeaters / repeater matrices
      004
      - Make rounding of manually entered values configurable (floor, round, ceil or disable)
      - Fix small JS bug when the value-display field was not displayed
      - Update README
      003
      - Code cleanup, add some ModuleInfo data & LICENSE
      - Submit to PW Modules directory (http://modules.processwire.com/modules/inputfield-float-range/)
      002
      - Fix issue where setting the step value to an empty value created problem with validation
      - Make the display-field optional
      001
      - Initial release
       
      Thanks!
       
       
    • By Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. Field widths entered into the Template Field Widths inputfield are only applied if the Edit Template form is submitted with the Template Field Widths inputfield in an opened state. "Collapsed" is the recommended setting if you think you might also use core inputs for setting field widths in a template context. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/
    • By adrian
      Tracy Debugger for ProcessWire
      The ultimate “swiss army knife” debugging and development tool for the ProcessWire CMF/CMS

       
      Integrates and extends Nette's Tracy debugging tool and adds 35+ custom tools designed for effective ProcessWire debugging and lightning fast development
      The most comprehensive set of instructions and examples is available at: https://adrianbj.github.io/TracyDebugger
      Modules Directory: http://modules.processwire.com/modules/tracy-debugger/
      Github: https://github.com/adrianbj/TracyDebugger
      A big thanks to @tpr for introducing me to Tracy and for the idea for this module and for significant feedback, testing, and feature suggestions.
    • By adrian
      This module allows you to automatically rename file (including image) uploads according to a configurable format
      This module lets you define as many rules as you need to determine how uploaded files will be named and you can have different rules for different pages, templates, fields, and file extensions, or one rule for all uploads. Renaming works for files uploaded via the admin interface and also via the API, including images added from remote URLs.   Github: https://github.com/adrianbj/CustomUploadNames
      Modules Directory: http://modules.processwire.com/modules/process-custom-upload-names/
      Renaming Rules
      The module config allows you to set an unlimited number of Rename Rules. You can define rules to specific fields, templates, pages, and file extensions. If a rule option is left blank, the rule with be applied to all fields/templates/pages/extensions. Leave Filename Format blank to prevent renaming for a specific field/template/page combo, overriding a more general rule. Rules are processed in order, so put more specific rules before more general ones. You can drag to change the order of rules as needed. The following variables can be used in the filename format: $page, $template, $field, and $file. For some of these (eg. $field->description), if they haven't been filled out and saved prior to uploading the image, renaming won't occur on upload, but will happen on page save (could be an issue if image has already been inserted into RTE/HTML field before page save). Some examples: $page->title mysite-{$template->name}-images $field->label $file->description {$page->name}-{$file->filesize}-kb prefix-[Y-m-d_H-i-s]-suffix (anything inside square brackets is is considered to be a PHP date format for the current date/time) randstring[n] (where n is the number of characters you want in the string) ### (custom number mask, eg. 001 if more than one image with same name on a page. This is an enhanced version of the automatic addition of numbers if required) If 'Rename on Save' is checked files will be renamed again each time a page is saved (admin or front-end via API). WARNING: this setting will break any direct links to the old filename, which is particularly relevant for images inserted into RTE/HTML fields. The Filename Format can be defined using plain text and PW $page variable, for example: mysite-{$page->path} You can preserve the uploaded filename for certain rules. This will allow you to set a general renaming rule for your entire site, but then add a rule for a specific page/template/field that does not rename the uploaded file. Just simply build the rule, but leave the Filename Format field empty. You can specify an optional character limit (to nearest whole word) for the length of the filename - useful if you are using $page->path, $path->name etc and have very long page names - eg. news articles, publication titles etc. NOTE - if you are using ProcessWire's webp features, be sure to use the useSrcExt because if you have jpg and png files on the same page and your rename rules result in the same name, you need to maintain the src extension so they are kept as separate files.
      $config->webpOptions = array(     'useSrcExt' => false, // Use source file extension in webp filename? (file.jpg.webp rather than file.webp) ); Acknowledgments
      The module config settings make use of code from Pete's EmailToPage module and the renaming function is based on this code from Ryan: http://processwire.com/talk/topic/3299-ability-to-define-convention-for-image-and-file-upload-names/?p=32623 (also see this post for his thoughts on file renaming and why it is the lazy way out - worth a read before deciding to use this module). 
       
       
      NOTE:
      This should not be needed on most sites, but I work with lots of sites that host PDFs and photos/vectors that are available for download and I have always renamed the files on upload because clients will often upload files with horrible meaningless filenames like:
      Final ReportV6 web version for John Feb 23.PDF

×
×
  • Create New...