Jump to content

SnipWire - Snipcart integration for ProcessWire


Gadgetto

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. 😉

Link to comment
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
Link to comment
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!

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

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

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

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

 

 

Link to comment
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
Link to comment
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
Link to comment
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 🤡

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

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

 

Link to comment
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? 🙂 

Link to comment
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
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By MarkE
      This fieldtype and inputfield bundle was built for storing measurement values within a field, rendering them in a variety of formats and converting them to other units or otherwise modifying them via the API.
      The API consists of a number of predefined functions, some of which include...
      render() for rendering the measurement object, valueAs() for converting the value to another unit value, convertTo() for converting the whole measurement object to different units, and add() and subtract() for for modifying the stored value by the value (converted as required) in another measurement. In the admin the inputfield includes a checkbox (which can be optionally disabled) for converting values on page save. For an example if a value was typed in as centimeters, the unit was changed to metres, and the page saved with this checkbox selected, said value would be automatically converted so that e.g. 170 cm becomes 1.7 m.

      A simple length field using Fieldtype Measurement and Inputfield Measurement.
      Combination units (e.g. feet and inches) are also supported.
      Please note that this module is 'proof of concept' at the moment - there are limited units available and quite a lot of code tidying to do. More units will be added shortly.
      See the GitHub at https://github.com/MetaTunes/FieldtypeMeasurement for full details and updates.
    • By tcnet
      File Manager for ProcessWire is a module to manager files and folders from the CMS backend. It supports creating, deleting, renaming, packing, unpacking, uploading, downloading and editing of files and folders. The integrated code editor ACE supports highlighting of all common programming languages.
      https://github.com/techcnet/ProcessFileManager

      Warning
      This module is probably the most powerful module. You might destroy your processwire installation if you don't exactly know what you doing. Be careful and use it at your own risk!
      ACE code editor
      This module uses ACE code editor available from: https://github.com/ajaxorg/ace

      Dragscroll
      This module uses the JavaScript dragscroll available from: http://github.com/asvd/dragscroll. Dragscroll adds the ability to drag the table horizontally with the mouse pointer.
      PHP File Manager
      This module uses a modified version of PHP File Manager available from: https://github.com/alexantr/filemanager
       
    • By tcnet
      This module implements the website live chat service from tawk.to. Actually the module doesn't have to do much. It just need to inserted a few lines of JavaScript just before the closing body tag </body> on each side. However, the module offers additional options to display the widget only on certain pages.
      Create an account
      Visit https://www.tawk.to and create an account. It's free! At some point you will reach a page where you can copy the required JavaScript-code.

      Open the module settings and paste the JavaScript-code into the field as shown below. Click "Submit" and that's all.

      Open the module settings
      The settings for this module are located int the menu Modules=>Configure=>LiveChatTawkTo.

       
    • By tcnet
      Session Viewer is a module for ProcessWire to list session files and display session data. This module is helpful to display the session data of a specific session or to kick out a logged in user by simply delete his session file. After installation the module is available in the Setup menu.

      The following conditions must be met for the module to work properly:
      Session files
      Session data must be stored in session files, which is the default way in ProcessWire. Sessions stored in the database are not supported by this module. The path to the directory where the session files are stored must be declared in the ProcessWire configuration which is by default: site/assets/sessions.
      Serialize handler
      In order to transform session data easier back to a PHP array, the session data is stored serialized. PHP offers a way to declare a custom serialize handler. This module supports only the default serialize handlers: php, php_binary and php_serialize. WDDX was dropped in PHP 7.4.0 and is therefore not supported by this module as well as any other custom serialize handler. Which serialize handler is actually used you can find out in the module configuration which is available under Modules=>Configure=>SessionViewer.

      Session data
      The session data can be displayed in two different ways. PHP's default output for arrays print_r() or by default for this module nice_r() offered on github: https://github.com/uuf6429/nice_r. There is a setting in the module configuration if someone prefers print_r(). Apart from the better handling and overview of the folded session data the output of nice_r() looks indeed nicer.

      Links
      ProcessWire module directory
      github.com
    • By Robin S
      Repeater Easy Sort
      Adds a compact "easy-sort" mode to Repeater and Repeater Matrix, making those fields easier to sort when there are a large number of items.
      The module also enhances Repeater Matrix by allowing a colour to be set for each matrix type. This colour is used in the item headers and in the "add new" links, to help visually distinguish different matrix types in the inputfield.
      Screencasts
      A Repeater field

      A Repeater Matrix field with custom header colours

      Easy-sort mode
      Each Repeater/Matrix item gets an double-arrow icon in the item header. Click this icon to enter easy-sort mode.
      While in easy-sort mode:
      The items will reduce in width so that more items can be shown on the screen at once. The minimum width is configurable in the field settings. Any items that were in an open state are collapsed, but when you exit easy-sort mode the previously open items will be reopened. You can drag an item left/right/up/down to sort it within the items. The item that you clicked the icon for is shown with a black background. This makes it easier to find the item you want to move in easy-sort mode. You can click an item header to open the item. An "Exit easy-sort mode" button appears at the bottom of the inputfield. Configuration
      In the field settings for Repeater and Repeater Matrix fields you can define a minimum width in pixels for items in easy-sort mode. While in easy-sort mode the items will be sized to neatly fill the available width on any screen size but will never be narrower than the width you set here.
      In the field settings for Repeater Matrix you can define a custom header colour for each matrix type using an HTML "color" type input. The default colour for this type of input is black, so when black is selected in the input it means that no custom colour will be applied to the header.
      Exclusions
      The easy-sort mode is only possible on Repeater/Matrix fields that do not use the "item depth" option.
       
      https://github.com/Toutouwai/RepeaterEasySort
      https://processwire.com/modules/repeater-easy-sort/
×
×
  • Create New...