This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

maxime@snipcart.com
maxime@snipcart.com

Hey all,

Max from Snipcart here (dev-first, HTML/JS-based e-comm solution).

I just crafted a quick tutorial showing how to create a single component buy button plugin with Snicpart + October. Thought some of y’all might find it useful/interesting, so here it is:

https://snipcart.com/blog/snipcart-octobercms-ecommerce-tutorial-got

And of course, I’d love to get some feedback on both the integration and the post. :)

Cheers!

alxy
alxy

Hi,

it's a really bad idea to put all asset files in the default theme file, as they are loaded on every single page load. This is not necessary, especially not, if you only sell a few products on only a single site. In October, plugins (components) can define their own assets, and you should pretty sure use this feature: http://octobercms.com/docs/plugin/components#component-assets

Keep in mind, that it is possible to inject custom HTML attributes as second param to the addCss and addJs method. The assets will then only be injected, if the page actually contains a component, what needs these. Dont forget to add {% styles %} to your layout, as this specifies the location, where the assets are injected.

You should also consider adding for example a configuration section (http://octobercms.com/docs/plugin/settings#database-settings) to enter the API key via a backend interface;That will highly increase the user ecperience. On top of that, your component properties need some love... Add validation rules, comments, ... All this makes it a little bit more friendly for your end users. Dont forget: These are all potential clients ;)

Last updated

maxime@snipcart.com
maxime@snipcart.com

Hi Alxy!

Thanks a lot for the feedback. I guess I missed some parts of the documentation and didn't dig deep enough--my bad. The integration was more of an exercice as a proof-of-concept rather than a complete plugin.

But I decided to go back to my example to improve it anyway. Turns out it's a lot better than the first one. ;)

We updated the blog post if you want to take a look!

We also have a public repo with the code open-sourced on Snipcart's GH account. We might put some more developpement there in the future.

Thanks again for your input, it’s much appreciated. :)

Maxime

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.