Fetch products on homepage
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!
Fetch products on homepage
We are using aimeos laravel package and we want to fetch all products and products by category on front page. Currently we are fetching products on category page like this: https://demo.com/{category}/{category_id}
Re: Fetch products on homepage
The default output of the list view (without any parameters) lists all products. You only have to add that component to your home page: https://aimeos.org/docs/Laravel/Create_new_pages
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: Fetch products on homepage
I have got the product data like this.
Standard {#2375 ▼
-values: array:16 [▼
"product.id" => "14"
"product.siteid" => "1"
"product.typeid" => "1"
"product.code" => "demo 123 article"
"product.label" => "Demo article new"
"product.config" => []
"product.datestart" => null
"product.dateend" => null
"product.status" => "1"
"product.ctime" => "2018-05-27 11:21:02"
"product.mtime" => "2018-06-21 14:09:40"
"product.editor" => "demo@gmail.com"
"product.target" => ""
"product.type" => "default"
"product.typename" => "Article"
"date" => "2018-12-28 08:14:00"
]
-propItems: []
-refItems: array:3 [▶]
-listItems: array:3 [▶]
-prepared: false
-bdata: array:16 [▶]
-prefix: "product."
-available: true
-modified: false
}
How i can get product target link to navigate to product page?
Standard {#2375 ▼
-values: array:16 [▼
"product.id" => "14"
"product.siteid" => "1"
"product.typeid" => "1"
"product.code" => "demo 123 article"
"product.label" => "Demo article new"
"product.config" => []
"product.datestart" => null
"product.dateend" => null
"product.status" => "1"
"product.ctime" => "2018-05-27 11:21:02"
"product.mtime" => "2018-06-21 14:09:40"
"product.editor" => "demo@gmail.com"
"product.target" => ""
"product.type" => "default"
"product.typename" => "Article"
"date" => "2018-12-28 08:14:00"
]
-propItems: []
-refItems: array:3 [▶]
-listItems: array:3 [▶]
-prepared: false
-bdata: array:16 [▶]
-prefix: "product."
-available: true
-modified: false
}
How i can get product target link to navigate to product page?
Re: Fetch products on homepage
And also how we can get category which we assigned to the product?
Last edited by umair040 on 28 Dec 2018, 08:33, edited 1 time in total.
Re: Fetch products on homepage
Here you can see how to can retrieve the config for the detail target page:
https://github.com/aimeos/ai-client-htm ... rd.php#L48
Use the "$this->url()" view helper to build the link
https://github.com/aimeos/ai-client-htm ... rd.php#L48
Use the "$this->url()" view helper to build the link
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: Fetch products on homepage
Products can be in several categories. You should pass the f_catid parameter to know from which category the user is coming from.
If you want to display the categories along with the products, you can extend the HTML client to fetch the relations between categories and products.
If you want to display the categories along with the products, you can extend the HTML client to fetch the relations between categories and products.
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