Author Topic: [solved]Modification to manufacturer browse page-help?  (Read 7475 times)

grayceworks

  • Jr. Member
  • **
  • Posts: 73
[solved]Modification to manufacturer browse page-help?
« on: November 26, 2008, 09:21:05 am »
Solution: See following posts/replies for VM 1.1.2, or upgrade to 1.1.3, where it's already fixed.

I am trying to make the manufacturer browse page to show the manufacturer description in addition to the products by that manufacturer.

Currently it only shows the manufacturer name and products.

Basically, I have this page, which has the manufacturer info:
index.php?page=shop.manufacturer_page&manufacturer_id=2&option=com_virtuemart

And I have this page, which has all the products by that manufacturer:
index.php?page=shop.browse&manufacturer_id=2&option=com_virtuemart
 

I want the info on the products listing page.

I tried adding the following code, which is what seemed to make sense, to:

components/com_virtuemart/themes/default/templates/browse/browse_header_manufactuer.tpl.php

original code:
Code: [Select]
<h3><?php echo $browsepage_lbl ?></h3>
<div class="browseDesc"><?php echo $browsepage_lbltext ?></div>

modified code which i found in the code for the manufacturer info page:

Code: [Select]
<h3><?php echo $browsepage_lbl ?></h3>
<div class="browseDesc"><?php echo $browsepage_lbltext ?>
<br /><?php echo $mf_desc ?><br /></div>

BUT, it still won't echo the description. Why not? Should I be making the change somewhere else?

Actually, it won't pull any of the values from the manufacturer's info page into the browse page. Why is this? Shouldn't it be able to get those values no matter what page it's on?

I tried taking the table directly from the manufacturer info page and putting into the manufacturer browse heading, and it made no difference, except that it recognized and output the labels for the info, just didn't output the info itself. Is this a bug or something?

It won't recognize $mf_desc, $mf_name, $mf_email, etc, when you try to add that info into another page.

And can this be a feature in upcoming versions? Because it would be really helpful to have the manufacturer description right on the page where their products are listed, instead of a separate popup window. Thanks for any input!
searching for solutions
====================================
Joomla 1.5.9
VirtueMart 1.1.3
Linux/Apache|PHP5|mySQL5
Firefox 3.0.6 | Internet Exploder 7 
Windoze XP sp3 | Suse 10

MikeUK

  • Global Moderator
  • Full Member
  • *
  • Posts: 1344
Re: Modification to manufacturer browse page
« Reply #1 on: November 26, 2008, 23:26:20 pm »
You could post this idea in the feature request thread.

Regarding the variables, remember these are only template files. The variables each use are defined in the main file (located in the administrator/components/com_virtuemart/html/ directory).

So in this case the browse template file will know the variables defined in shop.browse.php. That's where you need to include the extra info for the manufacturer.
Get answers faster:

I can build your online shop, setup or customize Virtuemart or help your existing shop maximize its potential. Email / PM for info

grayceworks

  • Jr. Member
  • **
  • Posts: 73
Re: Modification to manufacturer browse page
« Reply #2 on: November 27, 2008, 01:31:50 am »
What is the name of the main file in that directory? I don't see anything in there resembling what you're talking about. And there's no shop.browse.php in my html folder. Actually, I haven't been able to find that anywhere. Is that a dynamically created file? I'm lost :(
searching for solutions
====================================
Joomla 1.5.9
VirtueMart 1.1.3
Linux/Apache|PHP5|mySQL5
Firefox 3.0.6 | Internet Exploder 7 
Windoze XP sp3 | Suse 10

MikeUK

  • Global Moderator
  • Full Member
  • *
  • Posts: 1344
Re: Modification to manufacturer browse page
« Reply #3 on: November 27, 2008, 10:53:41 am »
You need to look again.

You certainly do have that file, because the link you gave before shows it:

Quote
And I have this page, which has all the products by that manufacturer:
index.php?page=shop.browse&manufacturer_id=2&option=com_virtuemart

It must be in administrator/components/com_virtuemart/html/ directory

If it wasn't there you wouldn't see the product browse page.
Get answers faster:

