Need help adding a new feature in admin

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
pandegaf
Posts: 3
Joined: 02 Apr 2022, 12:57

Need help adding a new feature in admin

Post by pandegaf » 01 Jul 2022, 07:00

Hello, let me explain the problem I encounter.

In the project I'm currently working on, I need to add a membership points based on customer's receipt (the transaction is handled offline). So I already make a proof-of-concept using Laravel Controller for me to check from API (front-end is mobile app), and it works.

The receipt is saved on a table called receipts, and point is saved on a table called user_points. If receipt is approved, a new record will be added on the points table indicating a user has a new + points with reference to which receipt the points came from.

Problem is, for points to be valid, admin has to verify the record in the database (change status from pending to approved or rejected). Similar logic to any other elements in aimeos (such as products, product items has their own status).
I have made a new panel (is that correct?) that supposed to be where admin view and verify the points data, and I tried following the guide about managers from the docs (which I find it hard to understand, :?: ). Now I get this error (attached), and I cannot find how to make the manager factory.

Edit: Added the system info
Aimeos Version 2022.04.4, Laravel version 9.2, PHP 8.1.7, Dev Environment on Windows 10 x64

Any pointers/guide will be appreciated.
Attachments
image(5).png
image(5).png (49.1 KiB) Viewed 926 times

User avatar
aimeos
Administrator
Posts: 7896
Joined: 01 Jan 1970, 00:00

Re: Need help adding a new feature in admin

Post by aimeos » 01 Jul 2022, 11:37

The simplest way is to use the Laravel DB facade in your JQAdm class to retrieve and store the records from the users_points table.

If you don't want to depend on Laravel, you can create a new item, manager and factory for your new data domain (the user points) by copying the code from an existing domain and adapt it to your new data domain. You can use the "review" domain as reference for example:
https://github.com/aimeos/aimeos-core/t ... hop/Review

In 2022.07+ there will be no need for a factory any more because all managers can be created by the \Aimeos\MShop::create() method.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

pandegaf
Posts: 3
Joined: 02 Apr 2022, 12:57

Re: Need help adding a new feature in admin

Post by pandegaf » 04 Jul 2022, 05:37

Thank you for your response. Can you help me with an example how to load data in the JQAdm class using Laravel DB Facade?

User avatar
aimeos
Administrator
Posts: 7896
Joined: 01 Jan 1970, 00:00

Re: Need help adding a new feature in admin

Post by aimeos » 04 Jul 2022, 14:03

Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

pandegaf
Posts: 3
Joined: 02 Apr 2022, 12:57

Re: Need help adding a new feature in admin

Post by pandegaf » 06 Jul 2022, 02:01

Thank you, I finally able to show the data on the page.

Post Reply