Jump to content
Gadgetto

SnipWire - Snipcart integration for ProcessWire

Recommended Posts

5 hours ago, Gadgetto said:

Important: SnipCart is not yet ready for production environments!

Just to be clear, SnipWire is not yet ready, correct? As long as I develop with SnipCart's code and don't rely on your module, I can safely plan to add SnipWire to the site after its stable release, correct? 

I'm just trying to plan ahead for that date. 😉

Share this post


Link to post
Share on other sites
2 hours ago, creativejay said:

Just to be clear, SnipWire is not yet ready, correct?

Sorry, for sure I meant SnipWire (I edited my post)!

2 hours ago, creativejay said:

As long as I develop with SnipCart's code and don't rely on your module, I can safely plan to add SnipWire to the site after its stable release, correct? 

I don't see a reason why this shouldn't work. It probably would be the best, if you install and use the latest versions of SnipWire module and only use custom code where SnipWire isn't ready yet or is missing features you'd like to use.

As I don't have a documentation available yet, please don't hesitate to ask your questions here and I'll try to help.

If you find any problems/bugs or if you have suggestions for improvement while using SnipWire, it would be great if you could post back here or post an issue at GitHub so I could fix it.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks!

Will SnipWire allow for multiple product templates?

Right now I have several products that are subscriptions, several that are short-term access, and others that are one-time purchases. These are all for services, with nothing to ship. They are each a different (non "snipcart-") template at the moment but if SnipWire would only allow one, I can go back in and build a lot of dependent fields based on checkboxes or select dropdowns.

Thanks for your pre-launch guidance on this!

Share this post


Link to post
Share on other sites
11 hours ago, creativejay said:

Will SnipWire allow for multiple product templates?

Right now I have several products that are subscriptions, several that are short-term access, and others that are one-time purchases. These are all for services, with nothing to ship. They are each a different (non "snipcart-") template at the moment but if SnipWire would only allow one, I can go back in and build a lot of dependent fields based on checkboxes or select dropdowns.

Not in the first release. But multiple product templates are definitely planned.

Share this post


Link to post
Share on other sites

UPDATE 2020-01-14

What's new - what has been added - what has changed:

  • I had to completely remove the DateRangePicker.js library because of quirks on mobile devices and accessibility problems. 
  • The dashboard date range picker has been completely rebuilt with default ProcessWire fields - and I think it looks great + its now fully working on mobile devices + its more accessible!
  • The orders detail panel is now also capable of changing order statuses and adding order comments (including customer notifications, tracking number and tracking url)
  • Finalized the discount editor: create, edit, delete, archive, unarchive Snipcart discounts
  • A lot of internal fixes and enhancements
  • One of the greatest features of the current version is the dashboard performance. I was able to increase the REST API execution speed by the factor of 2 - 2.5 times

What's next:

  • I'm still struggling with taxes handling. Especially the handling of shipping taxes is a complex thing and drives me crazy... DONE!
  • Finishing the remaining detail panels
  • Implementing Subscriptions 
  • Implementing Digital Products (probably not in the first release)
  • Implementing a more flexible product template handling (probably not in the first release) DONE!
  • And of course - release!

Here are some fresh screens:

Spoiler

1919382097_snipwire-dashboard.thumb.png.6a32ba002c2a6d6d4cfa6f6803afd6fe.pngsnipwire-edit-orderstatus.thumb.png.84a381fdd1479e5c3b92ac44fdbb6e73.pngsnipwire-add-discount.thumb.png.d79873b890168b9da59872425b1d258e.png

 

  • Like 3

Share this post


Link to post
Share on other sites
5 minutes ago, Gadgetto said:

UPDATE 2020-01-14

Thanks for the update! I am thinking of giving it a test drive in the near future, I just do not have the time right now.

One more thought regarding taxes: would it be possible to implement some basics here first and later on concentrating on something "ideal", so that at least those who do not need more than the "basics" can start relying on them. May be this idea does not make any sense, so I am just brainstorming here...

Share this post


