Shopkit commerce plugin


Fixed cart total NaN issue

@mkeipert’s code sample above helped me to solve this issue:

<option value="All::2,00">
    All (2.00&nbsp;€)

The NaN cart total was indeed caused by the comma in the value field. I’ve switched from sprintf to number_format to avoid these inconsistencies caused by localization.

The latest code is in the dev branch on GitHub, for those interested :slight_smile:


I can’t seem to replicate these issues; would you be able to send me some more specifics/screenshots in a private message?


Version 1.0.4 is here :footprints:


Shopkit v1.0.4 is mainly a bug-fixing and security release, with a few new features but nothing wildly different.

Part of the reason for this approach is that I will not be able to respond to support requests until mid-June 2016.

I know this is not an ideal situation, but it’s never a convenient time to go backpacking without internet access.



  • Bug fixes
    • More reliable calculation of shipping rates
    • Prevent DOM manipulation of discount and tax amounts in the cart
    • Prevent cart localization errors (resulting in NaN for the cart total)
    • Add multi-language support to some hard-coded strings (thanks to concertimpromptu)
    • Remember the selected country when a user navigates away from the Cart page (thanks to concertimpromptu)
    • Fix errors with subdirectory installs
    • Prevent prices from carrying over to the next product where prices haven’t yet been set
  • New features
    • :money_with_wings: Discount codes (site-wide and per-product)
    • :key: Password reset
    • :policeman: Opt-in email verification for new accounts
    • :package: Order notification emails
    • :money_mouth_face: More robust “pay later” options
  • Design and UI
    • Moved login form lower in the sidebar
    • Better indication of failed login
    • Make it harder to accidentally delete your account
    • Better handling of thumbnails with different aspect ratios (burry background fills up the dead space, like instagram)
    • Minimum 150px width for listing items
    • Removed title for the search bar
    • Better icons for Category and Product pages in the panel
    • Better UI for drag-and-drop file uploads in the panel
    • Smarter top menu layout (adapts to the number of menu items)
  • German language option (thanks to medienbaecker)
    • Also apologies to medienbaecker for my terrible google translate on the remainder of the German strings
  • Switched to dompdf for generating PDF Invoices (allows for easier HTML layout)
  • Moved page logic into controllers
  • RTL text support in templates
  • Explicit timezone definition in config.php
  • Smarter onboarding notifications
  • Hidden honeypot form fields for spam protection
  • Removed wholesaler user role (preferential pricing now handled with discount codes instead of roles)
  • Auto-shrink large image uploads




Thanks for your hard work on this. Look forward to working with this release on an upcoming project – and buying a license from you when live.

Have a good holiday/trip… going anywhere exciting?!

Cheers from Liverpool, UK.


i`m Agree Whit @mp75, its a really cool idea, and i think For other People/Developers Really Really Fantastic to use


I’ve downloaded Shopkit and I’m trying to implement it on a existing site. Is this not possible or just complex? I can’t find a documentation for merge it with my site.

How was your experience with it?

Best regards.


It should be doable, but you have to be careful when merging folders that contain files with the same filenames (blueprints, snippets, templates, controllers, content files etc.).

Basically, what you have to do is unify all the contents of the different folders in \content, \assets and \site.


Hey Sam,
it’s me again :slight_smile: . I got really far with your work. But i still didn’t get the invoice PDF to work. So i’m now using JSPDF.js for generating the PDF from client side (since it’s my client in the future, i’ll get around with this).

What i’m gonna do next are few things:
– Put in a select field for the orders, for assigning the orders to users (two different people sending the packages)
– Put in a text field for the tracking number from the parcel service.

And now there are two things, where i might need the help of the community:
– I want to send an email with the content from the single order (price, total sum, shipping etc.) as an invoice
– I want to send a second email with the tracking id assigned to this order.
Since this is quite common for other shops, i think the customer expects this kind of stuff, even though he gets an invoice from his PayPal-account.

Therefore i have some questions:
– You ever used a code where some content of a website gets sent as an email?
– Is it possible to archieve my needs with simple php or do i need a plugin for that?

I’d be very thankful for every help. Thanks so far!



Hi. Without digging into this to find out myself let me ask… is there a checkout page or does this simply send the user to PayPal for checkout? Is there an option out of the box for a seamless integration with PayPal pro or is this meant for the free PayPal accounts?


Hi Sam,

I really like the idea of Shopkit. I am planning to set up a shop for digital goods and am planning to give Shopkit a try.

One thing I noticed is that you have the following on the features list:

  • Process payments with PayPal (it’s easy to add other payment gateways)

How easy are we talking about? I ask because I had less then optimal experiences with PayPal. They froze my account three times in the past for no apparent reason. This has left me hesitant to rely on PayPal for anything critical.

If there was an easy way to integrate Stripe (for example) I’d be all ears.


There is a plugin for stripe, maybe that helps; @samnabi will be away until mid-June.


Thanks. I’ll look into that. It’s not urgent on my end yet. I still need to get all my ducks in a row on the product side. But it never hurts to prepare early instead of under deadline pressure. :slight_smile:


I everyone! I’m trying to do the following but with no success, any help is very welcome.

I’m trying to display all the categories in one page with all the products and the variants with the buttons to buy them. I think the image explain it better.

Thanks in advance!


Do you want to group by those categories and then the products or just display all product variants in a flat list?


Just display all products and variants in a flat list.


If I assume that your categories can be filtered by their template:

$categories = $site->index()->filterBy('template', 'category');

foreach($categories as $category):
  $products = $category->grandChildren();
  foreach($products as $product): ?>
    <div class="product">
     <h1><?= $product->title()->html() ?></h1>
     <!-- the rest of your code -->
   <?php endforeach ?>

<?php endforeach ?>

If the categories have a parent page:

$categories = page('categoryParent')->children();
//here goes the rest of the above code


Many many thanks, I managed to display the products with its variants and the buy buttons. But the thing now is when I press the “buy” button it took me to the cart but with errors. Here the errors, the “…” are mine to shorten the url. I can’t understand why those variables are missing. Any idea? Thanks again.

Notice: Undefined variable: salePrice in /.../site/plugins/shopkit/shopkit.php on line 266

Notice: Undefined variable: saleStart in /.../site/plugins/shopkit/shopkit.php on line 267

Notice: Undefined variable: saleEnd in /.../site/plugins/shopkit/shopkit.php on line 268

Notice: Undefined variable: saleCodes in /.../site/plugins/shopkit/shopkit.php on line 271

Notice: Undefined variable: salePrice in /.../site/plugins/shopkit/shopkit.php on line 281


I found the solution! the thing was I was sending a $page->uri() in the form with the button and I needed to edit it to send a $page->uri() :slight_smile:


Glad you sorted it out!:slight_smile:


Is there a way to send notifications about new orders by default to the admin? I have made the settings in the backend, that notification shall go out in relation to every product. I don’t get notifications at all. where in the code are the notification handled?