Need help adding a new feature in admin
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!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Need help adding a new feature in admin
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.
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 (49.1 KiB) Viewed 926 times
Re: Need help adding a new feature in admin
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.
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, give us a star
If you like Aimeos, give us a star
Re: Need help adding a new feature in admin
Thank you for your response. Can you help me with an example how to load data in the JQAdm class using Laravel DB Facade?
Re: Need help adding a new feature in admin
Please see here: https://laravel.com/docs/9.x/queries
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Need help adding a new feature in admin
Thank you, I finally able to show the data on the page.