Link to post
Share on other sites
16 minutes ago, szabesz said:

One more thought regarding taxes: would it be possible to implement some basics here first and later on concentrating on something "ideal", so that at least those who do not need more than the "basics" can start relying on them. May be this idea does not make any sense, so I am just brainstorming here...

The problem is, taxes handling needs to be bomb proof, otherwise the store merchant could get problems with the taxes authorities. Taxes is one of the last things which needs to be finished before the first release. I'm in contact with the Snipcart guys and I think this should be solved in short time.

  • Like 3

Share this post


Link to post
Share on other sites
23 hours ago, creativejay said:

Will SnipWire allow for multiple product templates?

I just implemented your feature request! 🙂

Multiple product-templates are now allowed! Just get latest version on GitHub!

823136240_Bildschirmfoto2020-01-14um19_47_55.thumb.png.bed577dc8a29c61f07aa841c26de4a0a.png

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
3 hours ago, creativejay said:

Whoot, thanks!

I have pushed a small fix regarding the new "multiple product templates" feature. Please redownload at GitHub.

  • Like 1

Share this post


Link to post
Share on other sites

UPDATE 2020-01-19

I finally finished the integrated taxes provider - SnipWire now also handles shipping taxes correctly - and in a very flexible way which should cover pretty much all tax calculation methods/requirements worldwide!

The integrated SnipWire taxes provider is now even more flexible than Snipcart own integrated provider!

A store merchant can choose between the following shipping taxes calculation methods:

  1. No shipping taxes
  2. Apply a fixed tax rate:
    A fixed shipping tax rate from taxes configuration is used.
  3. Apply predominant tax rate:
    The shipping costs are allocated entirely to the economic good with the highest tax rate. So the highest tax rate from cart is used to calculate shipping taxes.
  4. Proportionally split and apply tax rates:
    The shipping service is divided as a secondary service and shares proportionally the fate of the respective main service. Part of the shipping service is thus subject to the normal tax rate, part to the reduced tax rate.

If you find any other constellations which cannot be covered by the present options, please drop me a line and I'll add it.

880392865_Bildschirmfoto2020-01-19um10_29_05.thumb.png.44d61b67f0f84283c27f84bd0ca05606.png

  • Like 3
  • Thanks 2

Share this post


Link to post
Share on other sites
1 hour ago, Gadgetto said:

The integrated SnipWire taxes provider is now even more flexible than Snipcart own integrated provider!

This looks amazing, thanks for your effort and your transparency in developing this module. Please make it very obvious how to donate or contribute to the project in whatever way is helpful 👽

  • Like 3

Share this post


Link to post
Share on other sites
6 hours ago, d'Hinnisdaël said:

Please make it very obvious how to donate or contribute to the project in whatever way is helpful 👽

Done! 🙂 - donation button in GitHub repo, forum signature and initial SnipWire forum post. (I hope this is not against forum rules?)

  • Like 2

Share this post


Link to post
Share on other sites
2 hours ago, Gadgetto said:

I hope this is not against forum rules?

I think if you make it absolutely clear that the Donate button is for supporting the development of your Mozilla Public License 2.0 licensed module, then it is ok. Currently it is not quite clear that the "button" in your signature is for that thing only.

Anyways, as soon as I have time, I will test and donate.

Share this post


Link to post
Share on other sites
10 hours ago, szabesz said:

I think if you make it absolutely clear that the Donate button is for supporting the development of your Mozilla Public License 2.0 licensed module, then it is ok.

Done!

  • Like 1

Share this post


Link to post
Share on other sites

Hi @Gadgetto Thanks for your effort with this module and making it available to the PW community! I'm installing it right now to give it a try. I've noticed that the module configuration still refers to Snipcart v.2 when version 3 has been out for a few weeks now and looks stable enough. Among other things, the jQuery dependency is gone so I guess you could remove that option, and update the links to the Snipcart JS and CSS files.

 

 

Share this post


Link to post
Share on other sites
3 hours ago, jacmaes said:

