dinoperovic / django-salesman

Headless e-commerce framework for Django and Wagtail.
https://django-salesman.rtfd.io
BSD 3-Clause "New" or "Revised" License
391 stars 48 forks source link

Documentation - Wagtail Admin #25

Closed Timusan closed 1 year ago

Timusan commented 1 year ago

It is not very clear how to get an overview of Salesman's components, how to manage products, ... within Wagtail.

The SALESMAN_ADMIN_REGISTER setting seems to imply that it is set to True by default and gives us all kinds of Admin views, however only Orders is added to the Wagtail admin menu.

Is the idea that we should build our own Admin views using ModelAdmin? Or are there default views for all components (Products, Baskets, ...) shipped and need they be enabled somehow?

dinoperovic commented 1 year ago

Hey @Timusan,

Salesman is purposely not managing products and only provides the interface for them. You should structure your catalog/products however you see fit and then add them to the admin if you wish. In wagtail, it can be a page, or it can be a simple Django model. The only requirement is that it implements salesman.core.typing.Product protocol.

You can find the basic example here: https://django-salesman.readthedocs.io/en/latest/adding_products.html

For the admin part, the only thing Salesman is adding into admin is the Order, as that is the only thing that needs management by default. It can be disabled by setting SALESMAN_ADMIN_REGISTER=False which can be useful in a case where you wish to register your own instead, but still keep the admin module from salesman.

It could maybe be more clear to change the setting name to SALESMAN_ADMIN_REGISTER_ORDER.

Timusan commented 1 year ago

Thank you for the elaborate reply, it's clear now. 👍 And yes, I think renaming the setting to SALESMAN_ADMIN_REGISTER_ORDER might explain its purpose better.