Shopkit commerce plugin

The email logic is at the very end of sites/plugins/shopkit/shopkit.php.

I did a little testing today and the emails are indeed not working for PayPal transactions. They do work for Pay Later transactions though. Bug filed: https://github.com/samnabi/shopkit/issues/67

I’ve ruled out SSL issues, so I’ll review the code tomorrow to look for the culprit.

Oh and, hi everyone!

1 Like

Next steps for Shopkit

I am working on resolving a few bugs in Shopkit 1.0.4, and the fixes will be released as version 1.0.5 within the next week or so. No new features in 1.0.5.

Then I’ll get to work on updating Shopkit for Kirby 2.3, complete with plugin registry goodness.

Questions while I was away

@AlexK How easy is it to add another payment gateway?

Adding more payment gateways is “easy” in the sense that Shopkit has a switch statement that can be extended to handle another gateway. You would still have to write all your own code to process the raw transaction data (like snippets/cart.process.paypal.php). And you would need to write some code to handle the successful callback (like snippets/payment.success.paypal.php).

You would also need to add a button to templates/cart.php and modify some PayPal-specific display logic in templates/order.php.

In short, perhaps it’s not as easy as I made it out to be. :neutral_face: I plan to include Stripe in a future release (not the next one), so ideas are welcome here: https://github.com/samnabi/shopkit/issues/70

@thewebprojects Paypal Pro integration

Shopkit uses PayPal Payments Standard, with data sent through a web form. The actual payment happens on PayPal’s server.

@ToGe88 PDF issues

Can you replicate the PDF download issue with a fresh copy of Shopkit 1.0.4? If so, it would help to get the details of your server (PHP version, installed PHP extensions) so I can look into this further.

@ToGe88 Order notifications

Shopkit 1.0.4 comes with email notifications out-of-the-box, located under Shop settings > Payment. However, it has a bug that I’ll fix before releasing 1.0.5.

@ToGe88 Send follow-up information to customers

This is a great feature request, and would be helpful not just for tracking numbers but any update to the customer’s order after they’ve paid. I’ve logged it on GitHub for inclusion in a future release.

@guidoferreyra Integrating Shopkit into an existing site

Like @texnixe said, it’s a bit of a mess to manually merge all the blueprints, snippets, etc. into an existing Kirby site. I’m sure it will also cause version control headaches when you update to the next version of Shopkit. Hopefully with Kirby 2.3 and the plugin registry, this will become easier.

1 Like

Hi Sam,
Thanks for the update. A lot of features are working now. Your plugin is pretty great.

Could you do me a favor and tell me when and where you add the code for the cart update?

Thanks Tobi

I tagged you on the GitHub issue, which I’ll update when that feature gets going :slight_smile:

@mkeipert, I’ve figured out the bug with notification emails. A fix is coming in 1.0.5. More details: https://github.com/samnabi/shopkit/issues/67#issuecomment-226786209

Version 1.0.5 is here :full_moon_with_face:

You know when you step away from your code for a few months and then come back, and wonder what the heck you were thinking when you originally wrote it? Yeah.

  • Bug fixes
    • Even more reliable calculation of shipping rates, subtotals, and applicable tax
    • New order notifications now work with PayPal and are multilingual
    • Fix the missing PayPal redirection message
  • Design and UI
    • Minor tweaks to “Free Shipping” and “No Tax” badge placement in the Cart page
  • Replace several nested git repos with regular files for the DomPDF plugin, for easier installation

Download: https://github.com/samnabi/shopkit/releases/tag/v1.0.5

This release is still based on Kirby 2.2.3. I decided to get this one out ASAP, as there were a few critical bugs that needed to get fixed. Now the fun work begins to repackage Shopkit as a plugin, taking advantage of the new goodies in Kirby 2.3.

4 Likes

I just made a quick fix for the PDF issue, in case someone’s interested.

Thanks for identifying the bug and offering a solution! I’m still deciding whether this logic should be in the Orders snippet or if it should be baked into the formatPrice() function itself. But this will make it into version 1.1 for sure.

Also related to Shopkit 1.1, a lot of people seem to want more flexibility related to themes. It would help me if you could chime in with your experiences on the GitHub issues page here:

v1.1 on the horizon

It’s been almost a month since the last Shopkit update, and since then yet another version of Kirby has been released. Kirby 2.3.1 brings some great new fixes, including the ability to use the extension registry for blueprint field snippets. This is something Shopkit is definitely taking advantage of.

Shopkit 1.1 is about 60% complete and you can track progress and provide feedback on the GitHub issues page.

This is going to be a big release. There are lots of new features, and a complete overhaul of the file structure to make things more self-contained. Version 1.1 will most likely break your existing Shopkit sites, with lots of manual merge conflicts to deal with.

So. I’m going to take a little bit more time getting 1.1 ready, building awesome new features, and designing a file structure that won’t break your custom themes and payment gateways in future updates. When it’s released I’ll offer migration support to anyone with a license.

If you really want to be using the latest and greatest Kirby core, feel free to replace the /kirby and /panel folders to 2.3.1. It won’t break Shopkit 1.0.5.

In the meantime, keep an eye on the dev branch, which is being very actively developed. Join the discussion on new features to be implemented. Thank you for your patience.

2 Likes

Looking for feedback on a new modular structure for payment gateways.

