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 2

Share this post


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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By MoritzLost
      This is a new module that provides a simple solution to clearing all your cache layers at once, and an extensible interface to perform various cache-related actions.
      The simple motivation behind this module was that I was tired of manually clearing caches in several places after deploying a change on a live site. The basic purpose of this module is a simple Clear all caches link in the Setup menu which clears out all caches, no matter where they hide. You can customize what exactly the module does through it's configuration menu:
      Expire or delete all cache entries in the database, or selectively clear caches by namespace ($cache API) Clear the the template render cache. Clear out specific folders inside your site's cache directory (/site/assets/cache) Refresh version strings for static assets to bust client-side browser caches (this requires some setup, see the full documentation for details). This is the basic function of the module. However, you can also add different cache management action through the API and execute them through the module's interface. For this advanced usage, the module provides:
      An interface to see all available cache actions and execute them. A system log and logging output on the module page to see verify what the module is doing. A CacheControlTools class with utility functions to clear out different caches. An API to add cache actions, execute them programmatically and even modify the default action. Permission management, allowing you granular control over which user roles can execute which actions. The complete documentation can be found in the module's README.
      Beta release
      Note that I consider this a Beta release. Since the module is relatively aggressive in deleting some caches, I would advise you to install in on a test environment before using it on a live site.
      Let me know if you're getting any errors, have trouble using the module or if you have suggestions for improvement!
      In particular, can someone let me know if this module causes any problems with the ProCache module? I don't own or use it, so I can't check. As far as I can tell, ProCache uses a folder inside the cache directory to cache static pages, so my module should be able to clear the ProCache site cache as well, I'd appreciate it if someone can test that for me.
      Future plans
      If there is some interest in this, I plan to expand this to a more general cache management solution. I particular, I would like to add additional cache actions. Some ideas that came to mind:
      Warming up the template render cache for publicly accessible pages. Removing all active user sessions. Let me know if you have more suggestions!
      Links
      https://github.com/MoritzLost/ProcessCacheControl ProcessCacheControl in the Module directory

    • By joshua
      This module is (yet another) way for implementing a cookie management solution.
      Of course there are several other possibilities:
      - https://processwire.com/talk/topic/22920-klaro-cookie-consent-manager/
      - https://github.com/webmanufaktur/CookieManagementBanner
      - https://github.com/johannesdachsel/cookiemonster
      - https://www.oiljs.org/
      - ... and so on ...
      In this module you can configure which kind of cookie categories you want to manage:

      You can also enable the support for respecting the Do-Not-Track (DNT) header to don't annoy users, who already decided for all their browsing experience.
      Currently there are four possible cookie groups:
      - Necessary (always enabled)
      - Statistics
      - Marketing
      - External Media
      All groups can be renamed, so feel free to use other cookie group names. I just haven't found a way to implement a "repeater like" field as configurable module field ...
      When you want to load specific scripts ( like Google Analytics, Google Maps, ...) only after the user's content to this specific category of cookies, just use the following script syntax:
      <script type="optin" data-type="text/javascript" data-category="statistics" data-src="/path/to/your/statistic/script.js"></script> <script type="optin" data-type="text/javascript" data-category="marketing" data-src="/path/to/your/mareketing/script.js"></script> <script type="optin" data-type="text/javascript" data-category="external_media" data-src="/path/to/your/external-media/script.js"></script> <script type="optin" data-type="text/javascript" data-category="marketing">console.log("Inline scripts are also working!");</script> The type has to be "optin" to get recognized by PrivacyWire, the data-attributes are giving hints, how the script shall be loaded, if the data-category is within the cookie consents of the user. These scripts are loaded asynchronously after the user made the decision.
      If you want to give the users the possibility to change their consent, you can use the following Textformatter:
      [[privacywire-choose-cookies]] It's planned to add also other Textformatters to opt-out of specific cookie groups or delete the whole consent cookie.
      You can also add a custom link to output the banner again with a link / button with following class:
      <a href="#" class="privacywire-show-options">Show Cookie Options</a> <button class="privacywire-show-options">Show Cookie Options</button> This module is still in development, but we already use it on several production websites.
      You find it here: https://github.com/blaueQuelle/privacywire/tree/master
      Download: https://github.com/blaueQuelle/privacywire/archive/master.zip
      I would love to hear your feedback 🙂
      Edit: Updated URLs to master tree of git repo
       
    • By David Karich
      Admin Page Tree Multiple Sorting
      ClassName: ProcessPageListMultipleSorting
      Extend the ordinary sort of children of a template in the admin page tree with multiple properties. For each template, you can define your own rule. Write each template (template-name) in a row, followed by a colon and then the additional field names for sorting.
      Example: All children of the template "blog" to be sorted in descending order according to the date of creation, then descending by modification date, and then by title. Type:
      blog: -created, -modified, title  Installation
      Copy the files for this module to /site/modules/ProcessPageListMultipleSorting/ In admin: Modules > Check for new modules. Install Module "Admin Page Tree Multible Sorting". Alternative in ProcessWire 2.4+
      Login to ProcessWire backend and go to Modules Click tab "New" and enter Module Class Name: "ProcessPageListMultipleSorting" Click "Download and Install"   Compatibility   I have currently tested the module only under PW 2.6+, but think that it works on older versions too. Maybe someone can give a feedback.     Download   PW-Repo: http://modules.processwire.com/modules/process-page-list-multiple-sorting/ GitHub: https://github.com/FlipZoomMedia/Processwire-ProcessPageListMultipleSorting     I hope someone can use the module. Have fun and best regards, David
    • By dimitrios
      Hello,
      this module can publish content of a Processwire page on a Facebook page, triggered by saving the Processwire page.
      To set it up, configure the module with a Facebook app ID, secret and a Page ID. Following is additional configuration on Facebook for developers:
      Minimum Required Facebook App configuration:
      on Settings -> Basics, provide the App Domains, provide the Site URL, on Settings -> Advanced, set the API version (has been tested up to v3.3), add Product: Facebook Login, on Facebook Login -> Settings, set Client OAuth Login: Yes, set Web OAuth Login: Yes, set Enforce HTTPS: Yes, add "https://www.example.com/processwire/page/" to field Valid OAuth Redirect URIs. This module is configurable as follows:
      Templates: posts can take place only for pages with the defined templates. On/Off switch: specify a checkbox field that will not allow the post if checked. Specify a message and/or an image for the post.
      Usage
      edit the desired PW page and save; it will post right after the initial Facebook log in and permission granting. After that, an access token is kept.
       
      Download
      PW module directory: http://modules.processwire.com/modules/auto-fb-post/ Github: https://github.com/kastrind/AutoFbPost   Note: Facebook SDK for PHP is utilized.


×
×
  • Create New...