Show Delivery Price on Product View

  • Posts: 214
  • Thank you received: 1
11 years 2 weeks ago #132181

Hi Guys,

I've got a question for my website www.craftkeg.com/index.php/all-products

I would like to show the Brewers of the products on my products page. So the Breweries are set up as catergories, so my question is can I add a certain Category to the products listing?

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
11 years 2 weeks ago #132194

Hi,

I'll need more information about what your really want to do, and of where do you exactly want to add the products of your "Brewers" category through some screenshots for example.

Please Log in or Create an account to join the conversation.

  • Posts: 214
  • Thank you received: 1
11 years 2 weeks ago #132205

Hi Mohamed,

Attached is a rough idea of what I'm looking to achieve,





Each product already has a brewery category attached so people can choose to filter by brewery, but it would be good to have that information if someone is using the View all Products option. Hope I'm making myself clear.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 2 weeks ago #132233

Hi,

You can create custom fields in the table "product", set the name as "Brewer". Then in the product edition page, enter the brewery of the product in this custom field.

And finally in the options of your menu/module display the custom fields to have the brewery displayed in the products listing.

Else you can edit the view "product / listing_img_title" to display the category of the product, but it require php skills.

Please Log in or Create an account to join the conversation.

  • Posts: 214
  • Thank you received: 1
11 years 2 weeks ago #132248

Hi Xavier,

Thanks for that, I've added it into the table and set the menu to display custom filters (I assume that is what I should be doing). However the only place it appears to show is in the product page itself, not in the listing...

www.craftkeg.com/index.php/all-products/...ct/375-anarchy-lager

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 2 weeks ago #132371

Hi,

Yes you're right, my mistake the custom field of the product table are not displayed in the listing, so you have to edit the view "product / listing_img_title" via the menu Display > Views and add the code:

echo 'Brewer: '.$this->row->YOUR_CUSTOM_FIELD_ALIAS;

Please Log in or Create an account to join the conversation.

  • Posts: 214
  • Thank you received: 1
11 years 2 weeks ago #132400

Thanks Xavier,

So I've got the current code in my "product / listing_img_title"

<p><strong>Container: </strong><?php $class = hikashop_get('class.category');
$manufacturer = $class->get($this->row->product_manufacturer_id);
echo $manufacturer->category_name; ?></p>

<p><strong>Brewer: </strong><?php echo 'Brewer: '.$this->row->YOUR_CUSTOM_FIELD_ALIAS; ?></p>

and I get this result - www.craftkeg.com/index.php/all-products/.../127-anarchy-brew-co (please not I've only updated Anarchy Lager so far)

This is my configuration in the backend...



Your help is greatly appreciated.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
11 years 2 weeks ago #132432

You should try it with this code :

<p><strong>Container: </strong><?php $class = hikashop_get('class.category');
$manufacturer = $class->get($this->row->product_manufacturer_id);
echo $manufacturer->category_name; ?></p>

<p><strong>Brewer: </strong><?php echo $this->row->brewer; ?></p>

Please Log in or Create an account to join the conversation.

  • Posts: 214
  • Thank you received: 1
11 years 2 weeks ago #132446

That has worked perfectly, thank you both!

Let me just say that the help I and other users on this forum receive from you guys is always top notch!

Please Log in or Create an account to join the conversation.

Time to create page: 0.101 seconds
Powered by Kunena Forum