How to customize Aimeos Shop App

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!
haha
Posts: 3
Joined: 30 Mar 2022, 05:52

How to customize Aimeos Shop App

Post by haha » 30 Mar 2022, 16:26

Hi,
I am new to the aimeos package and laravel-php.
I have set up the full shop application and have been trying to change things to reflect the changes on the frontend.

If I change the code in this file,
vendor/aimeos/ai-client-html/client/html/templates/catalog/home/body-standard.php

It doesn't reflect on the catalog-home section of the website.

I tried to look at the routes in web.php file. As the '/' endpoint uses the CatalogController, I tried to view that. Didn't understand the stuff that the HomeAction function does (I didn't understand these terms like container, view and html client etc.).

The home.blade.php is also confusing me as the params array is layed out there.

What I got from laravel tutorials is, you can put html code in a blade file where other blade files can be imported using section, yield etc. But the code structure in aimeos is totally different.

I'd highly appreaciate it if someone guides me in the right direction (i.e. what to learn to understand the package etc.).

Basically, my plan is to customize the package and build an ecommerce out of it.

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

Re: How to customize Aimeos Shop App

Post by aimeos » 31 Mar 2022, 07:02

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

haha
Posts: 3
Joined: 30 Mar 2022, 05:52

Re: How to customize Aimeos Shop App

Post by haha » 31 Mar 2022, 09:03

Hi, thanks for getting back. I tried to read through some of the material that was pointed in your reply but I still don't understand well enough as I am new to development.

Can you like give me an idea of how to change the logo or something of the homepage?

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

Re: How to customize Aimeos Shop App

Post by aimeos » 01 Apr 2022, 06:36

You can change the logo by uploading your own one in the Configuration > Settings panel of the Aimeos admin backend.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

haha
Posts: 3
Joined: 30 Mar 2022, 05:52

Re: How to customize Aimeos Shop App

Post by haha » 01 Apr 2022, 12:18

Thanks for replying. What I meant was, how to change something in the code so that it is reflected on the shop pages.
I disabled caching and created an extension. Copied over the ai-client template files and try to change the code inside it, but it doesn't change the site.

When '/' endpoint is accessed, the homeAction() method is called from the CatalogController.php.
This method returns home.blade.php.
I don't understand what these lines in the homeAction() method are doing,

Code: Select all

		foreach( app( 'config' )->get( 'shop.page.catalog-home' ) as $name )
		{
			$params['aiheader'][$name] = Shop::get( $name )->getHeader();
			$params['aibody'][$name] = Shop::get( $name )->getBody();
		}
I don't think they are fetching template files as from the stuff I read it seems like they are fetching views. But I only understand blade files and template files as views, I don't understand what type of view is accessed here.
Also, how does calling app( 'config' )->get( 'shop.page.catalog-home' ) directly reach the shop.php file and give us the array corresponding to catalog-home key in the pages array?

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

Re: How to customize Aimeos Shop App

Post by aimeos » 04 Apr 2022, 09:44

haha wrote: 01 Apr 2022, 12:18 Thanks for replying. What I meant was, how to change something in the code so that it is reflected on the shop pages.
I disabled caching and created an extension. Copied over the ai-client template files and try to change the code inside it, but it doesn't change the site.
Did you use the same directory structure for the templates as in the ai-client-html package? This is important so your new templates are found. Also, only copy those templates, you really need to adapt because otherwise, you don't get bugfixes related to templates.
haha wrote: 01 Apr 2022, 12:18 When '/' endpoint is accessed, the homeAction() method is called from the CatalogController.php.
This method returns home.blade.php.
I don't understand what these lines in the homeAction() method are doing,

Code: Select all

		foreach( app( 'config' )->get( 'shop.page.catalog-home' ) as $name )
		{
			$params['aiheader'][$name] = Shop::get( $name )->getHeader();
			$params['aibody'][$name] = Shop::get( $name )->getBody();
		}
I don't think they are fetching template files as from the stuff I read it seems like they are fetching views. But I only understand blade files and template files as views, I don't understand what type of view is accessed here.
They use the Shop facade of the Aimeos Laravel package to retrieve the rendered HTML of the components for the HTML header and body. The HTML is rendered according to the templates mentioned before.
haha wrote: 01 Apr 2022, 12:18 Also, how does calling app( 'config' )->get( 'shop.page.catalog-home' ) directly reach the shop.php file and give us the array corresponding to catalog-home key in the pages array?
That's due to the implementation of Laravel Config, which uses the first part as file name from the ./config/ directory and the rest as keys for the array within.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply