• Guest, we are currently accepting crypto payments.

My Shopping Developer Documentation

Developer documentation for MyShopping eCommerce platform

This documentation aims to help you get started with extending My Shopping ecommerce platform and creating your own addons.
Note: This documentation is not fully completed. It will be updated every time the project has been progressed.

Template Syntax

My Shopping cms uses Twig as a primary template engine, and all available twig syntax are available on this page.

Global variables

There are few global variables available at this time that you can use without needing extra queries with database:

  • visitor variable
    • This variable will fetch of Users model and will return object of App\Pub\Model\Users::class
  • myshopping variable
    • This variable will return an object containing data like website name and settings.

Getting logged in user inside template without extra queries

In order to get authorized user in template, you should call `visitor` variable, and it will return object of User class. This is super global variable that can be accessed in any template without extra queries to get logged in user.

Checking user permissions inside template without extra queries

To check whenever a logged in user has permission, we simple call visitor.hasPermission('permission_id') function.

Getting user primary group inside template without extra queries

Whenever you need to get primary group of member who is logged in, we simple call visitor.primaryGroup, this function will give us Object of Groups model.

  • Published
    Dec 11, 2022
  • Page views
    400
Top