Welcome, Guest. Please login or register.
Did you miss your activation email?
Login with username, password and session length


Need Professional Support? Head over to the VirtueMart Experts of vm-expert.com and see what they can do for you.

  Advanced search

216589 Posts in 58326 Topics- by 87989 Members - Latest Member: Gavin58614
Pages: [1]   Go Down
Print
Author Topic: help extending the capabilities of the manufacturer logo module  (Read 7398 times)
Lee
Jr. Member
**
Posts: 60


These go to 11.


View Profile
« on: June 22, 2007, 00:07:19 am »

After searching for a way to satisfy a request I've come across a near match with:

Manufacturer Images/Logos in mod_virtuemart_manufacturers

http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=25858.msg70556#msg70556

This is a modification of the mod_virtuemart_manufacturers module which creates a linkable list of manufacturer images/logos.  The link is to a browse page listing all products by that manufacturer (shop.browse&manufacturer_id=x).  It operates using the manufacturer ID.

On my site I have home decor products categorized and sub-categorized as follows:
type (dinnerware, crystal, etc) ->
manufacturer (acme pottery, etc) ->
pattern (blue flowers, green flowers, etc) -> products (plates, bowls, etc)

Thus I have categories names = manufacturer names.  The 2 strings are the same.  Of course the category ID is not equal to the manufacturer ID of the same name (or else I wouldn't need help).

The modification I need:
have the manufacturer logo module link instead to the corresponding category browse page (shop.browse&category_id=x).

I'm not a php programmer but I can conceive that this might be possible if we can relate the manufacturer ID to the category ID by matching the Name strings.

Any takers?
Logged
Lee
Jr. Member
**
Posts: 60


These go to 11.


View Profile
« Reply #1 on: June 23, 2007, 05:01:58 am »

After further thought I feel strongly that this is possible.

I'm not knowledgeable enough with php or sql - but getting the category_id for the browse page should go something like:

SELECT `category_id` FROM `jos_vm_category` WHERE" `category_name`='mf_name' FROM 'jos_vm_manufacturer'"

Can someone please help me over the hump on this?
Logged
Lee
Jr. Member
**
Posts: 60


These go to 11.


View Profile
« Reply #2 on: July 03, 2007, 22:20:56 pm »

I located this "featured category" module by sm2 that I think could be adapted more easily to accomplish what I'm after.

http://www.sm2joomla.com/component/option,com_docman/task,cat_view/gid,79/Itemid,101/

However, so far I'm unable to specify the categories using a comma separated list as it advertises.

Please reply if you have any experience with this module.
Logged
Lee
Jr. Member
**
Posts: 60


These go to 11.


View Profile
« Reply #3 on: August 21, 2007, 19:28:42 pm »

The "featured category" module by sm2 mentioned above currently isn't stable.

So I went back to the Manufacturer Images/Logos in mod_virtuemart_manufacturers module referenced in my first post.

Borrowing from code I came across in an answer to an unrelated hack I solved my question.

Here is the solution for anyone interested:

in the file mod_virtuemart_manufacturers_logo.php

Change the code:

Code:
<?php foreach( $res as $manufacturer) { ?>
<a href="<?php echo $sess->urlURL."index.php?option=com_virtuemart&page=shop.browse&manufacturer_id="$manufacturer->manufacturer_id ?>">
<img src="images/manufacturers/<?php echo $manufacturer->manufacturer_id?>.jpg" vspace="3" hspace="21" border="0" alt="<?php echo $manufacturer->mf_name?>"></a>
<?php ?>

To:

Code:
<?php foreach( $res as $manufacturer) {
                
$db->query"SELECT category_id FROM #__{vm}_category WHERE category_name='$manufacturer->mf_name'");
                
$db->next_record();
echo 
"<a href=\"index.php?page=shop.browse&category_id=".$db->f("category_id")."&option=com_virtuemart&Itemid=26\">";?>

<img src="images/manufacturers/<?php echo $manufacturer->manufacturer_id?>.jpg" vspace="3" hspace="21" border="0" alt="<?php echo $manufacturer->mf_name?>"></a>
<?php ?>

Again this is a custom solution since my category names match my manufacturer names for every product on my site.  Hopefully someone finds this helpful.

Lee
« Last Edit: August 21, 2007, 21:04:36 pm by Lee » Logged
brunoazevedo
Newbie
*
Posts: 5


View Profile
« Reply #4 on: February 13, 2009, 20:08:30 pm »

Hi All,

Thanks for this topic.

Work Perfect.

bruno Azevedo
Logged
Luciffere
Jr. Member
**
Posts: 58


Joomla is the Best


View Profile WWW
« Reply #5 on: June 25, 2009, 13:11:23 pm »

Hi All,

Thanks for this topic.

Work Perfect.

bruno Azevedo

Not work. The .$db->f("category_id"). not extract the catid...
My browser link: http://localhost/auto/index.php?page=shop.browse&category_id=&option=com_virtuemart&Itemid=26
Logged

Web design, logo, branding, joomla, virtuemart, flash. Portofoliu web design: http://www.luciffere.ro/portofoliu.html
Pages: [1]   Go Up
Print
Jump to: