Author Topic: Manufacturer Name and Logo in Template (NEED HELP)  (Read 5752 times)

dihegroup

  • Beginner
  • *
  • Posts: 15
Manufacturer Name and Logo in Template (NEED HELP)
« on: August 03, 2010, 10:48:54 am »
Hello all,

need some Help. Have latest Joomla und latest VM (1.1.5).

I want to make 2 things.

1. on the browsepage I want to take on manufacturername (or brandname) for each product like the attached picture 1.
2. for the product_details_page (flypage) I want to add the manufacturer-LOGO like added picture 2.


PLEASE IF SOMEONE KNOW HOW I CAN DO THIS, PLEASE HELP!!! Have tryed other versions from hacks from the forum but nothing work :(((

[attachment cleanup by admin]

dihegroup

  • Beginner
  • *
  • Posts: 15
Re: Manufacturer Name and Logo in Template (NEED HELP)
« Reply #1 on: August 03, 2010, 17:36:25 pm »
have solved the problem with manufacturer-logo on the flypage by myself, beautifull forum...but the problem with browsepage is left...


rb

  • Advanced
  • Full Member
  • *****
  • Posts: 1503
Re: Manufacturer Name and Logo in Template (NEED HELP)
« Reply #2 on: August 03, 2010, 19:08:29 pm »
To show the manufacturer's name on each product on a browse page, add this to your browse page template:

Code: [Select]
<?php 
  
// rb add to get mf_name
  
$product_id preg_replace"/.*product_id=(\d*).*/"'$1'$product_flypage ); 
  echo 
ps_product::get_mf_name$product_id ); 
?>


dihegroup

  • Beginner
  • *
  • Posts: 15
Re: Manufacturer Name and Logo in Template (NEED HELP)
« Reply #3 on: August 03, 2010, 19:36:24 pm »
BIG BIG BIG THANK TO YOU !!! HAVE SEARCHED FOR THIS 4 DAYS !!!!! VERY BIG THANKS !!

Zyama

  • Beginner
  • *
  • Posts: 9
Re: Manufacturer Name and Logo in Template (NEED HELP)
« Reply #4 on: December 15, 2010, 19:17:37 pm »
rb, You are great!!

Zyama

  • Beginner
  • *
  • Posts: 9
Re: Manufacturer Name and Logo in Template (NEED HELP)
« Reply #5 on: December 16, 2010, 01:11:53 am »
To show the manufacturer's name on each product on a browse page, add this to your browse page template:

Code: [Select]
<?php 
  
// rb add to get mf_name
  
$product_id preg_replace"/.*product_id=(\d*).*/"'$1'$product_flypage ); 
  echo 
ps_product::get_mf_name$product_id ); 
?>


How to add check if there is no manufacturer name?

lipes

  • Full Member
  • ***
  • Posts: 720
Re: Manufacturer Name and Logo in Template (NEED HELP)
« Reply #6 on: December 16, 2010, 01:22:19 am »
VM V. online: J2.5.14 | VM 2.0.20a | SQL 5.1.70 | PHP 5.3.25

Zyama

  • Beginner
  • *
  • Posts: 9
Re: Manufacturer Name and Logo in Template (NEED HELP)
« Reply #7 on: December 16, 2010, 02:21:56 am »
There is no check methods it posts You gave a link.

enzo24

  • Beginner
  • *
  • Posts: 13
Re: Manufacturer Name and Logo in Template (NEED HELP)
« Reply #8 on: February 16, 2011, 19:02:38 pm »
Oh my god ! THANK YOU !!!
I've been stugling with shop.browse.php trying to get the variable mf_name thru to browse_1 template, but to no avail ! This is a lifesaver post !!!

Now if only I understood exactly how it works...

Reggaeshop

  • Jr. Member
  • **
  • Posts: 53
    • Trenchtown Music :: www.reggaeshop.cz
Re: Manufacturer Name and Logo in Template (NEED HELP)
« Reply #9 on: November 02, 2011, 00:01:13 am »
Hi, I made the change rb mentioned - for some time it worked, but then it suddenly changed back to normal. Unfortunately, I do not know exactly when it when back to the old state again - it could be when updating to VM 1.1.9

Anybody an idea where it could have gone wrong?


I found the issue: ARTIO JoomSEF - this solution does not seem to work with JoomSEF switched on. 

But... knowing the issue does not mean I know the solution. Any tips/help? Created a new post on this topic here http://forum.virtuemart.net/index.php?topic=92704.0

FilipeRuivo

  • Jr. Member
  • **
  • Posts: 62
Re: Manufacturer Name and Logo in Template (NEED HELP)
« Reply #10 on: December 17, 2011, 06:45:08 am »
Hi, I made the change rb mentioned - for some time it worked, but then it suddenly changed back to normal. Unfortunately, I do not know exactly when it when back to the old state again - it could be when updating to VM 1.1.9

Anybody an idea where it could have gone wrong?


I found the issue: ARTIO JoomSEF - this solution does not seem to work with JoomSEF switched on. 

But... knowing the issue does not mean I know the solution. Any tips/help? Created a new post on this topic here http://forum.virtuemart.net/index.php?topic=92704.0

In the /components/com_virtuemart/themes/yourtemplate/theme.php add this right after // Your code here please...

Code: [Select]
function get_mdetails($product_id, $detail) {
   $db = new ps_DB;

      $q = "SELECT * FROM #__{vm}_product_mf_xref,#__{vm}_manufacturer ";
      $q .= "WHERE product_id='$product_id' ";
      $q .= "AND #__{vm}_manufacturer.manufacturer_id=#__{vm}_product_mf_xref.manufacturer_id";

      $db->query($q);
      $db->next_record();
      $html = $db->f($detail);
      return $html;
   }

Now you can get the manufacturer details any here in your template

just type:

echo $this->get_mdetails( $product_id, 'manufacturer_id' );
echo $this->get_mdetails( $product_id, 'mf_name' );
echo $this->get_mdetails( $product_id, 'mf_desc' );


That's it ;)