Custom Module
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!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 16
- Joined: 20 Jun 2019, 10:16
Custom Module
Hi Aimeos,
I want to add one custom module with different features simply i want to add home page with dynamic content how can i add that section in my site. i just want learn how you manage to add one page with controllers, classes and his view with data from database as per our need.
Thank you,
Kishan Upadhyay
I want to add one custom module with different features simply i want to add home page with dynamic content how can i add that section in my site. i just want learn how you manage to add one page with controllers, classes and his view with data from database as per our need.
Thank you,
Kishan Upadhyay
Re: Custom Module
In your Laravel Home controller, index action use the Aimeos frontend controller to retrieve the products you want to display:
- https://aimeos.org/docs/Laravel/Extend_Aimeos
- https://github.com/aimeos/ai-controller ... /Iface.php
- https://github.com/aimeos/ai-client-htm ... #L647-L655
For example:
- https://aimeos.org/docs/Laravel/Extend_Aimeos
- https://github.com/aimeos/ai-controller ... /Iface.php
- https://github.com/aimeos/ai-client-htm ... #L647-L655
For example:
Code: Select all
$context = $this->app->make('\Aimeos\Shop\Base\Context')->get();
$cntl = \Aimeos\Controller\Frontend::create( $context, 'product' );
$products = $cntl->uses( ['text', 'price', 'media'] )->category( '<catid>' )->search();
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
-
- Posts: 16
- Joined: 20 Jun 2019, 10:16
Re: Custom Module
Hi Aimeos,
Thank you for your reply it means to lot for me here i have started work as per given instruction but having this error in aimeos version 2018.07 i have attached screenshots of my work. please help me on this.
Thank you,
Kishan Upadhyay
Thank you for your reply it means to lot for me here i have started work as per given instruction but having this error in aimeos version 2018.07 i have attached screenshots of my work. please help me on this.
Thank you,
Kishan Upadhyay
- Attachments
-
- I'm getting error while using this
- Screenshot_3.jpg (86.3 KiB) Viewed 3197 times
-
- my HomeController code
- Screenshot_2.jpg (170.92 KiB) Viewed 3197 times
-
- Error in browser
- Screenshot_1.jpg (179.13 KiB) Viewed 3197 times
Re: Custom Module
Version 2018.07 isn't supported any more and you should use at least 2018.10. If you start from scratch, use 2019.04 or the upcoming 2019.07 because the posted code is for these versions.
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
-
- Posts: 16
- Joined: 20 Jun 2019, 10:16
Re: Custom Module
Hi Aimeos,
Here we are using laravel 5.7 and aimeos version 2018.07. we have also try to install aimeos version 2019.04 but get nothing means it's not working then help me to configure in laravel 5.7 with aimeos 2019.04
Thank You
Kishan Upadhyay
Here we are using laravel 5.7 and aimeos version 2018.07. we have also try to install aimeos version 2019.04 but get nothing means it's not working then help me to configure in laravel 5.7 with aimeos 2019.04
Thank You
Kishan Upadhyay
Re: Custom Module
Upgrade to 2018.10 which should be rather flawless. The 2018.10 version uses the old API:
https://github.com/aimeos/ai-controller ... /Iface.php
https://github.com/aimeos/ai-controller ... /Iface.php
Code: Select all
$context = $this->app->make('\Aimeos\Shop\Base\Context')->get();
$cntl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'product' );
$filter = $cntl->createFilter();
$filter = $cntl->addFilterCategory( $filter, '<catid>' );
$products = $cntl->search( $filter );
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
-
- Posts: 16
- Joined: 20 Jun 2019, 10:16
Re: Custom Module
Hi Aimeos,
I have updated my aimeos version 2018.10 and now i have tried to get things as per your instruction and i get data from your side and have some questions. And i have done code in way is it proper way to do it.
1) How do i get target url of product or category
2) How can i use your class like view.php, Aimeos.php from vendor
Thank you,
Kishan Upadhyay
I have updated my aimeos version 2018.10 and now i have tried to get things as per your instruction and i get data from your side and have some questions. And i have done code in way is it proper way to do it.
1) How do i get target url of product or category
2) How can i use your class like view.php, Aimeos.php from vendor
Thank you,
Kishan Upadhyay
- Attachments
-
- Screenshot_2.jpg (141.97 KiB) Viewed 3158 times
-
- Screenshot_1.jpg (173.42 KiB) Viewed 3158 times
Re: Custom Module
In your existing code where you use $this->config() to get the target, controller, action and url config:
Code: Select all
$url = $this->url( $detailTarget, $detailController, $detailAction, $params, [], $detailConfig );
Code: Select all
$enc = $this->encoder();
$enc->attr( $url );
Code: Select all
$enc->attr( $this->content( $mediaItem->getPreview() ) );
Don't know what you mean.kishanbupadhyaya wrote: ↑05 Jul 2019, 07:32 2) How can i use your class like view.php, Aimeos.php from vendor
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
-
- Posts: 16
- Joined: 20 Jun 2019, 10:16
Re: Custom Module
Hi Aimeos,
As per your instruction i have try to get url from category list but go this error.
Thank you,
Kishan Upadhyay
As per your instruction i have try to get url from category list but go this error.
Thank you,
Kishan Upadhyay
- Attachments
-
- Screenshot_3.jpg (97.02 KiB) Viewed 3135 times
-
- Screenshot_2.jpg (247.08 KiB) Viewed 3138 times
-
- Screenshot_1.jpg (243.81 KiB) Viewed 3138 times
Re: Custom Module
If you want to use Blade templates, please read this article:
https://aimeos.org/docs/Laravel/Use_Blade_templates
Generate URLs by using the Laravel route() method.
https://aimeos.org/docs/Laravel/Use_Blade_templates
Generate URLs by using the Laravel route() 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