Sign in to follow this  

E-Commerce with Processwire - Accounting

Recommended Posts

I've been asked to look into migrating an existing site into Magento & Stripe.

I haven't mentioned to my client whether he would consider Processwire because I wasn't sure how to do the accounting side of things using PW.

He currently has a bespoke site (PHP / MySQL) and 1 of his biggest problems is that there are some bugs with the accounting side of things and he has to reconcile his accounts manually.

As much as I like PW, I don't know how easy it would be generate various sales and accounting report using PW. The only way I can currently think of is to store each sale as a page and I would have to write various get functions with filters and loop through them to get totals. 

I never thought I'd say this but I'm missing SQL right now :)

Any thoughts, suggestions or opinions would be welcome here.

Share this post

Link to post
Share on other sites

You can still use your SQL in ProcessWire, either raw or using $database variable. I have done this myself in various modules. Also, maybe not to the extent you want, but Padloper generates sales reports.

  • Like 3

Share this post

Link to post
Share on other sites
4 minutes ago, kongondo said:

You can still use your SQL in ProcessWire, either raw or using $database variable. I have done this myself in various modules. Maybe not to the extent you want, but Padloper generates sales reports.

Is that an undocumented feature as I can't see it on the cheatsheet?

Share this post

Link to post
Share on other sites

Yes. It's quite advanced to be in the cheatsheet :). Besides the links below, you can Google (forums) $database (or even PDO) to find out more if you wish. Also, just grepping $database in ProcessWire core files, especially Fieldtypes should yield interesting stuff

  1. API documentation on ProcessWire site:  Class Database
  2. More API Docs: Class Database
  3. Example usage: Blog and Matrix modules. 
  • Like 3

Share this post

Link to post
Share on other sites
23 hours ago, kongondo said:
  1. Example usage: Blog and Matrix modules. 

If you link to GitHub, please use the commit-id (instead of branch-names). Otherwise, future editions could make those links pointless.

  1. Example usage: Blog and Matrix modules.

Protip: To get the SHAified url on GitHub, go to any file you want to link to (e.g. and press Y (without anything, just y) on your keyboard.

  • Like 5

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

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By suntrop
      Hi all
      I have big troubles with my DB backups and phpMyAdmin. I can't manage to import a backup.
      The phpMyAdmin export settings are left to the defaults. The error message I get:
      #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO `caches` (`name`, `data`, `expires`) VALUES ('' at line 11 When I delete the complete 'cache' section there are almost for all tables the same errors. (part of the dump attached)
      I had this problem before and back then (couple months ago) I think I copied almost every table individually. I thought it was specific to that DB. But I can't do a dump/import of any of my PW installations.
      MySQL: 5.6.27
      PHP version: 7.0.11
      Anybody knows that problem? Or what to do?
      phpMyAdmin SQL Dump.sql
    • By vwatson
      pw 3.0.36
      I just installed on a new site and received this warning when I accessed the admin url.
      SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'ProcessLogger' for key 'class'
      Is that anything to worry about? The admin and site appear to be working fine. I just want to avoid issues down the road if there is a problem somewhere.
    • By Nukro
      Hi guys
      I have a problem with a specific filter/selector I try to achieve. The following filter causes a SQL-Error.

      This error also appears when I want to sort subfields(options and page fields - multi and single select) in the lister or with the API.
      Some Infos
      Processwire Version: 2.7.3
      ListerPro Version: 1.0.8
      Media Manager: 0.0.6
      PHP-Version:  7.0.8-0 UBUNTU
      MySQL-Version: 5.7.13-0ubuntu0.16.04.2-log - (Ubuntu)
      I tried changing the sql_mode many times:
      I tried all above but with minimal effect. When I remove "ONLY_FULL_GROUP_BY" it doesn't cause a SQL-Error but it still can't find the page. Also sorting subfields start working. But everything works fine locally on a fresh blank install with the media manager and listerpro. My local MySQL Version is 5.6.25 and PHP version is 5.6.
      The Intention why I am asking (last post):
      Some other Processwire Topics related to sql_modes:
      I wanted to ask in the forum before I try it on github:
      Some related links to sql_modes:
    • By FrancisChung
      Hi there,
      I was looking for some Processwire + Amazon integration advice. I've never built an e-commerce platform before and surprisingly there's hardly any articles or forum posts when you type in variation searches of "Amazon + Processwire"

      Are there any 3rd party tools and services you recommend?
      Any gotchas I should be aware of ?

      Thanks in advance!
    • By Jason Huck
      Is there an easy way to get back the SQL query generated by a specific processwire selector? I have what appears to be a cartesian product and/or groupwise maximum bug in a selector, but I'm not sure how to confirm it.

      I'm querying for a set of pages with a specific template which are related to the current page. The returned pages include a URL field and a file field. The selector looks like this:
      $grades = $pages->find('template=grade,include=all,classification.title="'.$page->title.'",sort=series,sort=title'); "classification" is a page field. Series and title are text fields. I'm iterating through the results and outputting three text fields, a URL field, and a file (->url) field. On one of the nine pages using this query, it should only return one row, but it returns two. The text fields are identical for both rows. The URL and file fields are empty in the first row and populated in the second row. The other eight pages all work as expected with no duplication.