Explanation of aimeos package source code

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
nguyen.phung
Posts: 2
Joined: 24 Jun 2019, 20:42

Explanation of aimeos package source code

Post by nguyen.phung » 18 Aug 2019, 23:21

I found there are a lot of aimeos documents but I cannot find the one will help me to understand easily aimeos package.
Please let me know if there is any documentation on the explanation of aimeos package source code such as which file do what.
I think it will save a lot of time for a new aimeos programmer.
Thank you very much in advance.
Mauphung

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

Re: Explanation of aimeos package source code

Post by aimeos » 19 Aug 2019, 13:53

A good start is the architectural model of Aimeos:
https://aimeos.org/docs/Developers/Software_stack
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

nguyen.phung
Posts: 2
Joined: 24 Jun 2019, 20:42

Re: Explanation of aimeos package source code

Post by nguyen.phung » 20 Aug 2019, 13:51

Thank you for your response. I’m Aimeos newbie. I try to build an example with the following steps:
1. Install latest Laravel 5.8.*

2. Install Aimeos package
Laravel e-commerce package for professional, ultra fast online shops, complex B2B applications and #gigacommerce https://aimeos.org/Laravel
https://github.com/aimeos/aimeos-laravel

3. I run server and access to /shop, it's OK

4. I want to create myshop and access with URI /myshop by doing following steps:

4.1 In config/shop.php, I add the indexes to get the html from my ExampleController to my view myshop.blade.php

'page' => [
'myshop' => array('basket/mini', 'catalog/filter', 'catalog/lists'),

4.2 In my ExampleController, I add myshop method:

class ExampleController extends Controller
{
public function mobishop()
{
foreach( app( 'config' )->get( 'shop.page.mobishop' ) as $name )
{
$params['msheader'][$name] = Shop::get( $name )->getHeader();
$params['msbody'][$name] = Shop::get( $name )->getBody();
}
// do some more stuff
return \View::make('mobishop', $params);
}

4.3 In my routes\web.php, I add a route “/myshop”

Route::get('/myshop', 'ExampleController@myshop')→name('myshop');

4.4 I create my view resources\views\myshop.blade.php to display html data get from my ExampleController:

@extends('shop::base')

@section('aimeos_header')
<?= $msheader['basket/mini'] ?>
<?= $msheader['catalog/filter'] ?>
<?= $msheader['catalog/lists'] ?>
@stop

@section('aimeos_head')
<?= $msbody['basket/mini'] ?>
@stop

@section('aimeos_nav')
<?= $msbody['catalog/filter'] ?>
@stop

@section('aimeos_body')
<?= $msbody['catalog/lists'] ?>
@stop

4.5 I access /myshop and I get myshop page on screen. It's OK.

4.6 When I click on first product item, it display the detail of a selected product with URL:
http://localhost:8000/shop/Demo_article/0

I check in a folder vendor\aimeos\aimeos-laravel\src\Aimeos\Shop\Controller, I don’t see a Controller of Demo_article and I cannot find it anywhere in the aimeos package.

My questions are followings:
1/ Where can I find Aimeos Demo in Aimeos package? And how to pass the item id?

2/ Do I need to install these two additional packages Aimeos frontend controller and Aimeos e-commerce HTML client components?

Aimeos frontend controller
https://github.com/aimeos/ai-controller-frontend

Aimeos e-commerce HTML client components
https://github.com/aimeos/ai-controller-frontend

3/Is there any tutorial showing how to program build the Laravel application with Aimeos package, Step-by-Step approach with the examples?

Thank you in advance for your response.

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

Re: Explanation of aimeos package source code

Post by aimeos » 21 Aug 2019, 07:30

nguyen.phung wrote: 20 Aug 2019, 13:51 4.6 When I click on first product item, it display the detail of a selected product with URL:
http://localhost:8000/shop/Demo_article/0

My questions are followings:
1/ Where can I find Aimeos Demo in Aimeos package? And how to pass the item id?
This are virtual URLs that contain the product name which is used to resolve the product and show the details.

If you only want to use "/myshop" instead of "/shop", you can change the route prefix in your ./config/shop.php ("routes" section):

Code: Select all

'default' => ['prefix' => 'myshop', 'middleware' => ['web']],
nguyen.phung wrote: 20 Aug 2019, 13:51 2/ Do I need to install these two additional packages Aimeos frontend controller and Aimeos e-commerce HTML client components?

Aimeos frontend controller
https://github.com/aimeos/ai-controller-frontend

Aimeos e-commerce HTML client components
https://github.com/aimeos/ai-controller-frontend
No, they are automatically installed. You can see them if you run "composer show"
nguyen.phung wrote: 20 Aug 2019, 13:51 3/Is there any tutorial showing how to program build the Laravel application with Aimeos package, Step-by-Step approach with the examples?
This page contains more or less a list of articles to install, configure and extend your Aimeos installation step-by-step:
https://aimeos.org/docs/Laravel
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply