News:

Support the VirtueMart project and become a member

Main Menu

Link to page that shows categories and manufactures

Started by spyderwebdesign, September 20, 2012, 02:22:47 AM

Previous topic - Next topic

spyderwebdesign

I have a link in my menu for store which takes you to a page with the categories layout. I see that I can change this to go to a page showing manufactures layout. Is it possible to change the link that goes to a page that lists all of the categories as well as the manufactures? If so, can someone please tell me how to do this?

spyderwebdesign

I still haven't figured this out and it appears that nobody knows how to show the manufactures and the categories on the same page. Can anyone confirm that these are the pages that display the manufactures and the categories?

/components/com_virtuemart/views/categories/view.html.php

/components/com_virtuemart/views/manufacture/view.html.php

If so, I am going to try to combine some of the code from one of the pages with the other page in hopes to show everything on the same page.

spyderwebdesign

So I grabbed some of the code from the manufactures view page and put it in the categories view page, now the categories show two times, which tells me that I need to hard code some variable value that is being requested from somewhere. Does anyone know which variables in the 2nd part of the function I need to manually set so that the manufactures will show below the categories? Here is the current page I am editing.

http://www.likdancewear.com/index.php?option=com_virtuemart&view=categories&virtuemart_category_id=0&Itemid=773

I am guessing it is somewhere in this part of the code

$virtuemart_manufacturer_id = JRequest::getInt('virtuemart_manufacturer_id', 0);
      $mf_category_id = JRequest::getInt('mf_category_id', 0);

      // get necessary models
      $model = VmModel::getModel('manufacturer');
      if ($virtuemart_manufacturer_id !=0 ) {

         $manufacturer = $model->getManufacturer();
         $model->addImages($manufacturer,1);

         $manufacturerImage = $manufacturer->images[0]->displayMediaThumb('class="manufacturer-image"',false);

         $document->setTitle(JText::_('COM_VIRTUEMART_MANUFACTURER_DETAILS').' '.strip_tags($manufacturer->mf_name));

         $this->assignRef('manufacturerImage', $manufacturerImage);
         $this->assignRef('manufacturer',   $manufacturer);
         $pathway->addItem(strip_tags($manufacturer->mf_name));

         $this->setLayout('details');
      } else {
         $document->setTitle(JText::_('COM_VIRTUEMART_MANUFACTURER_PAGE')) ;
         $manufacturers = $model->getManufacturers(true, true,  true);
         $model->addImages($manufacturers,1);
         $this->assignRef('manufacturers',   $manufacturers);
         $this->setLayout('default');
      }

spyderwebdesign

I have figured out a little more. If I change the url from

http://www.likdancewear.com/index.php?option=com_virtuemart&view=categories&virtuemart_category_id=0&Itemid=773

to

http://www.likdancewear.com/index.php?option=com_virtuemart&view=manufacturer&virtuemart_category_id=0&Itemid=773

the manufactures will show; however I can't find anywhere in
/components/com_virtuemart/views/categories/view.html.php

where it does a request for the query string view

I would guess that in the 2nd part of the function I would need to change view from categories to manufactures. Does anyone know how to set this so I can show both views on the same page?

bytelord

Hello,

Why you don't create a joomla menu item with the above link? (index.php?option=com_virtuemart&view=manufacturer&virtuemart_category_id=0&Itemid=XXX)
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

spyderwebdesign

Thanks for trying to help bytelord, but that doesn't work. When I set the link to

http://www.likdancewear.com/ndex.php?option=com_virtuemart&view=manufacturer&virtuemart_category_id=0&Itemid=773

only the manufactures show. I need the categories to show AND the manufactures.

spyderwebdesign

So I think I was in the wrong file. It looks like

/components/com_virtuemart/views/categories/tmpl/default.php

is the file that request the value for view out of the url. Can anyone confirm? I spent over a week working with the wrong file. Surely someone has changed their VM to show a list of categories and manufactures on their store main page.