News:

Looking for documentation? Take a look on our wiki

Main Menu

How to show manufacturers of a product on productdetails

Started by vm_ASL, November 10, 2014, 12:02:27 PM

Previous topic - Next topic

vm_ASL

Hello there,

since it is possible to assign multiple manufacturers to a single product, it should also be possible to show these manufacturers on the product details page.
I found some approaches, but they all date back to versions when VM backend wasn't supporting multi manufacturers.

My Question is: how can I modify the productdetails resp. other pages?

      <?php
      // Manufacturer of the Product
      if (VmConfig::get('show_manufacturers', 1) && !empty($this->product->virtuemart_manufacturer_id)) {
          echo $this->loadTemplate('manufacturer');
      }
      ?>

what do I have to change here?

Greetz,
henning

edit:

i changed the code to this:

      <?php
      // Manufacturer of the Product
      if (VmConfig::get('show_manufacturers', 1) && !empty($this->product->virtuemart_manufacturer_id)) {
         foreach ($this->product->virtuemart_manufacturer_id as $manufacturer) {
            echo $this->loadTemplate('manufacturer');
            }
      }
      ?>

but it is echo'ing the same manufacturer name, (resp. link) - twice, but there are two different manufacturers assigned...

tested with var_dump($this->product->virtuemart_manufacturer_id) array(2)  => {
  • => string(1) "3" [1]=> string(1) "4" }

    yea, i am an php noob

victoria_b

Hello,
I have made a post but nobody replies. So I thought If you are searching to show multiple manufacturers, you propably know how to show one.
So, I hope you don't mind asking you from here... I would just like to ask how to show manufacturer of a product when showing the products of a specific category (not on productdetails page).
Which .php file should I edit and what code to add?
I am trying to show both manufacturer and the discount (in percentage) if there is one, insted of the word "Sale" that now is shown. (see image)

I would appreciate any kind of help.

I am sorry I don't have the answer for your own problem.
Have a nice day and... Good Luck!

Note: I am using Joomla 2.5.24, Virtuemart 2.6.10


[attachment cleanup by admin]

vm_ASL

Hello

i think it should be found in the views/category default.php - but i am not where the changes have to be done AND how...
but, maybe it is done in the sublayouts, somehow.


reminds me to mention the versions im running here, its Joomla! 3.3.6 and VM 2.9.9.3.




jenkinhill

VM2.9.9 are still development versions (now at 2.9.9.4 for public, 2.9.9.5 for internal testing) so most people won't try altering layouts until the stable VM3 is finally available as tracking down the remaining bugs is more important.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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

vm_ASL

Hello jenkinhill,

okay, in understand tracking down the bugs is more important. I posted my question in templating and layouts cause i think it is a layout issue, but isn't it somehow a bug, too?
And wouldn't it be smart to include the output of multi Manufacturers in the Frontend, so it CAN be tested for bugs?

Greets




vm_ASL

Can I ask again, what's going on with showing (a linkable list of) manufacturers on the productdetails page?

what do i have to change in vmbeez5/html/com_virtuemart/productdetails/default.php? Or do i need custom fields to show all manufacturers?

--> running latest releases:Joomla! 2.5.27,  VirtueMart 3.0.0