Hi @Gadgetto Thanks for your effort with this module and making it available to the PW community! I'm installing it right now to give it a try. I've noticed that the module configuration still refers to Snipcart v.2 when version 3 has been out for a few weeks now and looks stable enough. Among other things, the jQuery dependency is gone so I guess you could remove that option, and update the links to the Snipcart JS and CSS files.

Compared with v2, Snipcart v3 is still not feature complete. Some parts are missing as far as I know. At the moment I don’t know exactly what’s still missing but as soon as v3 is complete, I’ll definitely implement this - or even make it configurable to switch between versions.

  • Like 2

Share this post


Link to post
Share on other sites

UPDATE 2020-01-19

This is a follow-up to my last post! The question was asked when v3 of the cart system will be implemented in SnipWire. 

The following features are still missing in Snipcart v3:

  • Digital goods
  • Google Analytics integration
  • Inventory management
  • Deferred payments
  • Multi-currency
  • Recurring subscriptions with Stripe
  • Authorize.net support

Some of the listed features are required by SnipWire as they are essential and would require a lot of code rewrites to exclude them. So SnipWire will be changed to use v3 of the cart system when the following features are available in Snipcart:

  • Inventory management
  • Deferred payments
  • Multi-currency
  • Like 5

Share this post


Link to post
Share on other sites
48 minutes ago, Gadgetto said:

Some of the listed features are required by SnipWire as they are essential and would require a lot of code rewrites to exclude them. So SnipWire will be changed to use v3 of the cart system when the following features are available in Snipcart:

  • Inventory management
  • Deferred payments
  • Multi-currency

Sounds reasonable. They kind of jumped the gun for marketing reasons there; not a fan of how it was rolled out. How does a production shop even work without analytics and inventory management?

You don't happen to be in contact with them regarding ETAs on those features? I found it hard to get reliable answers even though wish I could switch my sites to their Vue cart layouts and ditch jQuery once and for all 🤡

Share this post


Link to post
Share on other sites
On 1/21/2020 at 10:57 PM, d'Hinnisdaël said:

Sounds reasonable. They kind of jumped the gun for marketing reasons there; not a fan of how it was rolled out. How does a production shop even work without analytics and inventory management?

You don't happen to be in contact with them regarding ETAs on those features? I found it hard to get reliable answers even though wish I could switch my sites to their Vue cart layouts and ditch jQuery once and for all 🤡

This is the answer I got in their Slack developer channel:

Quote

We should be shipping the latest inventory management quirks (in-cart auto-updates of max. available quantities) by the end of this sprint:
Release v3.0.8 - end of 3/2/2020 → 14/2/2020 sprint
Multi-currency isn't strictly planned short term. We should be tackling it somewhere in March. Same thing goes for deferred payments.

 

  • Like 2

Share this post


Link to post
Share on other sites

Hi @Gadgetto
I need additional consent to the general business terms. For API version 2 this is documented here: https://docs.snipcart.com/v2/configuration/custom-fields

It works like this in a test in MarkupSnipWire:

 $jsResources[] = 
              '<script src="' . $this->snipwireConfig->snipcart_js_path . '"'
            . (!empty($this->snipwireConfig->snipcart_js_integrity) ? ' integrity="' . $this->snipwireConfig->snipcart_js_integrity . '"' : '')
            . ' data-api-key="' . $snipcartAPIKey . '"'
            . ' data-cart-custom1-name="By checking this box, I have read and agree to the <a href=\'https://www.processwire.com\' class=\'js-real-link\' target=\'_blank\'>Terms &amp; Conditions</a>"'
            . ' data-cart-custom1-options="true|false"'
            . ' data-cart-custom1-required="true"'
            . ' id="snipcart"'
            . '></script>';


Could such a custom field be accessible via the configuration? Or is there a better way?

Share this post


Link to post
Share on other sites
8 hours ago, Noboru said:

Hi @Gadgetto
I need additional consent to the general business terms. For API version 2 this is documented here: https://docs.snipcart.com/v2/configuration/custom-fields