There’s a new plugins/shopkit/gateways folder. Within this folder, you can add a payment gateway which has the following structure:

gateways/
    1-gatewayname/
        config.php
        process.php
        callback.php
  • config.php sets some options: label is the only required one, and you can add anything else you need for your gateway logic.
  • process.php handles the data passed from the Cart page. It should package up the transaction data and send it to the gateway.
  • callback.php handles the callback response from your gateway. This is a file that the gateway server talks to to confirm payment. The customer shouldn’t have to navigate to this page.

And you can number the folders to control their display order, just like Kirby pages :slight_smile:

Take a look: https://github.com/samnabi/shopkit/tree/dev/site/plugins/shopkit/gateways

2 Likes

Can you already tell if this will be easier in 1.1 and share how this would work (theoretically)? I’m considering using it for an existing site now but there’s no way for me to start-off with a fresh shopkit setup but I’d need to integrate the shop into my existing site somehow. No rush though, I’m just thinking about it and like the idea of using Shopkit for the Kirby site.

If you look at Shopkit’s dev branch in Github, you can see that blueprints, controllers, fields, snippets, and templates are going to be contained within the plugin folder.

With the current version, all these files are scattered around. You can’t just drop it into an existing Kirby installation. You’d have to go into each folder (e.g. site/templates) and move the individual files from Shopkit to your existing site… then if you want to make changes to the template, you’d have to edit the file directly, which will result in merge conflicts when you try to update to the latest version of Shopkit.

Now, even with the new file structure you’ll still have to deal with merging stuff that is outside of the plugins folder:

  • assets/css
  • content
  • site/blueprints/site.yml
  • site/languages
  • Third-party plugins (dompdf, field-bidi, field-multiselect, field-selector, robinGrid.php)

If your existing site has any templates or blueprints or snippets that clash with Shopkit’s file naming, the Shopkit files will be ignored (which will probably break functionality). You’ll have to rename your existing site’s files.

If you want to make your own template designs for Shopkit, you’ll be able to make your own template files (in site/templates) that overwrite Shopkit’s defaults.

There will always be some manual work involved when merging Shopkit into an existing project, but with Shopkit 1.1 it should be somewhat less of a hassle.

Shopkit 1.1: Somewhat Less Of A Hassle™

1 Like

Do you have a demo of the store anywhere?

Why yes, you can use Shopkit to buy Shopkit at http://shopkit.samnabi.com :slight_smile:

I don’t have a backend demo up online, but you’re free to download a local version of Shopkit to see how the Panel looks.

Do you have any plans to enable us to enter/save addresses for shipping/billing in Shopkit? I’m considering to change our shop over to Shopkit, but the main dealbreakers at the moment are that it is not possible to save the addresses for prepayment, and that the only payment gateway is PayPal. What we’d need is at least stripe integration, something where you do not need an account to pay via credit card …

Yes, addresses and Stripe integration are both coming in the next release.

2 Likes

Great news, thanks :smiley: do you have a rough timeline for the release?

In true Kirby fashion, I can only say… it’s coming soon. There are only 4 more tasks to complete before it’s ready for testing, and the Gift Certificates feature is 99% done.

2 Likes

Shopkit 1.1 beta

Hi Everyone,

The dev branch has been updated to Shopkit 1.1 – it’s still in beta, since I have to run through the upgrade process on a few different websites and make sure there aren’t any bugs before formally launching the new version.

Major new features include gift certificates, downloadable products, and Stripe payments.

I’m working on updating the docs as well, this is another reason I’m going to hold off on a formal release for a few more days.

If you decide to play around with this and try out the beta, please log any issues here: https://github.com/samnabi/shopkit/milestone/5

Thank you all for your patience!

4 Likes

Version 1.1 is here :cat:

  • Bug fixes
    • Fix locale-based formatting issues with PayPal gateway
    • Fix inventory counting errors
    • Better handling of non-float values in formatPrice()
    • More reliable shipping calculation
    • More reliable country detection
  • New features
    • :credit_card: Stripe payment gateway
    • :shopping: Gift certificates
    • :arrow_down:️ Downloadable products
    • :cookie: Per-product tax rules
    • :green_book: Terms and conditions
  • Design and UI
    • Filter orders by status on View Orders page
    • Remember current page on login
    • Larger photo slider on product page
    • More detailed order notification emails
    • Confirm customer name, email, and address after payment
  • Added robots.txt
  • Most template, snippet and blueprint files moved to plugins folder
  • Standardized payment gateway structure
  • Moved blueprints to YAML format
  • Updated core and panel to Kirby 2.3.2

This has been a long time coming!

I bumped the version number to 1.1 because there have been a lot of structural changes to the files. Many of the templates, blueprints, and snippets are moved within the plugins/shopkit folder.

There’s also a new standardized way to add payment gateways. Take look in site/plugins/shopkit/gateways to check it out.

And finally, the first-requested feature is released — product downloads!

Save 50% on bulk licenses

For a limited time, use the discount code KIRBYANDLOVE to get 50% off orders of 5 or more licenses. Buy your licenses here.

With the discount, 5 licenses only cost $47.50 instead of $95! And the already-discounted 10-pack costs $85.50 instead of $171.

Migration support

If you’ve already purchased a license, I will be happy to offer migration support to update your site to version 1.1. Even using git, this can be a big, messy update. You will be getting an email in the next couple days with more information.

1 Like