OFFLINE-GmbH / oc-snipcartshop-plugin

Ecommerce solution for October CMS using snipcart.com as a backend
MIT License
11 stars 4 forks source link

Question about database and API #23

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hello,

I'm studying the code of that module because I will probably have to modify it quite heavily to handle some very specific needs.

By looking at how the module is done, I have a question about the Orders and Discounts.

Why did you copied all snipcart data to local database table ? You could retrieve all the data using the Snipcart API only, and it would be easier to keep data synchronisation as the only source of information would be Snipcart.

It would also resolve the issue where you create discount on the snipcart side, but don't see it on the website.

Using the Purgeable Trait, you could keep the same models fields definition without having to save the values to the database, is there a technical reason that explain why you choose to do like that ?

Best regards,

Alex

tobias-kuendig commented 6 years ago

Thank you for your feedback.

Why did you copied all snipcart data to local database table ? You could retrieve all the data using the Snipcart API only, and it would be easier to keep data synchronisation as the only source of information would be Snipcart.

The data is stored locally for performance and reliability reasons. We wanted to show the order data without having to depend on Snipcart's API. It is true that this makes the whole process a lot more difficult. In hindsight your proposal would have made more sense.

It would also resolve the issue where you create discount on the snipcart side, but don't see it on the website.

The real problem to me in this case are the missing webhooks on Snipcart's side. If Snipcart would provide webhooks for discount events we could keep the data in sync.

We don't use Snipcart for our own projects anymore since we were somewhat dissatisfied with their product. That's why we are currently in the process of reworking this plugin into a standalone solution: https://github.com/OFFLINE-GmbH/oc-mall-plugin

It will take a few more weeks to get an initial version out, though.

Zmove commented 6 years ago

Thank you for the feedback. Starred the oc-mall plugin to follow the development ^^

What was the things you did not like with snipcart ?

tobias-kuendig commented 6 years ago

What was the things you did not like with snipcart ?

The data-attributes API they provide has a few critical bugs when you want to do more than a simple "add to cart" of a simple product. The API changes, fields are renamed, added or removed seemingly at will. It's hard to keep up with their development progress.

Even their cart overlay had a few show-stopping bugs when we tested it. Checkbox options showed up as true and false in the order overview with no way to customize the text, the generated HTML had duplicate IDs and invalid markup, making it hard to customize the whole experience via JS.

Apart from that, the whole solution is not as customizable as they make it seem to be. Yes, you can change the theme and change a few options but if your customer needs a field where Snipcart doesn't provide an option for you, you are out of luck. This might work if you don't need anything special. But in the real world with real customers it has proven to be not sufficient to us.

We emailed them multiple bug reports and feedback but never received an answer ‒ some of the bugs we reported have been "silently" fixed, tought.

Take this rant with a grain of salt, though. It was our own experience when implementing Snipcart in another country, in a different language, with a different currency and different needs than the developers focused on.

Snipcart works for simple setups and simple needs. If your needs are more complex, maybe Snipcart is not the best tool for the job.