It works like this in a test in MarkupSnipWire:


 $jsResources[] = 
              '<script src="' . $this->snipwireConfig->snipcart_js_path . '"'
            . (!empty($this->snipwireConfig->snipcart_js_integrity) ? ' integrity="' . $this->snipwireConfig->snipcart_js_integrity . '"' : '')
            . ' data-api-key="' . $snipcartAPIKey . '"'
            . ' data-cart-custom1-name="By checking this box, I have read and agree to the <a href=\'https://www.processwire.com\' class=\'js-real-link\' target=\'_blank\'>Terms &amp; Conditions</a>"'
            . ' data-cart-custom1-options="true|false"'
            . ' data-cart-custom1-required="true"'
            . ' id="snipcart"'
            . '></script>';


Could such a custom field be accessible via the configuration? Or is there a better way?

Custom product and order fields are in the works! I am just not sure yet how to make this feature configurable via module config.

  • Like 1

Share this post


Link to post
Share on other sites

Custom product fields

I think the best way to implement this is to let SnipWire auto-detect fields in product templates which names start with snipcart-item-custom{index} and if found add their output to markup. The admin simply needs to create those PW fields and add them to the desired product template.

Custom order fields

Implementing custom order fields will be a little bit more complex as we don't have a specific "order" template where we could attach a field. Processing a Snipcart order also won't trigger any PW page actions so where should we define a custom order field?

Any idea?

 

Share this post


Link to post
Share on other sites
7 minutes ago, Gadgetto said:

which names start with snipcart-item-custom{index}

What do you mean by saying "start with"? Is the example above a prefix or the complete fieldname?

10 minutes ago, Gadgetto said:

we don't have a specific "order" template

Why not? 🙂 

Share this post


Link to post
Share on other sites
17 minutes ago, Gadgetto said:

I think the best way to implement this is to let SnipWire auto-detect fields in product templates which names start with snipcart-item-custom{index} and if found add their output to markup. The admin simply needs to create those PW fields and add them to the desired product template.

I think there will be cases where custom fields will differ by product template, so the order might not be guaranteed and it's probably better to name them after their content (custom_field_size instead of custom_field_1). But how do you determine the option n° for Snipcart — if you move around the field in the template, should it keep its ID to keep order records consistent, or does that not matter as long as it's named properly?

18 minutes ago, Gadgetto said:

Implementing custom order fields will be a little bit more complex as we don't have a specific "order" template where we could attach a field. Processing a Snipcart order also won't trigger any PW page actions so where should we define a custom order field?

