Author Topic: [Solved]How to display manufacturer name on browse page ?  (Read 23844 times)

blade97

  • Guest
[Solved]How to display manufacturer name on browse page ?
« on: May 11, 2008, 17:59:05 pm »
Hi, I try to manage displaying manufacturer name on browse page.

first I import the variable into shop.browse.php
$manufacturer_name = $ps_product->get_mf_name($product_id);
$tpl->set( 'manufacturer_name', $manufacturer_name );

and then echo $manufacturer_name on browse_1.php

But, it didn't worked. Please help, thanks.

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27502
  • Always on vacation
    • Jenkin Hill Internet
Re: How to display manufacturer name on browse page ?
« Reply #1 on: May 11, 2008, 20:53:55 pm »
The manufacturer variable is not available normally to the browse templates. If you can get the variable from shop.browse.php then you should be able to show it in the template.

See the developer manual
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.6.1.10121 on Joomla 3.9.11 PHP 7.0.33
Testing 3.6.1.10129 on Joomla 3.9.11

blade97

  • Guest
Re: How to display manufacturer name on browse page ?
« Reply #2 on: May 12, 2008, 06:55:15 am »
The manufacturer variable is not available normally to the browse templates. If you can get the variable from shop.browse.php then you should be able to show it in the template.

See the developer manual

I'm following the developer manual by importing using $tpl->set( 'manufacturer_name', $manufacturer_name );
but it didn't worked.

the code I add to shop.browse.php:
$manufacturer_name = $ps_product->get_mf_name($product_id);
$tpl->set( 'manufacturer_name', $manufacturer_name );

Please give me the correct code.

willowtree

  • Full Member
  • ***
  • Posts: 542
    • Willow Tree Crafts
Re: How to display manufacturer name on browse page ?
« Reply #3 on: May 12, 2008, 09:07:35 am »
it could well be that manufacturer_name is not selected from the database, you will need to check the query in the file to see if the data is there to be used in the template.
Please add your VM and Joomla Version to your signature to make it easier to help you:

Most of my code posted in the forum is for VirtueMart 1.0  -  not for 1.1

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27502
  • Always on vacation
    • Jenkin Hill Internet
Re: How to display manufacturer name on browse page ?
« Reply #4 on: May 12, 2008, 11:19:42 am »
You will also have to edit shop_browse_queries.php to retrieve the manufacturer from the database.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.6.1.10121 on Joomla 3.9.11 PHP 7.0.33
Testing 3.6.1.10129 on Joomla 3.9.11

blade97

  • Guest
Re: How to display manufacturer name on browse page ?
« Reply #5 on: May 12, 2008, 17:33:40 pm »
[SOLVED] $db_browse->f("product_id") is the right code.

celine1988

  • Beginner
  • *
  • Posts: 2
    • My portfolio site
Re: [Solved]How to display manufacturer name on browse page ?
« Reply #6 on: May 15, 2008, 08:52:56 am »
Could you explain me how you solved it? Im trying for a couple of days to get the same results but it doesnt work.
sorry for my english

You will also have to edit shop_browse_queries.php to retrieve the manufacturer from the database.

can you explain that part?

Helius

  • Beginner
  • *
  • Posts: 10
Re: [Solved]How to display manufacturer name on browse page ?
« Reply #7 on: May 22, 2008, 17:22:21 pm »
Can anybody explain the solution please?

Thanks.

pcinvent

  • Beginner
  • *
  • Posts: 19
    • PCinvent Studio
Re: [Solved]How to display manufacturer name on browse page ?
« Reply #8 on: June 17, 2008, 07:51:09 am »
[SOLVED] $db_browse->f("product_id") is the right code.

Hi, blade,
Could you explain more how you solve it, thanks a lot!

testingaja

  • Beginner
  • *
  • Posts: 13
Re: [Solved]How to display manufacturer name on browse page ?
« Reply #9 on: June 18, 2008, 17:31:25 pm »
Can someone explained with example in detail how to show it ? or how to order by / sort by manufacturer name as the previous version of virtuemart... thx... need Help on this one...

mhit

  • Beginner
  • *
  • Posts: 1
Re: [Solved]How to display manufacturer name on browse page ?
« Reply #10 on: June 24, 2008, 14:53:17 pm »
This works for me in VirtueMart 1.0.15:

In shop.browse.php  :

Before the line: /*** Add-to-Cart Button ***/
Add:
$mf_name = $ps_product->get_mf_name( $db_browse->f('product_id') );

After the line: $product_cell = str_replace( "{product_sku}", $db_browse->f("product_sku"), $product_cell );
Add:
$product_cell = str_replace( "{manufacturer_name}", $mf_name, $product_cell );

then in the browse page you can use this variable: {manufacturer_name}

And this works in VirtueMart 1.1.1 :

Before the line: /*** Add-to-Cart Button ***/
Add:
$mf_name = $ps_product->get_mf_name( $db_browse->f('product_id') );
$tpl->set('mf_name',$mf_name);

then in the browse page you can use this variable: $mf_name
for example:
<?php echo $mf_name; ?>

Good luck!

MAD

  • Beginner
  • *
  • Posts: 5
Re: [Solved]How to display manufacturer name on browse page ?
« Reply #11 on: September 08, 2008, 02:46:02 am »
hello,
this solution don't work with virtuemart 1.1.2 ??

I obtain the same manufacturers for all products of category?!

Please help, thanks.

angus2kro

  • Beginner
  • *
  • Posts: 2
Re: [Solved]How to display manufacturer name on browse page ?
« Reply #12 on: September 08, 2008, 20:37:12 pm »
Hi!
I have the same problem in VM 1.1.2.
Can anybody help?

Thanks.

angus2kro

  • Beginner
  • *
  • Posts: 2
Re: [Solved]How to display manufacturer name on browse page ?
« Reply #13 on: September 09, 2008, 12:55:33 pm »
I found the solution on http://www.pcinvent.info/technology/programming/how-to-hack-manufacture-name-in-virtuemart-browse-page-template .
Put this code before " } // END OF while loop: "

$products[$i]['mf_name'] = $mf_name;

 bye

MAD

  • Beginner
  • *
  • Posts: 5
Re: [Solved]How to display manufacturer name on browse page ?
« Reply #14 on: September 09, 2008, 22:49:08 pm »
Excellent,this work!

Thanks! ;)