I can build your online shop, setup or customize Virtuemart or help your existing shop maximize its potential. Email / PM for info

grayceworks

  • Jr. Member
  • **
  • Posts: 73
Re: Modification to manufacturer browse page
« Reply #4 on: November 29, 2008, 00:05:22 am »
Hmm... It appears the ftp client I was using wasn't listing all files for some reason. I changed ftp clients and found it.

Ok, I found this code in the shop.browse file. It appears that it's already set up to show the manufacturer description by default. So I don't understand why it isn't happening?

Code: [Select]
elseif( $manufacturer_id) {
$db->query( "SELECT manufacturer_id, mf_name FROM #__{vm}_manufacturer WHERE manufacturer_id='$manufacturer_id'");
$db->next_record();
$mainframe->setPageTitle( $db->f("mf_name") );

$browsepage_lbl = shopMakeHtmlSafe( $db->f("mf_name") );
$tpl->set( 'browsepage_lbl', $browsepage_lbl );
$browsepage_lbltext = $db->f("mf_desc");
$tpl->set( 'browsepage_lbltext', $browsepage_lbltext );
$browsepage_header = $tpl->fetch( 'browse/includes/browse_header_manufacturer.tpl.php' );
searching for solutions
====================================
Joomla 1.5.9
VirtueMart 1.1.3
Linux/Apache|PHP5|mySQL5
Firefox 3.0.6 | Internet Exploder 7 
Windoze XP sp3 | Suse 10

MikeUK

  • Global Moderator
  • Full Member
  • *
  • Posts: 1344
Re: Modification to manufacturer browse page
« Reply #5 on: November 29, 2008, 16:57:28 pm »
Hmm... It appears the ftp client I was using wasn't listing all files for some reason. I changed ftp clients and found it.

Ok, I found this code in the shop.browse file. It appears that it's already set up to show the manufacturer description by default. So I don't understand why it isn't happening?

Code: [Select]
elseif( $manufacturer_id) {
$db->query( "SELECT manufacturer_id, mf_name FROM #__{vm}_manufacturer WHERE manufacturer_id='$manufacturer_id'");
$db->next_record();
$mainframe->setPageTitle( $db->f("mf_name") );

$browsepage_lbl = shopMakeHtmlSafe( $db->f("mf_name") );
$tpl->set( 'browsepage_lbl', $browsepage_lbl );
$browsepage_lbltext = $db->f("mf_desc");
$tpl->set( 'browsepage_lbltext', $browsepage_lbltext );
$browsepage_header = $tpl->fetch( 'browse/includes/browse_header_manufacturer.tpl.php' );

From this then it looks like the variable is $browsepage_lbltext, not $mf_desc.
Get answers faster:

I can build your online shop, setup or customize Virtuemart or help your existing shop maximize its potential. Email / PM for info

grayceworks

  • Jr. Member
  • **
  • Posts: 73
Re: Modification to manufacturer browse page
« Reply #6 on: November 29, 2008, 21:24:56 pm »
but that variable is already IN the manufacturer browse header, and it wasn't showing at all, so that's why I tried the other.
searching for solutions
====================================
Joomla 1.5.9
VirtueMart 1.1.3
Linux/Apache|PHP5|mySQL5
Firefox 3.0.6 | Internet Exploder 7 
Windoze XP sp3 | Suse 10

grayceworks

  • Jr. Member
  • **
  • Posts: 73
Re: Modification to manufacturer browse page
« Reply #7 on: December 03, 2008, 07:39:43 am »

From this then it looks like the variable is $browsepage_lbltext, not $mf_desc.

If that's the case, then why is it not showing? Because that variable was already IN the manufacturer browse heading, so it should be showing. Any ideas? Anyone?
searching for solutions
====================================
Joomla 1.5.9
VirtueMart 1.1.3
Linux/Apache|PHP5|mySQL5
Firefox 3.0.6 | Internet Exploder 7 
Windoze XP sp3 | Suse 10

grayceworks

  • Jr. Member
  • **
  • Posts: 73
Re: Modification to manufacturer browse page... Help please?
« Reply #8 on: December 08, 2008, 09:04:10 am »
Can anyone please help me figure out why this doesn't work the way it appears it should? Please? I'm not a coder. I just follow directions. But from looking at it, it seems that the variable is already there to show the manufacturer description text. But it won't show. Help?
searching for solutions
====================================
Joomla 1.5.9
VirtueMart 1.1.3
Linux/Apache|PHP5|mySQL5
Firefox 3.0.6 | Internet Exploder 7 
Windoze XP sp3 | Suse 10

MikeUK

  • Global Moderator
  • Full Member
  • *
  • Posts: 1344
Re: Modification to manufacturer browse page-help?
« Reply #9 on: December 11, 2008, 09:43:35 am »
If that doesn't work I'm not sure without looking into the code (and just not got the time for that at the moment). Perhaps it needs to be defined from scratch.  If you could attempt it, and post the code you tried, something like that, people could look at the code and maybe correct it. If you're not familiar with php, you probably will need someone to just go in and do it for you. Unless someone who sees this has done this already.
Get answers faster:

I can build your online shop, setup or customize Virtuemart or help your existing shop maximize its potential. Email / PM for info

grayceworks

  • Jr. Member
  • **
  • Posts: 73
Re: Modification to manufacturer browse page-help?
« Reply #10 on: December 14, 2008, 02:43:51 am »
Can you recommend anyone who can help with this then? Like I said, I'm not a coder, but I can follow directions, and I also have a limited budget from which I CAN pay for assistance if necessary.
searching for solutions
====================================
Joomla 1.5.9
VirtueMart 1.1.3
Linux/Apache|PHP5|mySQL5
Firefox 3.0.6 | Internet Exploder 7 
Windoze XP sp3 | Suse 10

MikeUK

  • Global Moderator
  • Full Member
  • *
  • Posts: 1344
Re: Modification to manufacturer browse page-help?
« Reply #11 on: December 14, 2008, 11:18:32 am »
Appreciate the problem. I was sort of hoping someone else might have done this and posted the info you need by now. But doesn't look like that will happen.

Had a look at you post again with the shop.browse code:

Code: [Select]
elseif( $manufacturer_id) {
$db->query( "SELECT manufacturer_id, mf_name FROM #__{vm}_manufacturer WHERE manufacturer_id='$manufacturer_id'");
$db->next_record();
$mainframe->setPageTitle( $db->f("mf_name") );
$browsepage_lbltext = $db->f("mf_desc");
$browsepage_lbl = shopMakeHtmlSafe( $db->f("mf_name") );
$tpl->set( 'browsepage_lbl', $browsepage_lbl );
$browsepage_lbltext = $db->f("mf_desc");


perhaps this line needs to get the description also from the database. So it would be:

Code: [Select]
$db->query( "SELECT manufacturer_id, mf_name, mf_desc FROM #__{vm}_manufacturer WHERE manufacturer_id='$manufacturer_id'");
assuming mf_desc is the correct name for the field in the database.
Get answers faster:

I can build your online shop, setup or customize Virtuemart or help your existing shop maximize its potential. Email / PM for info

grayceworks

  • Jr. Member
  • **
  • Posts: 73
Re: Modification to manufacturer browse page-help? - Solved!
« Reply #12 on: December 15, 2008, 01:23:36 am »
woohoo! That did the trick! Thank you so much! I'll post this solution to the other threads I started for others that have had this same question...
searching for solutions
====================================
Joomla 1.5.9
VirtueMart 1.1.3
Linux/Apache|PHP5|mySQL5
Firefox 3.0.6 | Internet Exploder 7 
Windoze XP sp3 | Suse 10

MikeUK

  • Global Moderator
  • Full Member
  • *
  • Posts: 1344
Re: Modification to manufacturer browse page-help? - Solved!
« Reply #13 on: December 15, 2008, 02:57:41 am »
woohoo! That did the trick! Thank you so much! I'll post this solution to the other threads I started for others that have had this same question...

Glad it worked.

Best thing is to just give a link here. Will centralize the issue if there are more questions.
Get answers faster:

I can build your online shop, setup or customize Virtuemart or help your existing shop maximize its potential. Email / PM for info