That's what I've done in the past: create an order template with fields that I map to custom options. Also good to have the consent text editable by site editors.

  • Like 1

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 d'Hinnisdaël
      Happy new year, everybody 🥬
      I've been sitting on this Dashboard module I made for a client and finally came around to cleaning it up and releasing it to the wider public. This is how it looks.
      ProcessWire Dashboard

      If anyone is interested in trying this out, please go ahead! I'd love to get some feedback on it. If this proves useful and survives some real-world testing, I'll add this to the module directory.
      Download
      You can find the latest release on Github.
      Documentation
      Check out the documentation to get started. This is where you'll find information about included panel types and configuration options.
      Custom Panels
      My goal was to make it really simple to create custom panels. The easiest way to do that is to use the panel type template and have it render a file in your templates folder. This might be enough for 80% of all use cases. For anything more complex (FormBuilder submissions? Comments? Live chat?), you can add new panel types by creating modules that extend the DashboardPanel base class. Check out the documentation on custom panels or take a look at the HelloWorld panel to get started. I'm happy to merge any user-created modules into the main repo if they might be useful to more than a few people.
       Disclaimer
      This is a pre-release version. Please treat it as such — don't install it on production sites. Just making sure 🍇
      Roadmap
      These are the things I'm looking to implement myself at some point. The wishlist is a lot longer, but those are the 80/20 items that I probably won't regret spending time on.
      Improve documentation & add examples ⚙️ Panel types Google Analytics ⚙️ Add new page  🔥 Drafts 🔥 At a glance / Page counter 404s  Layout options Render multiple tabs per panel panel groups with heading and spacing between ✅ panel wrappers as grid item (e.g. stacked notices) ✅ Admin themes support AdminThemeReno and AdminThemeDefault ✅ Shortcuts panel add a table layout with icon, title & summary ✅ Chart panel add default styles for common chart types ✅ load chart data from JS file (currently passed as PHP array) Collection panel support image columns ✅ add buttons: view all & add new ✅
    • By Robin S
      This module is inspired by and similar to the Template Stubs module. The author of that module has not been active in the PW community for several years now and parts of the code for that module didn't make sense to me, so I decided to create my own module. Auto Template Stubs has only been tested with PhpStorm because that is the IDE that I use.
      Auto Template Stubs
      Automatically creates stub files for templates when fields or fieldgroups are saved.
      Stub files are useful if you are using an IDE (e.g. PhpStorm) that provides code assistance - the stub files let the IDE know what fields exist in each template and what data type each field returns. Depending on your IDE's features you get benefits such as code completion for field names as you type, type inference, inspection, documentation, etc.
      Installation
      Install the Auto Template Stubs module.
      Configuration
      You can change the class name prefix setting in the module config if you like. It's good to use a class name prefix because it reduces the chance that the class name will clash with an existing class name.
      The directory path used to store the stub files is configurable.
      There is a checkbox to manually trigger the regeneration of all stub files if needed.
      Usage
      Add a line near the top of each of your template files to tell your IDE what stub class name to associate with the $page variable within the template file. For example, with the default class name prefix you would add the following line at the top of the home.php template file:
      /** @var tpl_home $page */ Now enjoy code completion, etc, in your IDE.

      Adding data types for non-core Fieldtype modules
      The module includes the data types returned by all the core Fieldtype modules. If you want to add data types returned by one or more non-core Fieldtype modules then you can hook the AutoTemplateStubs::getReturnTypes() method. For example, in /site/ready.php:
      // Add data types for some non-core Fieldtype modules $wire->addHookAfter('AutoTemplateStubs::getReturnTypes', function(HookEvent $event) { $extra_types = [ 'FieldtypeDecimal' => 'string', 'FieldtypeLeafletMapMarker' => 'LeafletMapMarker', 'FieldtypeRepeaterMatrix' => 'RepeaterMatrixPageArray', 'FieldtypeTable' => 'TableRows', ]; $event->return = $event->return + $extra_types; }); Credits
      Inspired by and much credit to the Template Stubs module by mindplay.dk.
       
      https://github.com/Toutouwai/AutoTemplateStubs
      https://modules.processwire.com/modules/auto-template-stubs/
    • By Mike Rockett
      Jumplinks for ProcessWire
      Release: 1.5.60
      Composer: rockett/jumplinks
      ⚠️ NOTICE: 1.5.60 is an important security patch-release for an XSS vulnerability discovered by @phlp. It's HIGHLY RECOMMENDED that all Jumplinks users update to the latest version as soon as possible.
      Jumplinks is an enhanced version of the original ProcessRedirects by Antti Peisa.
      The Process module manages your permanent and temporary redirects (we'll call these "jumplinks" from now on, unless in reference to redirects from another module), useful for when you're migrating over to ProcessWire from another system/platform. Each jumplink supports wildcards, shortening the time needed to create them.
      Unlike similar modules for other platforms, wildcards in Jumplinks are much easier to work with, as Regular Expressions are not fully exposed. Instead, parameters wrapped in curly braces are used - these are described in the documentation.
      Under Development: 2.0, to be powered by FastRoute
      As of version 1.5.0, Jumplinks requires at least ProcessWire 2.6.1 to run.
      View on GitLab
      Download via the Modules Directory
      Read the docs
      Features
      The most prominent features include:
      Basic jumplinks (from one fixed route to another) Parameter-based wildcards with "Smart" equivalents Mapping Collections (for converting ID-based routes to their named-equivalents without the need to create multiple jumplinks) Destination Selectors (for finding and redirecting to pages containing legacy location information) Timed Activation (activate and/or deactivate jumplinks at specific times) 404-Monitor (for creating jumplinks based on 404 hits) Additionally, the following features may come in handy:
      Stale jumplink management Legacy domain support for slow migrations An importer (from CSV or ProcessRedirects) Feedback & Feature Requests
      I’d love to know what you think of this module. Please provide some feedback on the module as a whole, or even regarding smaller things that make it whole. Also, please feel free to submit feature requests and their use-cases.
      Note: Features requested so far have been added to the to-do list, and will be added to 2.0, and not the current dev/master branches.
      Open Source

      Jumplinks is an open-source project, and is free to use. In fact, Jumplinks will always be open-source, and will always remain free to use. Forever. If you would like to support the development of Jumplinks, please consider making a small donation via PayPal.
      Enjoy! 🙂
    • By Robin S
      Add Image URLs
      Allows images/files to be added to Image/File fields by pasting URLs.

      Usage
      Install the Add Image URLs module.
      A "Paste URLs" button will be added to all image and file fields. Use the button to show a textarea where URLs may be pasted, one per line. Images/files are added when the page is saved.
       
      https://github.com/Toutouwai/AddImageUrls
      https://modules.processwire.com/modules/add-image-urls/
    • By gebeer
      Hello all,
      sharing my new module FieldtypeImageReference. It provides a configurable input field for choosing any type of image from selectable sources. Sources can be: 
      a predefined folder in site/templates/ and/or a  page (and optionally its children) and/or the page being edited and/or any page on the site CAUTION: this module is under development and not quite yet in a production-ready state. So please test it carefully.
      UPDATE: the new version v2.0.0 introduces a breaking change due to renaming the module. If you have an older version already installed, you need to uninstall it and install the latest master version.
      Module and full description can be found on github https://github.com/gebeer/FieldtypeImageReference
      Install from URL: https://github.com/gebeer/FieldtypeImageReference/archive/master.zip
      Read on for features and use cases.
      Features
      Images can be loaded from a folder inside site/templates/ or site/assets Images in that folder can be uploaded and deleted from within the inputfield Images can be loaded from other pages defined in the field settings Images can be organized into categories. Child pages of the main 'image source page' serve as categories mages can be loaded from any page on the site From the API side, images can be manipulated like native ProcessWire images (resizing, cropping etc.), even the images from a folder Image thumbnails are loaded into inputfield by ajax on demand Source images on other pages can be edited from within this field. Markup of SVG images can be rendered inline with `echo $image->svgcontent` Image names are fully searchable through the API $pages->find('fieldname.filename=xyz.png'); $pages->find('fieldname.filename%=xy.png'); Accidental image deletion is prevented. When you want to delete an image from one of the pages that hold your site-wide images, the module searches all pages that use that image. If any page contains a reference to the image you are trying to delete, deletion will be prevented. You will get an error message with links to help you edit those pages and remove references there before you can finally delete the image. This field type can be used with marcrura's Settings Factory module to store images on settings pages, which was not possible with other image field types When to use ?
      If you want to let editors choose an image from a set of images that is being used site-wide. Ideal for images that are being re-used across the site (e.g. icons, but not limited to that).
      Other than the native ProcessWire images field, the images here are not stored per page. Only references to images that live on other pages or inside a folder are stored. This has several advantages:
      one central place to organize images when images change, you only have to update them in one place. All references will be updated, too. (Provided the name of the image that has changed stays the same) Installation and setup instructions can be found on github.
      Here's how the input field looks like in the page editor:

      If you like to give it a try, I'm happy to hear your comments or suggestions for improvement. Install from URL: https://github.com/gebeer/FieldtypeImageReference/archive/master.zip
      Eventually this will go in the module directory, too. But it needs some more testing before I submit it. So I'd really appreciate your assistance.
      Thanks to all who contributed their feedback and suggestions which made this module what it is now.
       
×
×
  • Create New...