News:

AbanteCart v1.4.2 is released.

Main Menu

Showing Item Manufacturer on Homepage

Started by enochsuthers, January 06, 2017, 07:55:28 AM

Previous topic - Next topic

enochsuthers

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



hus2020

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


abantecart

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.

hus2020

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

Forum Rules Code of conduct
AbanteCart.com 2010 -