Customizations basics for Laravel

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!
roby
Posts: 7
Joined: 18 Jul 2023, 07:53

Customizations basics for Laravel

Post by roby » 18 Jul 2023, 08:01

HI,
I just downloaded Aimeos, I looked at the frontend and backend to find and I started reading the manual and it seems to me a tool with truly remarkable potential.

I only did the basic install (composer create-project aimeos/aimeos myshop) and even here I have a doubt: is this the right way to start developing a new site? I have to keep this site as a 'base' and then develop an extension, is that correct?

Now I'm trying to figure out how:
- add new pages to the backend (and frontend), integrating them with existing ones
- edit existing pages in the backend (and frontend)
- add asynchronous calls to external web services when opening the product detail page and when ordering.

Can anyone point me in the right direction? I'm not asking for the code, I just need to figure out what the right approach is.

Thank you

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

Re: Customizations basics for Laravel

Post by aimeos » 18 Jul 2023, 11:56

roby wrote: 18 Jul 2023, 08:01 I only did the basic install (composer create-project aimeos/aimeos myshop) and even here I have a doubt: is this the right way to start developing a new site? I have to keep this site as a 'base' and then develop an extension, is that correct?
It's the simplest way if you don't already have an existing Laravel application. If you already have, use the Aimeos Laravel package to add e-commerce to your application: https://github.com/aimeos/aimeos-laravel
In that case, you have to care about a few things yourself like authentication setup, etc.
roby wrote: 18 Jul 2023, 08:01 - add new pages to the backend (and frontend), integrating them with existing ones
- edit existing pages in the backend (and frontend)
Frontend:
https://aimeos.org/docs/latest/laravel/extend/

Backend:
https://aimeos.org/docs/latest/admin/jq ... nt-panels/ (and further articles within the JQAdm section)
roby wrote: 18 Jul 2023, 08:01 - add asynchronous calls to external web services when opening the product detail page and when ordering.
Create a decorator for the existing components to execute you own code:
https://aimeos.org/docs/latest/frontend ... omponents/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

roby
Posts: 7
Joined: 18 Jul 2023, 07:53

Re: Customizations basics for Laravel

Post by roby » 18 Jul 2023, 12:26

Thank you :-)

roby
Posts: 7
Joined: 18 Jul 2023, 07:53

Re: Customizations basics for Laravel

Post by roby » 18 Jul 2023, 12:37

Hi, reading the Extend section of the Aimeos manual (https://aimeos.org/docs/latest/laravel/extend/) I found a link to src/views (https://github.com/aimeos/aimeos- laravel /tree/master/src/views) but it's a broken link (maybe it should be fixed)... the correct destination url is https://github.com/aimeos/aimeos-larave ... ster/views ?

roby
Posts: 7
Joined: 18 Jul 2023, 07:53

Re: Customizations basics for Laravel

Post by roby » 18 Jul 2023, 13:35

I have another question:

I created two extensions to start working on my site: an "Aimeos 2023.x extension" and a "Laravel 2023.x theme extension".
Is this the right approach? The first is intended for generic customizations and the second for theme customizations or did I get it wrong?

Anyway, I installed the first one without problems but when I tried to install the theme extension, I got an error:
"In line PackageDiscoveryTrait.php 368:
Could not find a matching version of the aimeos-extensions/mm-drpsh-theme package. Check the spelling of the package, your version constraint, and that the package is available in a stability that matches your minimum stability (dev). "

I double checked: the version I selected in https://aimeos.org/extensions seems to be correct, since in my project there is aimeos/aimeos-laravel 2023.07.1

Where am I doing wrong?

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

Re: Customizations basics for Laravel

Post by aimeos » 19 Jul 2023, 08:09

roby wrote: 18 Jul 2023, 12:37 Hi, reading the Extend section of the Aimeos manual (https://aimeos.org/docs/latest/laravel/extend/) I found a link to src/views (https://github.com/aimeos/aimeos- laravel /tree/master/src/views) but it's a broken link (maybe it should be fixed)... the correct destination url is https://github.com/aimeos/aimeos-larave ... ster/views ?
Thanks, the link has been fixed now :-)
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

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

Re: Customizations basics for Laravel

Post by aimeos » 19 Jul 2023, 08:15

roby wrote: 18 Jul 2023, 13:35 Anyway, I installed the first one without problems but when I tried to install the theme extension, I got an error:
"In line PackageDiscoveryTrait.php 368:
Could not find a matching version of the aimeos-extensions/mm-drpsh-theme package. Check the spelling of the package, your version constraint, and that the package is available in a stability that matches your minimum stability (dev). "
The two packages use two different vendor names and you can install them using:

Code: Select all

# Extension:
composer req aimeos-extensions/mm-extension

# Theme:
composer req aimeos-themes/mm-drpsh-theme
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

roby
Posts: 7
Joined: 18 Jul 2023, 07:53

Re: Customizations basics for Laravel

Post by roby » 19 Jul 2023, 10:00

ok, thank you!

roby
Posts: 7
Joined: 18 Jul 2023, 07:53

Re: Customizations basics for Laravel

Post by roby » 19 Jul 2023, 14:37

Can you kindly give me some more information about decorators?

I need to understand what are the steps to create a decorator and to use it.

I'm trying to figure it out from the manual but I'm having some trouble finding what I need.

I would like to create a site for dropshipping sales, therefore the warehouse will not be internal and, when opening the product detail page, I must make a call to a web service which will contain the warehouse availability and updated prices.
After I get the answer, I will have to show that data on the product detail page.

Is a decorator what I need?

Could you tell me what are the steps to create and use it? At least to be able to have a starting point...

Thank you

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

Re: Customizations basics for Laravel

Post by aimeos » 20 Jul 2023, 08:43

In that case, try to use asynchronous JS code only to fetch the prices and stock levels if possible and add it to your own theme JS files. Otherwise, there will be a bad user experience because the page won't load until the API returned the data.

If it's not possible to do that with JS code only, create a Laravel controller which fetches the data and call it via asynchronous JS in the detail page where you then update the prices and stock levels.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply