AbanteCart Community

AbanteCart Development => Customization help => Topic started by: enochsuthers on January 06, 2017, 07:55:28 AM

Title: Showing Item Manufacturer on Homepage
Post by: enochsuthers on January 06, 2017, 07:55:28 AM
I am having an issue trying to show the Manufacturer of each item on the home page.

In the product_list I added echo $item['manufacturer'] but nothing shows up, following the example of other pages using $manufacturer and $text_manufacturer do not bring the desired effect either.

I have been struggling with this for a few days now

worldbeautyquest.com

Title: Re: Showing Item Manufacturer on Homepage
Post by: enochsuthers on January 11, 2017, 07:50:15 PM
Gentle Bump
Title: Re: Showing Item Manufacturer on Homepage
Post by: hus2020 on January 25, 2017, 04:00:23 AM
Quote from: enochsuthers on January 06, 2017, 07:55:28 AM
I am having an issue trying to show the Manufacturer of each item on the home page.

In the product_list I added echo $item['manufacturer'] but nothing shows up, following the example of other pages using $manufacturer and $text_manufacturer do not bring the desired effect either.

I have been struggling with this for a few days now

worldbeautyquest.com

Hi looks like you were able to add the manufacturer name on your products. Can you advice what change u did to the file. Thanks

Title: Re: Showing Item Manufacturer on Homepage
Post by: abantecart on January 25, 2017, 01:40:18 PM
Let me go with an example of featured block. Others will be similar.

Controller:
https://github.com/abantecart/abantecart-src/blob/master/public_html/storefront/controller/blocks/featured.php
Line: 47

Here you get array of featured items based on limit set in settings.
If you look at the model method getfeaturedProducts() there is no join with manufacture table.
https://github.com/abantecart/abantecart-src/blob/master/public_html/storefront/model/catalog/product.php
Line:754

What you need to do is call $this->model_catalog_product->getProduct(...product id...) to get full product details. ['manufacturer'] will be there.
This will need to be inside the foreach loop for the product or outside to get all at once.

To improve performance, you might want to create a better select to get all manufactures for provided products.
Title: Re: Showing Item Manufacturer on Homepage
Post by: hus2020 on January 26, 2017, 08:15:44 PM
Quote from: abantecart on January 25, 2017, 01:40:18 PM
Let me go with an example of featured block. Others will be similar.

Controller:
https://github.com/abantecart/abantecart-src/blob/master/public_html/storefront/controller/blocks/featured.php
Line: 47

Here you get array of featured items based on limit set in settings.
If you look at the model method getfeaturedProducts() there is no join with manufacture table.
https://github.com/abantecart/abantecart-src/blob/master/public_html/storefront/model/catalog/product.php
Line:754

What you need to do is call $this->model_catalog_product->getProduct(...product id...) to get full product details. ['manufacturer'] will be there.
This will need to be inside the foreach loop for the product or outside to get all at once.

To improve performance, you might want to create a better select to get all manufactures for provided products.

Hi,
Can you guide me with the variable name if I want to call and display the store name and store address. I basically want to show store name and store address at the order summary preview. Thanks