Blog Technology

One Page Checkout – customising an extension for the cloud

Our One Page Checkout for Shopware is popular. Until now it was reserved for self-hosted customers, because Shopware Cloud Hosting places its own demands on an app.

What a cloud app is not allowed to do

No PHP code of your own can run inside the app itself. Deeper functionality has to sit on a separate app server and is addressed from there via API.

The task was therefore to rebuild the existing plugin so that it gets by on HTML, CSS and JavaScript alone. Subscribers and everything else containing PHP had to go. Shopware’s documentation helps with the first steps.

The manifest.xml is the heart of it

The basis of an app is quickly in place. Its core is the manifest.xml. What goes in there closely resembles the composer.json of a self-hosted plugin.

Excerpt of the manifest.xml file showing name, label, description, author and version of the app. Enlarge image
The manifest.xml of an app: name, version, permissions and entry points in one place.

Templates, snippets and assets stay familiar

The rest of the structure is identical when it comes to templates, snippets, Sass and JavaScript. Only the directory layout looks a little different. Anyone who knows the plugin system finds their way around the app system quickly.

Directory tree of the PremsOnePageCheckoutApp with Resources, snippets, views and manifest.xml.
The directory structure of the app - the same parts as in the plugin, just sorted differently.

Conclusion

Apps are a good thing for cloud hosting customers. It gets tight as soon as you want more in the frontend than showing existing data differently. In our case we wanted to display payment and shipping information in the One Page Checkout before login and registration. That was not possible.

More is possible in the admin: there you can add information via iFrame. In the storefront that option is still missing. With it there would be considerably more use cases. We are staying on it and will publish further apps.

Back to the blog