VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Topic started by: DeeCee on September 16, 2008, 15:42:04 pm

Title: Manufacturer Logo - Finally Finished
Post by: DeeCee on September 16, 2008, 15:42:04 pm
For brand awareness, I have been working on the upload and display of a manufacturer logo.

I actually just noticed that in the dev.wiki, this is being worked on, but I can't wait for VM 1.1.3 to be released, so I thought I'd work on it myself.

I have added a tab to the Manufacturer form under VM admin and have the images (thumb and full) uploading and storing to the directory successfully.

My current situation is that I can't seem to get the manufacturer image to the flypage.

I have tried various methods of altering clsses/ps_product.php, html/product.product_display.php etc etc but still can't seem to get this to work.

Following the example of category image thumbnails and the developer wiki ( https://dev.virtuemart.net/cb/wiki/1367 ), I have tried to hack/copy the following examples to produce the same results but in the flypage:

classes/ps_product_category.php -> function get_child_list
classes/ps_product.php -> function get_mf_name

Do I have to put the images in an array as a variable and then import the variable as a template? I just don't know!

I've tried following the above functions as examples, but keep getting 500 errors (man i should have paid more attention in database classes...) and I ned some serious guidence to understand how to get stored manufacturer images to the product flypage.

Can anyone help out so that everyone can benefit?

Thanks
Dave
                  
PS - had to seperate the php code out to other posts. I somehow went over the 20000 character limit ;)


Here is the SQL, manufacturer form code, ps_manufacturer code

SQL:
Code: [Select]
ALTER TABLE `jos_vm_manufacturer` ADD `mf_thumb_image` VARCHAR( 255 ) NULL DEFAULT NULL AFTER `mf_desc` ,
ADD `mf_full_image` VARCHAR( 255 ) NULL DEFAULT NULL AFTER `mf_thumb_image` ;
Title: Re: Manufacturer Logo - need help with arrays / $tpl
Post by: DeeCee on September 16, 2008, 15:42:54 pm
administrator/components/com_virtuemart/html/manufacturer.manufacturer_form.php

Code: [Select]
<?php 
if( !defined'_VALID_MOS' ) && !defined'_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); 
/**
*
* @version $Id: manufacturer.manufacturer_form.php 1095 2007-12-19 20:19:16Z soeren_nb $
* @package VirtueMart
* @subpackage html
* @copyright Copyright (C) 2004-2007 soeren - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
mm_showMyFileName__FILE__ );

global 
$ps_manufacturer_category$manufacturer;

$manufacturer_id vmGet$_REQUEST'manufacturer_id');
$option = empty($option)?vmGet$_REQUEST'option''com_virtuemart'):$option;

if (!empty(
$manufacturer_id)) {
  
$q "SELECT * FROM #__{vm}_manufacturer WHERE manufacturer_id='$manufacturer_id'"
  
$db->query($q);  
  
$db->next_record();
}
//First create the object and let it print a form heading
$formObj = &new formFactory$VM_LANG->_('PHPSHOP_MANUFACTURER_FORM_LBL') );
//Then Start the form
$formObj->startForm('adminForm''enctype="multipart/form-data"');

$tabs = new vmTabPanel(01"manufacturerform");
$tabs->startPane("content-pane");
$tabs->startTab"<img src='"IMAGEURL ."ps_image/edit.png' align='absmiddle' width='16' height='16' border='0' /> ".$VM_LANG->_('PHPSHOP_MANUFACTURER_FORM_LBL'), "info-page");
?>

  <table class="adminform">
    <tr>
      <td align="right"><?php echo $VM_LANG->_('PHPSHOP_MANUFACTURER_LIST_MANUFACTURER_NAME'?></td>
      <td>
        <input type="text" class="inputbox" name="mf_name" value="<?php $db->sp("mf_name"?>" size="16" />
      </td>
    </tr>
    <tr>
      <td width="22%" align="right" ><?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_URL'?>:</td>
      <td width="78%" >
        <input type="text" class="inputbox" name="mf_url" value="<?php $db->sp("mf_url"?>" size="32" />
      </td>
    </tr>
    <tr>
      <td align="right"><?php echo $VM_LANG->_('PHPSHOP_MANUFACTURER_FORM_CATEGORY'?>:</td>
      <td ><?php $ps_manufacturer_category->list_category($db->f("mf_category_id"));     ?></td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td >&nbsp;</td>
    </tr>
    <tr>
      <td align="right" ><?php echo $VM_LANG->_('PHPSHOP_MANUFACTURER_FORM_EMAIL'?>:</td>
      <td>
        <input type="text" class="inputbox" name="mf_email" value="<?php $db->sp("mf_email"?>" size="18" />
      </td>
    </tr>
    <tr>
      <td align="right" >&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td width="22%" align="right"  valign="top"><?php echo $VM_LANG->_('PHPSHOP_MANUFACTURER_FORM_DESCRIPTION'?>:</td>
      <td width="78%" ><?php
editorArea'editor1'$db->f("mf_desc"), 'mf_desc''300''150''70''25' )
?>

      </td>
    <tr align="center">
      <td colspan="2" >&nbsp;</td>
    </tr>
</table>
<?php
$tabs
->endTab();
$tabs->startTab"<img src='"IMAGEURL ."ps_image/image.png' width='16' height='16' align='absmiddle' border='0' /> ".$VM_LANG->_('E_IMAGES'), "images-page");

if( !
stristr$db->f("mf_thumb_image"), "http") )
  echo 
"<input type=\"hidden\" name=\"mf_thumb_image_curr\" value=\""$db->f("mf_thumb_image") ."\" />";

if( !
stristr$db->f("mf_full_image"), "http") )
  echo 
"<input type=\"hidden\" name=\"mf_full_image_curr\" value=\""$db->f("mf_full_image") ."\" />";
 
  
$ps_html->writableIndicator( array( IMAGEPATH."manufacturer") );
?>

  <table class="adminform" >
    <tr>
      <td valign="top" width="50%" style="border-right: 1px solid black;">
        <h2><?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_FULL_IMAGE'?></h2>
        <table class="adminform">
          <tr class="row0">
            <td colspan="2" ><?php 
            
if ($manufacturer_id) {
                echo 
$VM_LANG->_('PHPSHOP_PRODUCT_FORM_IMAGE_UPDATE_LBL') . "<br />"; } ?>

              <input type="file" class="inputbox" name="mf_full_image" size="50" maxlength="255" />
              </td>
          </tr>
          <tr class="row1">
            <td colspan="2" ><div style="font-weight:bold;"><?php echo $VM_LANG->_('PHPSHOP_IMAGE_ACTION'?>:</div><br/>
              <input type="radio" class="inputbox" name="mf_full_image_action" id="mf_full_image_action0" checked="checked" value="none" onchange="toggleDisable( document.adminForm.image_action[1], document.adminForm.mf_full_image, true );toggleDisable( document.adminForm.image_action[1], document.adminForm.mf_full_image_url, true );"/>
              <label for="mf_full_image_action0"><?php echo $VM_LANG->_('PHPSHOP_NONE'); ?></label><br/>
              <?php
              
// Check if GD library is available - creates image
              
if( function_exists('imagecreatefromjpeg')) { ?>

              <input type="radio" class="inputbox" name="mf_full_image_action" id="mf_full_image_action1" value="auto_resize" onchange="toggleDisable( document.adminForm.mf_full_image_action[1], document.adminForm.mf_thumb_image, true );toggleDisable( document.adminForm.mf_full_image_action[1], document.adminForm.mf_thumb_image_url, true );"/>
              <label for="mf_full_image_action1"><?php echo $VM_LANG->_('PHPSHOP_FILES_FORM_AUTO_THUMBNAIL') . "</label><br />"
              }
              if (
$manufacturer_id and $db->f("mf_full_image")) { ?>

                <input type="radio" class="inputbox" name="mf_full_image_action" id="mf_full_image_action2" value="delete" onchange="toggleDisable( document.adminForm.mf_full_image_action[1], document.adminForm.mf_thumb_image, true );toggleDisable( document.adminForm.mf_full_image_action[1], document.adminForm.mf_thumb_image_url, true );"/>
                <label for="mf_full_image_action2"><?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_IMAGE_DELETE_LBL') . "</label><br />"
              } 
?>

            </td>
          </tr>
          <tr class="row0"><td colspan="2">&nbsp;</td></tr>
          <tr class="row0">
            <td width="21%" ><?php echo $VM_LANG->_('URL')." (".$VM_LANG->_('CMN_OPTIONAL')."!)&nbsp;"?></td>
            <td width="79%" >
              <?php 
              
if( stristr($db->f("mf_full_image"), "http") )
              
$mf_full_image_url $db->f("mf_full_image");
              else if(!empty(
$_REQUEST['mf_full_image_url']))
              
$mf_full_image_url vmGet($_REQUEST'mf_full_image_url');
              else
              
$mf_full_image_url "";
              
?>

              <input type="text" class="inputbox" size="50" name="mf_full_image_url" value="<?php echo $mf_full_image_url ?>" onchange="if( this.value.length>0) document.adminForm.mf_full_image_action[1].checked=false; else document.adminForm.mf_full_image_action[1].checked=true; toggleDisable( document.adminForm.product_full_image_action[1], document.adminForm.mf_thumb_image_url, true );toggleDisable( document.adminForm.mf_full_image_action[1], document.adminForm.mf_thumb_image, true );" />
            </td>
          </tr>
          <tr class="row1"><td colspan="2">&nbsp;</td></tr>
          <tr class="row1">
            <td colspan="2" >
              <div style="overflow:auto;">
                <?php 
                 echo 
$ps_product->image_tag($db->f("mf_full_image"), ""0"manufacturer");
                
?>

              </div>
            </td>
          </tr>
        </table>
      </td>

      <td valign="top" width="50%">
        <h2><?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_THUMB_IMAGE'?></h2>
        <table class="adminform">
          <tr class="row0">
            <td colspan="2" ><?php if ($manufacturer_id) {
                echo 
$VM_LANG->_('PHPSHOP_PRODUCT_FORM_IMAGE_UPDATE_LBL') . "<br />"; } ?>

              <input type="file" class="inputbox" name="mf_thumb_image" size="50" maxlength="255" onchange="if(document.adminForm.mf_thumb_image.value!='') document.adminForm.mf_thumb_image_url.value='';" />
            </td>
          </tr>
          <tr class="row1">
            <td colspan="2" ><div style="font-weight:bold;"><?php echo $VM_LANG->_('PHPSHOP_IMAGE_ACTION'?>:</div><br/>
              <input type="radio" class="inputbox" id="mf_thumb_image_action0" name="mf_thumb_image_action" checked="checked" value="none" onchange="toggleDisable( document.adminForm.image_action[1], document.adminForm.mf_thumb_image, true );toggleDisable( document.adminForm.image_action[1], document.adminForm.mf_thumb_image_url, true );"/>
              <label for="mf_thumb_image_action0"><?php echo $VM_LANG->_('PHPSHOP_NONE'?></label><br/>
              <?php 
              
if ($manufacturer_id and $db->f("mf_thumb_image")) { ?>

                <input type="radio" class="inputbox" id="mf_thumb_image_action1" name="mf_thumb_image_action" value="delete" onchange="toggleDisable( document.adminForm.image_action[1], document.adminForm.mf_thumb_image, true );toggleDisable( document.adminForm.image_action[1], document.adminForm.mf_thumb_image_url, true );"/>
                <label for="mf_thumb_image_action1"><?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_IMAGE_DELETE_LBL') . "</label><br />"
              } 
?>

            </td>
          </tr>
          <tr class="row0"><td colspan="2">&nbsp;</td></tr>
          <tr class="row0">
            <td width="21%" ><?php echo $VM_LANG->_('URL')." (".$VM_LANG->_('CMN_OPTIONAL').")&nbsp;"?></td>
            <td width="79%" >
              <?php 
              
if( stristr($db->f("mf_thumb_image"), "http") )
              
$mf_thumb_image_url $db->f("mf_thumb_image");
              else if(!empty(
$_REQUEST['mf_thumb_image_url']))
              
$mf_thumb_image_url vmGet($_REQUEST'mf_thumb_image_url');
              else
              
$mf_thumb_image_url "";
              
?>

              <input type="text" class="inputbox" size="50" name="mf_thumb_image_url" value="<?php echo $mf_thumb_image_url ?>" />
            </td>
          </tr>
          <tr class="row1"><td colspan="2">&nbsp;</td></tr>
          <tr class="row1">
            <td colspan="2" >
              <div style="overflow:auto;">
                <?php 
                 echo 
$ps_product->image_tag($db->f("mf_thumb_image"), ""0"manufacturer");
                
?>

              </div>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
<?php
$tabs
->endPane();

// Add necessary hidden fields
$formObj->hiddenField'manufacturer_id'$manufacturer_id );
  
$funcname = !empty($manufacturer_id) ? "manufacturerupdate" "manufactureradd";
// Write your form with mixed tags and text fields
// and finally close the form:
$formObj->finishForm$funcname$modulename.'.manufacturer_list'$option );
?>

<script type="text/javascript">//<!--
function toggleDisable( elementOnChecked, elementDisable, disableOnChecked ) {
  if( !disableOnChecked ) {
    if(elementOnChecked.checked==true) {
      elementDisable.disabled=false;
    }
    else {
      elementDisable.disabled=true;
    }
  }
  else {
    if(elementOnChecked.checked==true) {
      elementDisable.disabled=true;
    }
    else {
      elementDisable.disabled=false;
    }
  }
}

toggleDisable( document.adminForm.mf_full_image_action[1], document.adminForm.mf_thumb_image, true );
//-->
</script>

Title: Re: Manufacturer Logo - need help with arrays / $tpl
Post by: DeeCee on September 16, 2008, 15:43:03 pm
administrator/components/com_virtuemart/classes/ps_manufacturer.php

Code: [Select]
<?php
if( !defined'_VALID_MOS' ) && !defined'_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
/**
*
* @version $Id: ps_manufacturer.php 1406 2008-05-26 06:58:04Z joomlacorner $
* @package VirtueMart
* @subpackage classes
* @copyright Copyright (C) 2004-2008 soeren - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/

/**
 * The class is is used to manage the manufacturers in your store.
 *
 */
class ps_manufacturer extends vmAbstractObject {

/**
 * Validates the Input Parameters and uploaded image files 
 * onBeforeManufacturerAdd
 *
 * @param array $d
 * @return boolean
 */
function validate_add(&$d) {
global $vmLogger$VM_LANG;
require_once(CLASSPATH 'imageTools.class.php' );
$valid true;
$db = new ps_DB;

if (empty($d["mf_name"])) {
$GLOBALS['vmLogger']->err$VM_LANG->_('VM_MANUF_ERR_NAME') );
return false;
}
else {
$q "SELECT count(*) as rowcnt from #__{vm}_manufacturer where";
$q .= " mf_name='" .  $db->getEscaped($d["mf_name"]) . "'";
$db->query($q);
$db->next_record();
if ($db->f("rowcnt") > 0) {
$GLOBALS['vmLogger']->err$VM_LANG->_('VM_MANUF_ERR_EXISTS') );
return false;
}
}
/** Image Upload Validation **/

// do we have an image URL or an image File Upload?
if (!empty( $d['mf_thumb_image_url'] )) {
// Image URL
if (substr$d['mf_thumb_image_url'], 04) != "http") {
$vmLogger->err$VM_LANG->_('VM_PRODUCT_IMAGEURL_MUSTBEGIN') );
$valid =  false;
}

$d["mf_thumb_image"] = $d['mf_thumb_image_url'];
}
else {
// File Upload
if (!vmImageTools::validate_image($d,"mf_thumb_image","manufacturer")) {
$valid false;
}
}

if (!empty( $d['mf_full_image_url'] )) {
// Image URL
if (substr$d['mf_full_image_url'], 04) != "http") {
$vmLogger->err$VM_LANG->_('VM_PRODUCT_IMAGEURL_MUSTBEGIN') );
return false;
}
$d["mf_full_image"] = $d['mf_full_image_url'];
}
else {
// File Upload
if (!vmImageTools::validate_image($d,"mf_full_image","manufacturer")) {
$valid false;
}
}
return true;
}
/**
 * Validates the Input Parameters onBeforeManufacturerUpdate
 *
 * @param array $d
 * @return boolean
 */
function validate_update(&$d) {
global $vmLogger$VM_LANG;
$valid true;
require_once(CLASSPATH 'imageTools.class.php' );
if (empty($d["mf_name"])) {
$GLOBALS['vmLogger']->err$VM_LANG->_('VM_MANUF_ERR_NAME') );
return False;
}

/** Image Upload Validation **/

// do we have an image URL or an image File Upload?
if (!empty( $d['mf_thumb_image_url'] )) {
// Image URL
if (substr$d['mf_thumb_image_url'], 04) != "http") {
$vmLogger->err$VM_LANG->_('VM_PRODUCT_IMAGEURL_MUSTBEGIN') );
$valid =  false;
}

// if we have an uploaded image file, prepare this one for deleting.
if( $db->f("mf_thumb_image") && substr$db->f("mf_thumb_image"), 04) != "http") {
$_REQUEST["mf_thumb_image_curr"] = $db->f("product_thumb_image");
$d["mf_thumb_image_action"] = "delete";
if (!vmImageTools::validate_image$d"product_thumb_image""manufacturer")) {
return false;
}
}
$d["mf_thumb_image"] = $d['mf_thumb_image_url'];
}
else {
// File Upload
if (!vmImageTools::validate_image$d"mf_thumb_image""manufacturer")) {
$valid false;
}
}

if (!empty( $d['mf_full_image_url'] )) {
// Image URL
if (substr$d['mf_full_image_url'], 04) != "http") {
$vmLogger->err$VM_LANG->_('VM_PRODUCT_IMAGEURL_MUSTBEGIN') );
return false;
}
// if we have an uploaded image file, prepare this one for deleting.
if( $db->f("mf_full_image") && substr$db->f("mf_thumb_image"), 04) != "http") {
$_REQUEST["mf_full_image_curr"] = $db->f("mf_full_image");
$d["mf_full_image_action"] = "delete";
if (!vmImageTools::validate_image$d"mf_full_image""manufacturer")) {
return false;
}
}
$d["mf_full_image"] = $d['mf_full_image_url'];
}
else {
// File Upload
if (!vmImageTools::validate_image$d"mf_full_image""manufacturer")) {
$valid false;
}
}

return true;
}
/**
 * Validates the Input Parameters onBeforeManufacturerDelete
 *
 * @param array $d
 * @return boolean
 */
function validate_delete($mf_id, &$d) {
global $vmLogger$VM_LANG;
$db = new ps_DB;
require_once(CLASSPATH 'imageTools.class.php' );

if (empty( $mf_id )) {
$GLOBALS['vmLogger']->err$VM_LANG->_('VM_MANUF_ERR_DELETE_SELECT') );
return False;
}
$db->query"SELECT `#__{vm}_product`.product_id, manufacturer_id   FROM `#__{vm}_product`, `#__{vm}_product_mf_xref` WHERE manufacturer_id =".intval($mf_id)." AND `#__{vm}_product`.product_id = `#__{vm}_product_mf_xref`.product_id" );
if( $db->num_rows() > ) {
$GLOBALS['vmLogger']->err$VM_LANG->_('VM_MANUF_ERR_DELETE_STILLPRODUCTS') );
return false;
}

/* Prepare mf_thumb_image for Deleting */
if( !stristr$db->f("mf_thumb_image"), "http") ) {
$_REQUEST["mf_thumb_image_curr"] = $db->f("mf_thumb_image");
$d["mf_thumb_image_action"] = "delete";
if (!vmImageTools::validate_image($d,"mf_thumb_image","manufacturer")) {
$vmLogger->err$VM_LANG->_('VM_MANUF_ERR_DELETE_IMAGES') );
return false;
}
}
/* Prepare mf_full_image for Deleting */
if( !stristr$db->f("mf_full_image"), "http") ) {
$_REQUEST["mf_full_image_curr"] = $db->f("mf_full_image");
$d["mf_full_image_action"] = "delete";
if (!vmImageTools::validate_image($d,"mf_full_image","manufacturer")) {
return false;
}
}
return True;

}

/**
 * creates a new manufacturer record
 *
 * @param array $d
 * @return boolean
 */
function add(&$d) {
global $vmLogger$VM_LANG;

$db = new ps_DB;

if (!$this->validate_add($d)) {
return false;
}
if (!vmImageTools::process_images($d)) {
return false;
}
$fields = array( 'mf_name' => vmGet$d'mf_name' ),
'mf_email' => vmGet$d'mf_email' ),
'mf_desc' => vmGet$d'mf_desc'''VMREQUEST_ALLOWHTML ),
'mf_category_id' => vmRequest::getInt('mf_category_id'),
'mf_url' => vmGet$d'mf_url'),
'mf_thumb_image' => vmGet$d'mf_thumb_image'),
'mf_full_image' => vmGet$d'mf_full_image')
);
$db->buildQuery('INSERT''#__{vm}_manufacturer'$fields );
if( $db->query() !== false ) {
$GLOBALS['vmLogger']->info$VM_LANG->_('VM_MANUF_ADDED') );
$_REQUEST['manufacturer_id'] = $db->last_insert_id();
return true;
}
return false;

}

/**
 * updates manufacturer information
 *
 * @param array $d
 * @return boolean
 */
function update(&$d) {
global $VM_LANG;

$db = new ps_DB;

if (!$this->validate_update($d)) {
return False;
}

if (!vmImageTools::process_images($d)) {
return false;
}

$fields = array( 'mf_name' => vmGet$d'mf_name' ),
'mf_email' => vmGet$d'mf_email' ),
'mf_desc' => vmGet$d'mf_desc'''VMREQUEST_ALLOWHTML ),
'mf_category_id' => vmRequest::getInt('mf_category_id'),
'mf_url' => vmGet$d'mf_url'),
'mf_thumb_image' => vmGet$d'mf_thumb_image'),
'mf_full_image' => vmGet$d'mf_full_image')
);
$db->buildQuery('UPDATE''#__{vm}_manufacturer'$fields'WHERE manufacturer_id='.(int)$d["manufacturer_id"] );
if( $db->query() ) {
$GLOBALS['vmLogger']->info$VM_LANG->_('VM_MANUF_UPDATED') );
return true;
}
return false;
}

/**
* Controller for Deleting Records.
*/
function delete(&$d) {
global $vmLogger$VM_LANG;

$record_id $d["manufacturer_id"];

if (!$this->validate_delete($record_id$d)) {
return False;
}

if( is_array$record_id)) {
foreach( $record_id as $record) {
if( !$this->delete_record$record$d ))
return false;
}
return true;
}
else {
return $this->delete_record$record_id$d );
}

/* Delete Image files */
if (!vmImageTools::process_images($d)) {
return false;
}
$vmLogger->info$VM_LANG->_('VM_MANUF_DELETED').": $record_id." );
return True;
}
/**
* Deletes one Record.
*/
function delete_record$record_id, &$d ) {
global $vmLogger$VM_LANG;
$db = new ps_DB;
if (!$this->validate_delete($record_id$d)) {
return False;
}
$q 'DELETE from #__{vm}_product_mf_xref WHERE manufacturer_id='.(int)$record_id.' LIMIT 1';
$db->query($q);
$q 'DELETE from #__{vm}_manufacturer WHERE manufacturer_id='.(int)$record_id.' LIMIT 1';
$db->query($q);
return True;

/* Delete Image files */
if (!vmImageTools::process_images($d)) {
return false;
}
$vmLogger->info$VM_LANG->_('VM_MANUF_DELETED').": $record_id." );
return True;
}
/**
 * Prints a drop-down list of manufacturer names and their ids.
 *
 * @param int $manufacturer_id
 */
function list_manufacturer($manufacturer_id='0') {

$db = new ps_DB;

$q "SELECT manufacturer_id as id,mf_name as name FROM #__{vm}_manufacturer ORDER BY mf_name";
$db->query($q);
$db->next_record();

// If only one vendor do not show list
if ($db->num_rows() == 1) {

echo '<input type="hidden" name="manufacturer_id" value="'$db->f("id").'" />';
echo $db->f("name");
}
elseif( $db->num_rows() > 1) {
$db->reset();
$array = array();
while ($db->next_record()) {
$array[$db->f("id")] = $db->f("name");
}
$code ps_html::selectList('manufacturer_id'$manufacturer_id$array ). "<br />\n";
echo $code;
}
else  {
echo '<input type="hidden" name="manufacturer_id" value="1" />Please create at least one Manufacturer!!';
}
}
}

?>

Title: Re: Manufacturer Logo - need help with arrays / $tpl
Post by: DeeCee on October 01, 2008, 03:41:20 am
Does anyone have any input on this?
Title: Re: Manufacturer Logo - need help with arrays / $tpl
Post by: BernardE on October 11, 2008, 14:27:46 pm
Hi DeeCee

Thanks a lot for this nice mode. I'm having a little trouble getting it running. I have set it up as you showed. However, I get the following error message:

Call to a member function image_tag() on a non-object in...html\manufacturer.manufacturer_form.php on line 144

I check the file, and it seems the $ps_product functions are not be instantiated. I do not understand this, as the works in the product.product_form.php file.

Any ideas?
Title: Re: Manufacturer Logo - need help with arrays / $tpl
Post by: DeeCee on October 16, 2008, 14:17:44 pm
Hey Bernard,

I haven't looked at this for about a month due to other commitments, so I'll have a look over the next couple of days.

I also have thought about a way to display the images on the product flypage, but yet to test out.

Actually, I just had a look at manufacturer.manufacturer_form on my script and its just a </tr> tag.

If you mean line 140 then, yes, $ps_product is suppose to be there as it calls the the function image tag in class\ps_product - line 1374

Also, I just tested the manufacturer image upload again and it works fine on my computer.
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on January 28, 2009, 15:12:45 pm
Okay folks, after many months of not looking at my site and operating without it, I gave myself a deadline (1st of Feb) and have finally figured out how to upload and display manufacturer logos :)

I'll update you all tomorrow as I really need some sleep, but I've tested it out on my current VM installation and will try it on a clean unmodified version tomorrow as well to work some kinks.

Hopefully we'll see this added to VM as it is a sorely missed feature :)

Cheers
Dave
Title: Re: Manufacturer Logo - Finally Finished
Post by: aravot on January 29, 2009, 08:19:55 am
VirtueMart 1.2 has manufacturer logo, please have a look at the code and see if you can make any improvements.
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on January 29, 2009, 08:21:51 am
Yep - thats what I plan to do :)
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on January 29, 2009, 11:21:34 am
VirtueMart 1.2 has manufacturer logo, please have a look at the code and see if you can make any improvements.
Aravot, I will provide improvements over the next couple of days, on here publicly and to you personally with tagged code and code breakdown document.

GregDev has done pretty much exactly the same as I have done above (great work btw Greg :) ), but not to the next step of displaying the images on the product pages nor within the manufacturer pop up.

Not really useful if you can't use it ;)

I'll update tomorrow hopefully :)
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on February 03, 2009, 09:25:30 am
Okay folks here it is:

You need to update the following to get the manufacturers logo working in VM :)

Works with VM 1.1.3 J1.5.9

Code has integrated GregDevs work which will be present in Virtuemart 1.2 :)

Of note, GregDev's work does not include the extra information/coding to show the images on the product flypage nor in the manufacturers pop up. My work provides global variables to call in the flypage allowing the manufacturer logo to be displayed and allow the manu thumb image to be shown in the pop up.

The differences between Greg's work and mine where minor. The only changes were to some code within the manufacturer form and proper coding of the class functions (mainly logger).

I also made the tab look like the product image upload tab. Just a style thing for consistancy.

PLEASE BACK UP ALL WORK BEFORE APPLYING THIS MODIFICATION

Enjoy :)

Cheers
Dave

--------

What this does:
Allows a manufacturer image to be shown in the manufacturer pop up and on the product flypage.

Things to do:

1. Add entries into the database for mf_thumb_image, mf_full_image
2. Add new folder called manufacturer under:
administrator/components/com_virtuemart/shop_image/
3. Turn on "Show Manufacturer Link" under Configuration -> Site -> Layout/Theme Configuration

(same place as product images)

Files to modify:

administrator/components/com_virtuemart/classes/ps_manufacturer.php

administrator/components/com_virtuemart/classes/ps_product.php

administrator/components/com_virtuemart/html/manufacturer.manufacturer_form.php

administrator/components/com_virtuemart/html/shop.product_details.php

administrator/components/com_virtuemart/html/shop.manufacturer_page.php

components/com_virtuemart/themes/default/templates/product_details/flypage.tpl.php (or whatever your flypage is)

components/com_virtuemart/themes/default/templates/pages/shop.maunfacturer.tpl.php

SQL:

Adds mf_full_image and mf_thumb_image to the manufacturer table

Code: [Select]
ALTER TABLE `jos_vm_manufacturer` ADD `mf_thumb_image` VARCHAR( 255 ) NULL DEFAULT NULL AFTER `mf_desc` ,
ADD `mf_full_image` VARCHAR( 255 ) NULL DEFAULT NULL AFTER `mf_thumb_image` ;

Tip:
I am rather pedantic when it comes to images. In this case, I have saved my logos as either .gif or .png with an alpha transperancy. This allows for background colour to show behind the image.

Try a border or a complimentary colour as the back ground for your logos if you don't want to use a transparent background like I have. I tend to like consistancy between pages when I view them so small things like these make your site that much more professional  ;)

File attachment:
All 5 important files to change excl flypage.tpl.php

Images:

Additional Tab:
(http://i60.photobucket.com/albums/h32/Dee_Cee23/virtuemart/manufacturer_logo_1.jpg)

Inside tab:
(http://i60.photobucket.com/albums/h32/Dee_Cee23/virtuemart/manufacturer_logo_2.jpg)

Uploaded images (full and thumb):

(http://i60.photobucket.com/albums/h32/Dee_Cee23/virtuemart/manufacturer_logo_3.jpg)

Full image on flypage link and standard logo:

(http://i60.photobucket.com/albums/h32/Dee_Cee23/virtuemart/manufacturer_logo_4.jpg)

Thumb image on manufacturer pop up:

(http://i60.photobucket.com/albums/h32/Dee_Cee23/virtuemart/manufacturer_logo_5.jpg)

[attachment cleanup by admin]
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on February 03, 2009, 09:37:30 am
ps_manufacturer

declare the classes to call within ps_manufacturer

Code: [Select]
<?php
if( !defined'_VALID_MOS' ) && !defined'_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
/**
*
* @version $Id: ps_manufacturer.php 1513 2008-08-16 19:02:37Z gregdev $
* @package VirtueMart
* @subpackage classes
* @copyright Copyright (C) 2004-2008 soeren - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/

/**
 * The class is is used to manage the manufacturers in your store.
 *
 */
class ps_manufacturer {

/**
 * Validates the Input Parameters onBeforeManufacturerAdd
 *
 * @param array $d
 * @return boolean
 */
function validate_add(&$d) {
global $VM_LANG;
require_once(CLASSPATH 'imageTools.class.php' );
$valid true;
$db = new ps_DB;

if (empty($d["mf_name"])) {
$GLOBALS['vmLogger']->err$VM_LANG->_('VM_MANUF_ERR_NAME') );
$valid false;
}
else {
$q "SELECT count(*) as rowcnt from #__{vm}_manufacturer where";
$q .= " mf_name='" .  $db->getEscaped($d["mf_name"]) . "'";
$db->query($q);
$db->next_record();
if ($db->f("rowcnt") > 0) {
$GLOBALS['vmLogger']->err$VM_LANG->_('VM_MANUF_ERR_EXISTS') );
$valid false;
}
}

/** Image Upload Validation **/

// do we have an image URL or an image File Upload?
if (!empty( $d['mf_thumb_image_url'] )) {
// Image URL
if (substr$d['mf_thumb_image_url'], 04) != "http") {
$GLOBALS['vmLogger']->err$VM_LANG->_('VM_PRODUCT_IMAGEURL_MUSTBEGIN') );
$valid =  false;
}

$d["mf_thumb_image"] = $d['mf_thumb_image_url'];
}
else {
// File Upload
if (!vmImageTools::validate_image$d"mf_thumb_image""manufacturer")) {
$valid false;
}
}

if (!empty( $d['mf_full_image_url'] )) {
// Image URL
if (substr$d['mf_full_image_url'], 04) != "http") {
$GLOBALS['vmLogger']->err$VM_LANG->_('VM_PRODUCT_IMAGEURL_MUSTBEGIN') );
return false;
}
$d["mf_full_image"] = $d['mf_full_image_url'];
}
else {
// File Upload
if (!vmImageTools::validate_image$d"mf_full_image""manufacturer")) {
$valid false;
}
}
return $valid;
}
/**
 * Validates the Input Parameters onBeforeManufacturerUpdsate
 *
 * @param array $d
 * @return boolean
 */
function validate_update(&$d) {
global $VM_LANG;
$valid true;
require_once(CLASSPATH 'imageTools.class.php' );

if (empty($d["mf_name"])) {
$GLOBALS['vmLogger']->err$VM_LANG->_('VM_MANUF_ERR_NAME') );
$valid =  false;
}

$db = new ps_DB;
$q 'SELECT mf_thumb_image, mf_full_image FROM #__{vm}_manufacturer WHERE manufacturer_id='. (int) $d["manufacturer_id"];
$db->query$q );
$db->next_record();

/** Image Upload Validation **/

// do we have an image URL or an image File Upload?
if (!empty( $d['mf_thumb_image_url'] )) {
// Image URL
if (substr$d['mf_thumb_image_url'], 04) != "http") {
$GLOBALS['vmLogger']->err$VM_LANG->_('VM_PRODUCT_IMAGEURL_MUSTBEGIN') );
$valid =  false;
}

// if we have an uploaded image file, prepare this one for deleting.
if( $db->f("mf_thumb_image") && substr$db->f("mf_thumb_image"), 04) != "http") {
$_REQUEST["mf_thumb_image_curr"] = $db->f("product_thumb_image");
$d["mf_thumb_image_action"] = "delete";
if (!vmImageTools::validate_image$d"product_thumb_image""manufacturer")) {
return false;
}
}
$d["mf_thumb_image"] = $d['mf_thumb_image_url'];
}
else {
// File Upload
if (!vmImageTools::validate_image$d"mf_thumb_image""manufacturer")) {
$valid false;
}
}

if (!empty( $d['mf_full_image_url'] )) {
// Image URL
if (substr$d['mf_full_image_url'], 04) != "http") {
$GLOBALS['vmLogger']->err$VM_LANG->_('VM_PRODUCT_IMAGEURL_MUSTBEGIN') );
return false;
}
// if we have an uploaded image file, prepare this one for deleting.
if( $db->f("mf_full_image") && substr$db->f("mf_thumb_image"), 04) != "http") {
$_REQUEST["mf_full_image_curr"] = $db->f("mf_full_image");
$d["mf_full_image_action"] = "delete";
if (!vmImageTools::validate_image$d"mf_full_image""manufacturer")) {
return false;
}
}
$d["mf_full_image"] = $d['mf_full_image_url'];
}
else {
// File Upload
if (!vmImageTools::validate_image$d"mf_full_image""manufacturer")) {
$valid false;
}
}

return $valid;
}
/**
 * Validates the Input Parameters onBeforeManufacturerDelete
 *
 * @param array $d
 * @return boolean
 */
function validate_delete($mf_id, &$d) {
global $VM_LANG;
$db = new ps_DB();
require_once(CLASSPATH 'imageTools.class.php' );

$mf_id = (int) $mf_id;

if (empty( $mf_id )) {
$GLOBALS['vmLogger']->err$VM_LANG->_('VM_MANUF_ERR_DELETE_SELECT') );
return False;
}

$db->query"SELECT `#__{vm}_product`.product_id, manufacturer_id   FROM `#__{vm}_product`, `#__{vm}_product_mf_xref` WHERE manufacturer_id =".intval($mf_id)." AND `#__{vm}_product`.product_id = `#__{vm}_product_mf_xref`.product_id" );
if( $db->num_rows() > ) {
$GLOBALS['vmLogger']->err$VM_LANG->_('VM_MANUF_ERR_DELETE_STILLPRODUCTS') );
return false;
}

$q "SELECT mf_thumb_image,mf_full_image FROM #__{vm}_manufacturer WHERE manufacturer_id='$mf_id'";
$db->query$q );
$db->next_record();

/* Prepare mf_thumb_image for Deleting */
if( !stristr$db->f("mf_thumb_image"), "http") ) {
$_REQUEST["mf_thumb_image_curr"] = $db->f("mf_thumb_image");
$d["mf_thumb_image_action"] = "delete";
if (!vmImageTools::validate_image($d,"mf_thumb_image","category")) {
$GLOBALS['vmLogger']->err$VM_LANG->_('VM_PRODUCT_MANUFACTURER_ERR_DELETE_IMAGES') );
return false;
}
}
/* Prepare product_full_image for Deleting */
if( !stristr$db->f("mf_full_image"), "http") ) {
$_REQUEST["mf_full_image_curr"] = $db->f("mf_full_image");
$d["mf_full_image_action"] = "delete";
if (!vmImageTools::validate_image($d,"mf_full_image","category")) {
return false;
}
}

return True;

}

/**
 * creates a new manufacturer record
 *
 * @param array $d
 * @return boolean
 */
function add(&$d) {
global $VM_LANG;

$db = new ps_DB;

if (!$this->validate_add($d)) {
return false;
}

// Check the images
if (!vmImageTools::process_images($d)) {
return false;
}

$fields = array( 'mf_name' => vmGet$d'mf_name' ),
'mf_email' => vmGet$d'mf_email' ),
'mf_desc' => vmGet$d'mf_desc'''VMREQUEST_ALLOWHTML ),
'mf_category_id' => vmRequest::getInt('mf_category_id'),
'mf_url' => vmGet$d'mf_url'),
'mf_thumb_image' => vmGet$d'mf_thumb_image' ),
'mf_full_image' => vmGet$d'mf_full_image' )
);

$db->buildQuery('INSERT''#__{vm}_manufacturer'$fields );
if( $db->query() !== false ) {
$GLOBALS['vmLogger']->info$VM_LANG->_('VM_MANUF_ADDED') );
$_REQUEST['manufacturer_id'] = $db->last_insert_id();
return true;
}
return false;

}

/**
 * updates manufacturer information
 *
 * @param array $d
 * @return boolean
 */
function update(&$d) {
global $VM_LANG;

$db = new ps_DB;

if (!$this->validate_update($d)) {
return False;
}

// Check the images
if (!vmImageTools::process_images($d)) {
return false;
}

$fields = array( 'mf_name' => vmGet$d'mf_name' ),
'mf_email' => vmGet$d'mf_email' ),
'mf_desc' => vmGet$d'mf_desc'''VMREQUEST_ALLOWHTML ),
'mf_category_id' => vmRequest::getInt('mf_category_id'),
'mf_url' => vmGet$d'mf_url'),
'mf_thumb_image' => vmGet$d'mf_thumb_image' ),
'mf_full_image' => vmGet$d'mf_full_image' )
);
$db->buildQuery('UPDATE''#__{vm}_manufacturer'$fields'WHERE manufacturer_id='.(int)$d["manufacturer_id"] );
if( $db->query() ) {
$GLOBALS['vmLogger']->info$VM_LANG->_('VM_MANUF_UPDATED') );
return true;
}
return false;
}

/**
* Controller for Deleting Records.
*/
function delete(&$d) {

$record_id $d["manufacturer_id"];

if( is_array$record_id)) {
foreach( $record_id as $record) {
if( !$this->delete_record$record$d ))
return false;
}
return true;
}
else {
return $this->delete_record$record_id$d );
}
}
/**
* Deletes one Record.
*/
function delete_record$record_id, &$d ) {
global $db;
if (!$this->validate_delete($record_id$d)) {
return False;
}
$q 'DELETE from #__{vm}_product_mf_xref WHERE manufacturer_id='.(int)$record_id.' LIMIT 1';
$db->query($q);
$q 'DELETE from #__{vm}_manufacturer WHERE manufacturer_id='.(int)$record_id.' LIMIT 1';
$db->query($q);

// Delete the image files
if (!vmImageTools::process_images($d)) {
return false;
}

return True;
}
/**
 * Prints a drop-down list of manufacturer names and their ids.
 *
 * @param int $manufacturer_id
 */
function list_manufacturer($manufacturer_id='0') {

$db = new ps_DB;

$q "SELECT manufacturer_id as id,mf_name as name FROM #__{vm}_manufacturer ORDER BY mf_name";
$db->query($q);
$db->next_record();

// If only one vendor do not show list
if ($db->num_rows() == 1) {

echo '<input type="hidden" name="manufacturer_id" value="'$db->f("id").'" />';
echo $db->f("name");
}
elseif( $db->num_rows() > 1) {
$db->reset();
$array = array();
while ($db->next_record()) {
$array[$db->f("id")] = $db->f("name");
}
$code ps_html::selectList('manufacturer_id'$manufacturer_id$array ). "<br />\n";
echo $code;
}
else  {
echo '<input type="hidden" name="manufacturer_id" value="1" />Please create at least one Manufacturer!!';
}
}
}

?>

Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on February 03, 2009, 09:37:56 am
ps_product.php

declare the classes to call within ps_product

after function get_mf_name($product_id) (approx line 1257)

Code: [Select]
/**
* Functon to get the image of the manufacturer this product is assigned to
*
* @param int $product_id
* @return string the manufacturer image
* added
*/
function get_mf_full_image($product_id) {

$db = new ps_DB;
$childs = array();

$q = "SELECT mf_full_image,#__{vm}_manufacturer.manufacturer_id 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();
if ($db->f("mf_full_image")) {
return $db->f("mf_full_image");
}
else {
return "";
}
}
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on February 03, 2009, 09:38:30 am
manufacturer.manufacturer_form.php

add the images upload tab to manufacturers

Code: [Select]
<?php 
if( !defined'_VALID_MOS' ) && !defined'_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); 
/**
*
* @version $Id: manufacturer.manufacturer_form.php 1095 2007-12-19 20:19:16Z soeren_nb $
* @package VirtueMart
* @subpackage html
* @copyright Copyright (C) 2004-2007 soeren - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
mm_showMyFileName__FILE__ );

global 
$ps_manufacturer_category$ps_product;
include_class('product');
$manufacturer_id vmRequest::getInt'manufacturer_id');
$option = empty($option)?vmGet$_REQUEST'option''com_virtuemart'):$option;

if (!empty(
$manufacturer_id)) {
  
$q "SELECT * FROM #__{vm}_manufacturer WHERE manufacturer_id='$manufacturer_id'"
  
$db->query($q);  
  
$db->next_record();
}
//First create the object and let it print a form heading
$formObj = &new formFactory$VM_LANG->_('PHPSHOP_MANUFACTURER_FORM_LBL') );
//Then Start the form
$formObj->startForm('adminForm''enctype="multipart/form-data"');

$tabs = new vmTabPanel(01"manufacturerform");
$tabs->startPane("manufacturer-pane");
$tabs->startTab"<img src='"IMAGEURL ."ps_image/edit.png' align='absmiddle' width='16' height='16' border='0' /> ".$VM_LANG->_('PHPSHOP_MANUFACTURER_FORM_LBL'), "info-page");
?>

<br />
  <table class="adminform">
  <tr>
      <td><strong><?php echo $VM_LANG->_('PHPSHOP_MANUFACTURER_FORM_INFO_LBL'?></strong></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td align="right"><?php echo $VM_LANG->_('PHPSHOP_MANUFACTURER_LIST_MANUFACTURER_NAME'?></td>
      <td>
        <input type="text" class="inputbox" name="mf_name" value="<?php $db->sp("mf_name"?>" size="16" />
      </td>
    </tr>
    <tr>
      <td width="22%" align="right" ><?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_URL'?>:</td>
      <td width="78%" >
        <input type="text" class="inputbox" name="mf_url" value="<?php $db->sp("mf_url"?>" size="32" />
      </td>
    </tr>
    <tr>
      <td align="right"><?php echo $VM_LANG->_('PHPSHOP_MANUFACTURER_FORM_CATEGORY'?>:</td>
      <td ><?php $ps_manufacturer_category->list_category($db->f("mf_category_id"));     ?></td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td >&nbsp;</td>
    </tr>
    <tr>
      <td align="right" ><?php echo $VM_LANG->_('PHPSHOP_MANUFACTURER_FORM_EMAIL'?>:</td>
      <td>
        <input type="text" class="inputbox" name="mf_email" value="<?php $db->sp("mf_email"?>" size="18" />
      </td>
    </tr>
    <tr>
      <td align="right" >&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td width="22%" align="right"  valign="top"><?php echo $VM_LANG->_('PHPSHOP_MANUFACTURER_FORM_DESCRIPTION'?>:</td>
      <td width="78%" ><?php
editorArea'editor1'$db->f("mf_desc"), 'mf_desc''300''150''70''25' )
?>

      </td>
    <tr align="center">
      <td colspan="2" >&nbsp;</td>
    </tr>
</table>
<?php
$tabs
->endTab();
$tabs->startTab"<img src='"IMAGEURL ."ps_image/image.png' width='16' height='16' align='absmiddle' border='0' /> ".$VM_LANG->_('E_IMAGES'), "images-page");

if( !
stristr$db->f("mf_thumb_image"), "http") )
  echo 
"<input type=\"hidden\" name=\"mf_thumb_image_curr\" value=\""$db->f("mf_thumb_image") ."\" />";

if( !
stristr$db->f("mf_full_image"), "http") )
  echo 
"<input type=\"hidden\" name=\"mf_full_image_curr\" value=\""$db->f("mf_full_image") ."\" />";
 
  
$ps_html->writableIndicator( array( IMAGEPATH."manufacturer") );
?>

  <table class="adminform" >
    <tr>
      <td valign="top" width="50%" style="border-right: 1px solid black;">
        <h2><?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_FULL_IMAGE'?></h2>
        <table class="adminform">
          <tr class="row0">
            <td colspan="2" ><?php 
            
if ($manufacturer_id) {
                echo 
$VM_LANG->_('PHPSHOP_PRODUCT_FORM_IMAGE_UPDATE_LBL') . "<br />"; } ?>

              <input type="file" class="inputbox" name="mf_full_image" size="50" maxlength="255" />
              </td>
          </tr>
          <tr class="row1">
            <td colspan="2" ><div style="font-weight:bold;"><?php echo $VM_LANG->_('PHPSHOP_IMAGE_ACTION'?>:</div><br/>
              <input type="radio" class="inputbox" name="mf_full_image_action" id="mf_full_image_action0" checked="checked" value="none" onchange="toggleDisable( document.adminForm.mf_full_image_action[1], document.adminForm.mf_thumb_image, true );toggleDisable( document.adminForm.mf_full_image_action[1], document.adminForm.mf_thumb_image_url, true );"/>
              <label for="mf_full_image_action0"><?php echo $VM_LANG->_('PHPSHOP_NONE'?></label><br/>
              <?php
              
// Check if GD library is available - creates image
              
if( function_exists('imagecreatefromjpeg')) { ?>

              <input type="radio" class="inputbox" name="mf_full_image_action" id="mf_full_image_action1" value="auto_resize" onchange="toggleDisable( document.adminForm.mf_full_image_action[1], document.adminForm.mf_thumb_image, true );toggleDisable( document.adminForm.mf_full_image_action[1], document.adminForm.mf_thumb_image_url, true );"/>
              <label for="mf_full_image_action1"><?php echo $VM_LANG->_('PHPSHOP_FILES_FORM_AUTO_THUMBNAIL') . "</label><br />"
              }
              if (
$manufacturer_id and $db->f("mf_full_image")) { ?>

                <input type="radio" class="inputbox" name="mf_full_image_action" id="mf_full_image_action2" value="delete" onchange="toggleDisable( document.adminForm.mf_full_image_action[1], document.adminForm.mf_thumb_image, true );toggleDisable( document.adminForm.mf_full_image_action[1], document.adminForm.mf_thumb_image_url, true );"/>
                <label for="mf_full_image_action2"><?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_IMAGE_DELETE_LBL') . "</label><br />"
              } 
?>

            </td>
          </tr>
          <tr class="row0"><td colspan="2">&nbsp;</td></tr>
          <tr class="row0">
            <td width="21%" ><?php echo $VM_LANG->_('URL')." (".$VM_LANG->_('CMN_OPTIONAL')."!)&nbsp;"?></td>
            <td width="79%" >
              <?php 
              
if( stristr($db->f("mf_full_image"), "http") )
                
$mf_full_image_url $db->f("mf_full_image");
              else if(!empty(
$_REQUEST['mf_full_image_url']))
                
$mf_full_image_url vmGet($_REQUEST'mf_full_image_url');
              else
                
$mf_full_image_url "";
              
?>

              <input type="text" class="inputbox" size="50" name="mf_full_image_url" value="<?php echo $mf_full_image_url ?>" onchange="if( this.value.length>0) document.adminForm.auto_resize.checked=false; else document.adminForm.auto_resize.checked=true; toggleDisable( document.adminForm.auto_resize, document.adminForm.mf_thumb_image_url, true );toggleDisable( document.adminForm.auto_resize, document.adminForm.mf_thumb_image, true );" />
            </td>
          </tr>
          <tr class="row1"><td colspan="2">&nbsp;</td></tr>
          <tr class="row1">
            <td colspan="2" >
              <div style="overflow:auto;">
                <?php echo $ps_product->image_tag($db->f("mf_full_image"), ""0"manufacturer"); ?>
              </div>
            </td>
          </tr>
        </table>
      </td>

      <td valign="top" width="50%">
        <h2><?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_THUMB_IMAGE'?></h2>
        <table class="adminform">
          <tr class="row0">
            <td colspan="2" ><?php if ($manufacturer_id) {
                echo 
$VM_LANG->_('PHPSHOP_PRODUCT_FORM_IMAGE_UPDATE_LBL') . "<br />"; } ?>

              <input type="file" class="inputbox" name="mf_thumb_image" size="50" maxlength="255" onchange="if(document.adminForm.mf_thumb_image.value!='') document.adminForm.mf_thumb_image_url.value='';" />
            </td>
          </tr>
          <tr class="row1">
            <td colspan="2" ><div style="font-weight:bold;"><?php echo $VM_LANG->_('PHPSHOP_IMAGE_ACTION'?>:</div><br/>
              <input type="radio" class="inputbox" id="mf_thumb_image_action0" name="mf_thumb_image_action" checked="checked" value="none" onchange="toggleDisable( document.adminForm.image_action[1], document.adminForm.mf_thumb_image, true );toggleDisable( document.adminForm.image_action[1], document.adminForm.mf_thumb_image_url, true );"/>
              <label for="mf_thumb_image_action0"><?php echo $VM_LANG->_('PHPSHOP_NONE'?></label><br/>
              <?php 
              
if ($manufacturer_id and $db->f("mf_thumb_image")) { ?>

                <input type="radio" class="inputbox" id="mf_thumb_image_action1" name="mf_thumb_image_action" value="delete" onchange="toggleDisable( document.adminForm.image_action[1], document.adminForm.mf_thumb_image, true );toggleDisable( document.adminForm.image_action[1], document.adminForm.mf_thumb_image_url, true );"/>
                <label for="mf_thumb_image_action1"><?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_IMAGE_DELETE_LBL') . "</label><br />";  
              } 
?>

            </td>
          </tr>
          <tr class="row0"><td colspan="2">&nbsp;</td></tr>
          <tr class="row0">
            <td width="21%" ><?php echo $VM_LANG->_('URL')." (".$VM_LANG->_('CMN_OPTIONAL').")&nbsp;"?></td>
            <td width="79%" >
              <?php 
              
if( stristr($db->f("mf_thumb_image"), "http") )
                
$mf_thumb_image_url $db->f("mf_thumb_image");
              else if(!empty(
$_REQUEST['mf_thumb_image_url']))
                
$mf_thumb_image_url vmGet($_REQUEST'mf_thumb_image_url');
              else
                
$mf_thumb_image_url "";
              
?>

              <input type="text" class="inputbox" size="50" name="mf_thumb_image_url" value="<?php echo $mf_thumb_image_url ?>" />
            </td>
          </tr>
          <tr class="row1"><td colspan="2">&nbsp;</td></tr>
          <tr class="row1">
            <td colspan="2" >
              <div style="overflow:auto;">
                <?php 
                 echo 
$ps_product->image_tag($db->f("mf_thumb_image"), ""0"manufacturer");
                
?>

              </div>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
<?php
$tabs
->endPane();

// Add necessary hidden fields
$formObj->hiddenField'manufacturer_id'$manufacturer_id );
  
$funcname = !empty($manufacturer_id) ? "manufacturerupdate" "manufactureradd";
// Write your form with mixed tags and text fields
// and finally close the form:
$formObj->finishForm$funcname$modulename.'.manufacturer_list'$option );
?>

<script type="text/javascript">//<!--
function toggleDisable( elementOnChecked, elementDisable, disableOnChecked ) {
  if( !disableOnChecked ) {
    if(elementOnChecked.checked==true) {
      elementDisable.disabled=false;
    }
    else {
      elementDisable.disabled=true;
    }
  }
  else {
    if(elementOnChecked.checked==true) {
      elementDisable.disabled=true;
    }
    else {
      elementDisable.disabled=false;
    }
  }
}

toggleDisable( document.adminForm.mf_full_image_action[1], document.adminForm.mf_thumb_image, true );
//-->
</script>
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on February 03, 2009, 09:38:52 am
shop.product_details.php

declare the variables to call for the flypage - linked logo and standard logo
(approx line 249)

Code: [Select]
// LINK TO MANUFACTURER POP-UP
$manufacturer_id = $ps_product->get_manufacturer_id($product_id);
$manufacturer_name = $ps_product->get_mf_name($product_id);
$manufacturer_image = $ps_product->get_mf_full_image($product_id); //added
$manufacturer_link = "";
if( $manufacturer_id && !empty($manufacturer_name) ) {
$link = "$mosConfig_live_site/index2.php?page=shop.manufacturer_page&amp;manufacturer_id=$manufacturer_id&amp;output=lite&amp;option=com_virtuemart&amp;Itemid=".$Itemid;
if (!empty($manufacturer_image))
{
$text = '<img src="/components/com_virtuemart/shop_image/manufacturer/'.$manufacturer_image.'" alt="'.$manufacturer_name.'" title="'.$manufacturer_name.'" align="top" border="0" style="margin-bottom:4px;"><br>';
}
else {
$text = '( '.$manufacturer_name.' )';
}
$manufacturer_link .= vmPopupLink( $link, $text );

// Avoid JavaScript on PDF Output
if( @$_REQUEST['output'] == "pdf" )
$manufacturer_link = "<a href=\"$link\" target=\"_blank\" title=\"$manufacturer_name\">$text</a>";
}
// LINK TO MANUFACTURER LOGO
$manufacturer_logo = "";
if( $manufacturer_id && !empty($manufacturer_name) ) {
if (!empty($manufacturer_image))
{
$logo = '<img src="/components/com_virtuemart/shop_image/manufacturer/'.$manufacturer_image.'" alt="'.$manufacturer_name.'" title="'.$manufacturer_name.'" align="top" border="0"><br />';
}
else {
$logo = '( '.$manufacturer_name.' )';
}
$manufacturer_logo .= ( $logo );
}

line 427 - set the variable for the flypage ( dev reference themes and templates http://dev.virtuemart.net/cb/wiki/1367 )

Code: [Select]
$tpl->set( "manufacturer_logo", $manufacturer_logo ); //added
----------

shop.manufacturer_page.php

find image tags in database related to Manu ID and display on manufacturer pop up page

Code: [Select]
mm_showMyFileName( __FILE__ );

$manufacturer_id = intval( vmGet( $_GET, 'manufacturer_id' ));

if( !empty( $manufacturer_id ) ) {
$q  = "SELECT * FROM `#__{vm}_manufacturer` WHERE "; //added
$q .= "`manufacturer_id`=$manufacturer_id";
$db->query($q);
if( !$db->next_record() ) {
return;
}

$mf_name=$db->f("mf_name");
$mf_email=$db->f("mf_email");
$mf_desc=$db->f("mf_desc");
$mf_url = $db->f("mf_url");
$mf_thumb_image = $db->f("mf_thumb_image"); //added
$mf_full_image = $db->f("mf_full_image"); //added

$tpl = vmTemplate::getInstance();
$tpl->set_vars(array('mf_name'=>$db->f("mf_name"),
'mf_email' => $db->f("mf_email"),
'mf_desc' => $db->f("mf_desc"),
'mf_url' => $db->f("mf_url"),
'mf_thumb_image' => $db->f("mf_thumb_image"), //added
'mf_full_image' => $db->f("mf_full_image"), //added
'db' => $db
)
);
echo $tpl->fetch('pages/shop.manufacturer.tpl.php');

}
?>
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on February 03, 2009, 09:39:48 am
shop_manufacturer.tpl.php

shows the thumbnail manufacturer image in the manufacturer pop up.

Code: [Select]
mm_showMyFileName( __FILE__ );
?>
<h3><?php echo $mf_name;?></h3>
 
  <table align="center"cellspacing="0" cellpadding="0" border="0">
      <tr valign="top">
        <th colspan="2" align="center"class="sectiontableheader">
          <strong><?php echo $VM_LANG->_('PHPSHOP_MANUFACTURER_FORM_INFO_LBL'?></strong>        </th>
      </tr>
      <tr valign="top">
        <td align="center"colspan="2"><br />
          <?php echo "&nbsp;" $mf_name "<br />"?>
          <br /><br />        </td>
      </tr>
 
      <tr>
        <td valign="top" align="center"colspan="2">
        <img src="components/com_virtuemart/shop_image/manufacturer/<?php echo $mf_thumb_image ?>" /><br />
            <br /><?php echo $VM_LANG->_('PHPSHOP_STORE_FORM_EMAIL'?>:&nbsp;
            <a href="mailto:<?php echo $mf_email?>"><?php echo $mf_email?></a>         
            <br /><a href="<?php echo $mf_url ?>" target="_blank"><?php echo $mf_url ?></a><br />        </td>

    </tr>
      <tr>
        <td valign="top" align="left" colspan="2">
            <br /><?php echo $mf_desc ?><br />        </td>
      </tr>
  </table>

-------

flypage.tpl.php

place inside flypage template to call the variable

_link = manufacturer logo with link to pop up

Code: [Select]
      <?php echo $manufacturer_link ?>

or

_logo = manufacturer logo by itself

Code: [Select]
      <?php echo $manufacturer_logo ?>
Title: Re: Manufacturer Logo - Finally Finished
Post by: xenio on February 09, 2009, 13:31:35 pm
Does not works for me. Joomla 1.5.9 with VM 1.1.3

I have replaced the 5 files in the zip and I add the field in the database
but I get nothing from the <?php echo $mf_thumb_image ?> just a empty string
if I go the the jos_vm_manufacturer table in the database the mf_thumb_image and mf_full_image fields contains the image indication.
Xenio

EDIT: I have the exacly same problem that Pixell have got.
Title: Re: Manufacturer Logo - Finally Finished
Post by: Pixell on February 09, 2009, 15:34:58 pm
Nope... doesn't work for me either   :-[

When I upload a logo in the new tab...  it doesn't show the thumbnails there, and I get no error messages. When I then look in the folder "shop_image>manufacturer" it has created two files where one of them is the resized:

a65eac3ffd1ad679a260aac9aa33627d_49903ab51413b.jpg
a65eac3ffd1ad679a260aac9aa33627d_49903ab5133ae.jpg

And... It creates even an extra copy of the resized version in the folder "shop_image>manufacturer>resized":

a65eac3ffd1ad679a260aac9aa33627d_49903ab5135c7_100x100.jpg

They seem to be okey there... I can open them, view them etc. But they only show as Manufacture name as "text" in the flypage.

Any ideas?
I also use Joomla 1.5.9 with VM 1.1.3

Thanks for the good work so far! ;D
Title: Re: Manufacturer Logo - Finally Finished
Post by: msilac on February 09, 2009, 16:05:14 pm
Is there simple solution like just copy this files over this files and this is it :)
Title: Re: Manufacturer Logo - Finally Finished
Post by: xenio on February 10, 2009, 16:24:15 pm
Looks like it is working better with the online version of my site, with the localhost there is no manufacturer logos, but Online it is working...
Title: Re: Manufacturer Logo - Finally Finished
Post by: Pixell on February 10, 2009, 21:27:20 pm
Interesting... I'll try that. Wonder why that is?
Title: Re: Manufacturer Logo - Finally Finished
Post by: xenio on February 13, 2009, 11:55:35 am
Online version get the full image but I get nothing from this:

$mf_thumb_image

I would like to show the small version of the manufacturer logo and not the full image.

$manufacturer_link
shows the full image or the link if the images is not loaded, but I like to have the thumbs!

Any Idea?
Title: Re: Manufacturer Logo - Finally Finished
Post by: Pixell on February 13, 2009, 17:14:30 pm
About the part that a duplicate thumb file is being created in same folder as the large... This is not because of this hack.
I did a fresh install... and it did the same, I have open a topic about it here:

http://forum.virtuemart.net/index.php?topic=51644.0
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on February 15, 2009, 12:24:52 pm
Online version get the full image but I get nothing from this:

$mf_thumb_image

I would like to show the small version of the manufacturer logo and not the full image.

$manufacturer_link
shows the full image or the link if the images is not loaded, but I like to have the thumbs!

Any Idea?


The product page only shows the full image, not the thumb image.
It sounds like you want to have a smaller picture on the flypage, so as a solution, you can manually resize your photo and use a smaller image on the flypage instead of a "full size" image.
I'll look at adding the thumb image as an option.

Nope... doesn't work for me either   :-[

When I upload a logo in the new tab...  it doesn't show the thumbnails there, and I get no error messages. When I then look in the folder "shop_image>manufacturer" it has created two files where one of them is the resized:

a65eac3ffd1ad679a260aac9aa33627d_49903ab51413b.jpg
a65eac3ffd1ad679a260aac9aa33627d_49903ab5133ae.jpg

And... It creates even an extra copy of the resized version in the folder "shop_image>manufacturer>resized":

a65eac3ffd1ad679a260aac9aa33627d_49903ab5135c7_100x100.jpg

They seem to be okey there... I can open them, view them etc. But they only show as Manufacture name as "text" in the flypage.

Any ideas?
I also use Joomla 1.5.9 with VM 1.1.3

Thanks for the good work so far! ;D

Pixell: The duplicate thumb is a known issue.

As for working on local host, it works fine for me on localhost / local server.
Are you using cache of any sort? If so, you may need to clear cache and reload.

Is there simple solution like just copy this files over this files and this is it :)
I am somewhat hesitant to provide a straight copy and replace.
The reason being that you or your web designer may have modified various files or included specific hard coded hacks that would be wiped if you did a straight replacement of your files. I also have changed my files to suit what I need, so what I have may not be suitable for you eg the flypage.

Find my post with the pictures in it on the first page. There is a zip file of relevent files to drop in place of the older files. Then all that is required is to add information to the flypage.

Thanks for the feedback people :)
It allows me to work out the bugs

Cheers
Dave

Edit: Pixell.. that "bug" with the duplicate thumbs... I know the cause ;)

Having a quick think about it, I did encounter it when I first started this. Its related to the upload form which was the code taken from GregDev's work.
I'll revert back to my old code which doesn't have the duplicate thumb and it should all be sweet - will test out over the next week when I have time :)
Title: Re: Manufacturer Logo - Finally Finished
Post by: xenio on February 15, 2009, 12:50:03 pm
Quote
The product page only shows the full image, not the thumb image.
It sounds like you want to have a smaller picture on the flypage, so as a solution, you can manually resize your photo and use a smaller image on the flypage instead of a "full size" image.
I'll look at adding the thumb image as an option.

I am a little bit confused...
In the line 35 of shop.manufacturer.tpl.php there is this code:
<img src="components/com_virtuemart/shop_image/manufacturer/<?php echo $mf_thumb_image ?>" />

and in the screenshot of your post there is a thumb of manufacturer logo.
I would like to have the thumb in the flypage, using that variable $mf_thumb_image, the thumb is already created and inserted in the database, but I get an empty string from that variable, in local and live versione of the site.
If the thumbs is created and in the database I don't know where the problem is.
Any Help?
Xenio




Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on February 15, 2009, 22:26:49 pm
because the variable hasn't been set to show the thumb image in the flypage. The thumb image you have referenced is the manufacturer pop up.

Seperating the thumb image away from the full image on the product flypage allows for distinction between the two images.

Its just like teh distinction between a thumb product image and a full product image. A full product image is not shown on the flypage, the thumb image is. Same goes here, but in reverse though.

I'll customise something to you needs though I don't necessarily think its a good thing to do. Just don't complain when you can't use full manufacturer images on the flypage as well.
Title: Re: Manufacturer Logo - Finally Finished
Post by: derek webster on February 18, 2009, 15:01:17 pm
I just noticed that this is missing from shop.product_details.php

Code: [Select]
$tpl->set( "manufacturer_logo", $manufacturer_logo );
around line 444

As soon as I added this my logo appeared

Hope this helps
Title: Re: Manufacturer Logo - Finally Finished
Post by: msilac on March 25, 2009, 13:04:50 pm
Is there simple solution like just copy this files over this files and this is it :)
Quote
I am somewhat hesitant to provide a straight copy and replace.
The reason being that you or your web designer may have modified various files or included specific hard coded hacks that would be wiped if you did a straight replacement of your files. I also have changed my files to suit what I need, so what I have may not be suitable for you eg the flypage.

Find my post with the pictures in it on the first page. There is a zip file of relevent files to drop in place of the older files. Then all that is required is to add information to the flypage.

Ok... I Have clean installation of 1.1.3 VM on Joomla 1.5.9

I was copy paste 5 files of yours + edited my flypage.tpl.php with your code.

When i am in administration (Manufacturer administration) --> new (fill all field, try to upload picture)...

Error: You must enter a name for the manufacturer.

Is there something that i missing it?
Title: Re: Manufacturer Logo - Finally Finished
Post by: msilac on March 26, 2009, 23:51:10 pm
I can not created new manufacturer now...Help!?
Title: Re: Manufacturer Logo - Finally Finished
Post by: mattfrench on April 07, 2009, 09:24:36 am
Thank You, Thank You, Thank You!!!

Exactly what I needed.  I used it on VM 1.1.2 and it worked perfectly first time.

Fantastic and much needed hack.

Thank you again!
Title: Re: Manufacturer Logo - Finally Finished
Post by: NordicElf on April 15, 2009, 19:29:59 pm
This is awesome. Thank you! It's working perfectly. However:
I want to add the manufacturer logo to my browse_x.php page too. I think I'm missing a step somewhere. I copied the code from shop.product_details.php to shop.browse, inlcuding the tpl->set, and I used the $manufacturer_logo in my browse page but nothing shows up just an empty string. I'm not sure what I'm missing.
Title: Re: Manufacturer Logo - Finally Finished
Post by: NordicElf on April 15, 2009, 20:10:37 pm
I figured it out... where I was going wrong was that the $product_id that the manufacturer code uses from shop.product_details wasnt correct, so I just set it again inside shop.browse.php like this: $product_id = $db_browse->f('product_id'); and it's working like a charm!
My next step is to display all the manufacturer logos on the shop.index.php page in a similar way to the category logos...

Thanks for such a useful "hack"!
Title: Re: Manufacturer Logo - Finally Finished
Post by: TomC on April 17, 2009, 20:40:02 pm
So, is this module to the point where it is basically "plug-and-play?"
Or is there still a bunch of inner hacks that need to be implemented?
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on May 07, 2009, 11:21:11 am
Sorry - I don't visit this forum very much (if at all) so will try and get back into the coding frame of mind over the next couple of days and answer Q's :)
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on May 07, 2009, 11:26:37 am

Ok... I Have clean installation of 1.1.3 VM on Joomla 1.5.9

I was copy paste 5 files of yours + edited my flypage.tpl.php with your code.

When i am in administration (Manufacturer administration) --> new (fill all field, try to upload picture)...

Error: You must enter a name for the manufacturer.

Is there something that i missing it?
I would assume that you are missign the name of the manufacturer.
1 manufacturer = 1 logo

I see that some people are struggling with 1.1.3.

I'll try and install a fresh copy and provide a complete solution for people to cut and paste.

NordicElf - no worries - glad you found it useful. Flick up what you did to get the logos onto other pages to help others out :)

TomC - No plans on making a plugin for this. Though if there is enough demand, I'll learn and get it posted up. Of course as time permits.

Of course, if the VM dev team don't integrate into their 2.0 code first ;) ( *come on guys, when's the next release)
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on May 07, 2009, 13:30:56 pm
Just installed a fresh copy of the integrated Ja Larix VM package with VM 1.1.2 and J1.5.9.

Then upgraded to J1.5.10 and VM 1.1.3

Works a charm :)

(http://i60.photobucket.com/albums/h32/Dee_Cee23/virtuemart/VM_MF_Logo_Test_J1510_VM113.jpg)
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on May 07, 2009, 14:07:41 pm
Oops lol.
Seems I forgot a bit of code to display the manufacturer image in the manufacturer pop up.

Have updated the hack (mostly at bottom of page 1) - shop.manufacturer_page.php

Also have added a little thing under "things to do"
Quote
3. Turn on "Show Manufacturer Link" under Configuration -> Site -> Layout/Theme Configuration

Works like a charm 100% now :)

Now on to coupons (half done), tax (tutorial started) and credit card surcharges (figured out already). Will probably look at invoice statements reconfiguration as well (looks at project plan and sees what else to do lol)

Bloody website is at 130megs so far and isn't even live with around 30 more products to add - sigh

Check ya later

Dave
Title: Re: Manufacturer Logo - Finally Finished
Post by: TomC on May 07, 2009, 21:00:49 pm
This is fantastic - THANK YOU !!!
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on May 08, 2009, 03:00:20 am
No worries Tom :) I have taken from others and I have specific elements I want in my website so I thought that going through all this would help others get to where they need to be :)
Title: Re: Manufacturer Logo - Finally Finished
Post by: Stefan Ciprian on May 29, 2009, 11:55:11 am
Thanks, it works nice.
But I have a little problem, I don't think it's because of this hack but... I'm asking.
In the popup window where I have all the details about the manufacturer if I click on the manufacturer website link it points me to http://localhost/www.manufacturer.com and not to www.manufacturer.com
Maybe I did something wrong, I don't know.
Could you help me?
Thanks.
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on June 26, 2009, 16:01:17 pm
have you checked your config file?
Title: Re: Manufacturer Logo - Finally Finished
Post by: aggieoutlaw on July 22, 2009, 01:21:55 am
this is great stuff!

is there a way instead of linking the popup, to link to all listings by manufacturer?

thanks so much
Title: Re: Manufacturer Logo - Finally Finished
Post by: Jumbo! on August 18, 2009, 15:40:52 pm
Further to this I have developed an all new complete Theme - VMJ eStore which shows Manufacturer Logo both of browse page and flypage. It also shows the Manufacturer Name along with logo.

I have also included Manufacturer filter in the browse page.

The theme package also includes all set of hacks. So just replace the required files. Thanks to DeeCee. But I had to made quite a few change to show manufacturer name and logo together on browsepage and flypage.

You can see live demo (http://demo.vmjunction.com/estore/) and download the complete package (http://www.vmjunction.com/virtuemart_extensions/vmj-estore-complete-theme-with-manufactuer-logo-and-tabbed-flypage.html).

VirtueMart Version: 1.1.3, Joomla: 1.5
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on September 02, 2009, 06:05:17 am
If you are going to leverage off my work and charge for it then you can buy me a coffee :P
Title: Re: Manufacturer Logo - Finally Finished
Post by: Jumbo! on September 02, 2009, 08:18:26 am
If you are going to leverage off my work and charge for it then you can buy me a coffee :P

Hi DeeCee, No dear. I am not selling your creation. But obviously it was inspired by you. It shows Manufacturer Name & Logo both on Browse Page and Flypage. I have also included a Manufacturer Filter function on browsepage align with stylish Navigation.

I believe your work is for Manufacturer Logo on Flypage and on Manufacturer detail Page. But mine is different.

And finally we are giving away the hacks FREE of Cost with the Theme where user can utilize it.

But I think I should donate you some $$$ for the great idea. ;D
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on September 02, 2009, 08:56:01 am
So you used different coding to what I have put up then?
Or did you use the same coding with slight modification to suit your needs?

I've seen your demo. It's nice and people will get a lot of use out of it.

Then again, its not much of a stretch beyond the information I have supplied here to modify a shop browse page to show the manufacturer logo.

And you also used this hack: manufacturer filter, in your theme as well.
http://forum.virtuemart.net/index.php?topic=57831.0

By selling your theme using Bounce's and my hack you are leveraging off our work to make money.

Your theme doesn't work without our hacks.
You emphasis our hacks as main selling points.

My hack was designed for the wider community, and I have no issue with anyone using the modifications outlined in this tutorial.

BUT you could have just donated a couple of dollars to Bounce and I and I'm sure we would have appreciated the gesture. But you come onto my thread and started selling your theme with our hacks "given away for free".

If you continue to sell the theme, I want donations to Bounce and myself. Especially since you are charging $19.95 retail / $15.95 sale for the theme.

I have PM'd Bounce regarding this. If you wish to continue this conversation away from public eyes, then you can PM me or just make a donation to the email in my signature.

Regards
David
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on September 02, 2009, 09:33:34 am
VMJ,

Thank you for the donation/gesture.
I consider this matter settled.

Regards
Dave
Title: Re: Manufacturer Logo - Finally Finished
Post by: Jumbo! on September 02, 2009, 09:38:36 am
VMJ,

Thank you for the donation/gesture.
I consider this matter settled.

Regards
Dave
Thanks Dave.:)
Title: Re: Manufacturer Logo - Finally Finished
Post by: zvenson on October 14, 2009, 05:22:46 am
Nice hack! worked good! I was wandering if it is possible to display the manufacturer logos in the list that is created by the mod_virtuemart_manufacturers modification.
Has anyone done that?
cheers!
zvenson
Title: Re: Manufacturer Logo - Finally Finished
Post by: zvenson on October 16, 2009, 06:44:39 am
Quote
display the manufacturer logos in the list that is created by the mod_virtuemart_manufacturers modification
no one?
ok i done it by editing:

mod_virtuemart_manufactures.php

change line 36 from
Code: [Select]
$query  = "SELECT DISTINCT m.manufacturer_id, m.mf_name
to
Code: [Select]
$query  = "SELECT DISTINCT m.manufacturer_id, m.mf_name, m.mf_thumb_image
change in line 44 from
Code: [Select]
$query_all  = "SELECT m.manufacturer_id,m.mf_name FROM #__{vm}_manufacturer m ";
to
Code: [Select]
$query_all  = "SELECT m.manufacturer_id,m.mf_name,m.mf_thumb_image FROM #__{vm}_manufacturer m ";
after that you just need to add something like
Code: [Select]
<img src="components/com_virtuemart/shop_image/manufacturer/
<?php echo $manufacturer->mf_thumb_image?>" alt="kaufhaus">
where you want the image to appear.


Title: Re: Manufacturer Logo - Finally Finished
Post by: Ventsi Genchev on November 16, 2009, 18:19:49 pm
What can be done with Manufacturer Logo for VM 1.1.4?

off:
On September 15, I bought VMJ Estore, but this version is not compatible with VM 1.1.4
I wrote to support, but ... "Mail delivery failed".
The following address(es) failed: webmaster@joomladump.com
 :(
Title: Re: Manufacturer Logo - Finally Finished
Post by: Mirco C on November 16, 2009, 22:17:23 pm
Hi all,

first of all: GREAT HACK! Really needed this...

Question: in some answers there is spoken of manufacturer logo in VM. I have 1.1.4 but cannot find manufacturer logo in it.
Am I overlooking this or is it not there?

Regards Mirco
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on November 16, 2009, 23:08:00 pm
Well GregDev did some initial work on getting a manufacturer logo into VM and then that area of change went cold. I cleaned up Greg's work and finished it up and released it to the forum for 1.1.3. If anything, it may be put into VM 1.2

I haven't been around lately as I am trying to leave my web stuff behind me.

admns:
I didn't realise that 1.1.4 had been released, of which is only suppose to be a maintenance release. If I get time in the next month then I'll try and look at how manufacturer logo works in 1.1.4 and make it work (maybe when I'm at my sisters place in Aus for xmas and have nothing to do lol).

I know that some of you want a more immediate fix, but unfortunately that is my schedule unless someone else wants to give it a go sooner - write here for a blessing ;)
Title: Re: Manufacturer Logo - Finally Finished
Post by: Mirco C on November 16, 2009, 23:23:33 pm
Hi,

I'm gonna give it a try on 1.1.4.
I will let you know how it works out!
hope it works - hope it works - hope it works - hope it works - hope it works - hope it works - hope it works - hope it works - hope it works...

greetz Mirco
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on November 16, 2009, 23:31:49 pm
You have my blessing :)

And I've just looked quickly over the changelog for 1.1.4 and nothing seems to have changed that would affect the MF logo hack.
More looking if i ever find the time :(
Title: Re: Manufacturer Logo - Finally Finished
Post by: Mirco C on November 17, 2009, 00:23:10 am
So, I implmented it. I get an error "you must enter a name for the manufacturer" like in an earlier post.
Did you perhaps find the solution for that? Or have a hint for me where to dig in the php code :) ?
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on November 17, 2009, 00:48:04 am
Have you entered in a name for the manufacturer then? The manufacturer name is primary key if i remmeber correctly.
Title: Re: Manufacturer Logo - Finally Finished
Post by: Mirco C on November 17, 2009, 00:51:35 am
Yes, I did.
It also happens if I open an accisting (excuse my English) manufacturer and press save..
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on November 17, 2009, 00:54:02 am
So updating an existing manu doesn't work. Hmm.
Check the database and see if the new manufacturer name has been entered into the table. Run a debug script if need be and see what is happening.
Title: Re: Manufacturer Logo - Finally Finished
Post by: Mirco C on November 17, 2009, 01:05:14 am
Already looked,
No added rows there.
I have the standard debug on. Nothing special there.
Title: Re: Manufacturer Logo - Finally Finished
Post by: Mirco C on November 17, 2009, 01:18:27 am
In ps_manufacturer.php I stated :

Code: [Select]
if (empty($d["mf_name"])) {
$GLOBALS['vmLogger']->err( $VM_LANG->_('VM_MANUF_ERR_NAME') );
$valid = false;

from false to true. This caused an empty row to be added to the db altough there was info added in to the fields.
So the info from the fields is not transferred to...?
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on November 17, 2009, 02:08:11 am
check add/update/delete in ps_manufacturer. If the data isn't entering the tables then it is most likely there.
Title: Re: Manufacturer Logo - Finally Finished
Post by: Mirco C on November 17, 2009, 02:34:22 am
Just found out that the tabs in the form was causing the error.
By replacing the modified files 1 by 1 with my backup files it turned out it was in the manufacturer.manufacturer form.
I // out the tabs and it worked!

thanx for your help.
If i find out why the tabs don't work , I will let you know.

Regards Mirco
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on November 17, 2009, 04:16:26 am
glad to hear it worked out for you. If you could please post up your modifications to make MF logo work for 1.1.4 it would be appreciated by all :)
Title: Re: Manufacturer Logo - Finally Finished
Post by: Ventsi Genchev on November 17, 2009, 14:06:33 pm
Just found out that the tabs in the form was causing the error.
By replacing the modified files 1 by 1 with my backup files it turned out it was in the manufacturer.manufacturer form.
I // out the tabs and it worked!

thanx for your help.
If i find out why the tabs don't work , I will let you know.

Regards Mirco

OK, I found the problem in manufacturer.manufacturer_form.php

Befor:
Code: [Select]
$tabs->endPane();

// Add necessary hidden fields

Insert:
Code: [Select]
$tabs->endTab(); :)

But there is still another problem. In flypage I have additional photos of products. They come with a maximum size of the entire page, with no thumbs.

In 1.1.4 there have been many changes in files.
Like:
old: ps_product
new: vm_ps_product

I do not think it is appropriate to directly replace the files. This may create another problem entirely. Maybe if DeeCee tell where and what exactly has changed, we can do to work for VM 1.1.4
Title: Re: Manufacturer Logo - Finally Finished
Post by: Mirco C on November 17, 2009, 22:17:19 pm
Yes, inserting the 'end-tab'is working for me. Must have overlooked that one. So far, the rest of the site is working fine.

Indeed, it would be very handy to know which code is added so it can be adjusted to fit future VM releases or (when I have the time to do that) can be configured to be an plugin or module.
Gr Mirco
Title: Re: Manufacturer Logo - Finally Finished
Post by: Ventsi Genchev on November 17, 2009, 22:24:26 pm
A little more and I will be ready with changes in files.
Title: Re: Manufacturer Logo - Finally Finished
Post by: Ventsi Genchev on November 18, 2009, 09:13:37 am
Yes, inserting the 'end-tab'is working for me. Must have overlooked that one. So far, the rest of the site is working fine.

Indeed, it would be very handy to know which code is added so it can be adjusted to fit future VM releases or (when I have the time to do that) can be configured to be an plugin or module.
Gr Mirco

I am very proud of this discovery, because there was a problem for all who use Internet Explorer. I read in the forum vmjunction.com, but vmjunction simply advise not to use Internet Explorer. Only Firefox. I decided that this is not a decision and lost several hours to find the problem.
Importantly, however, there is a solution and that makes me very happy.  ;D

I am ready with changes in the files for VirtueMart 1.1.4. Now everything works in browse, flypage, and manufacturer page. And of course with IE.  ;)
I just want to do some tests to make sure that everything is OK.

It turned out that there were many changes in version 1.1.4.
Should not be directly copied the old files because they will lose important updates that have been made in 1.1.4.
Title: Re: Manufacturer Logo - Finally Finished
Post by: Mirco C on November 26, 2009, 22:00:44 pm
Hi Venci,
That's good work! Indeed there were a lot of changes...
Are you willing to share those files?

Greetz Mirco
Title: Re: Manufacturer Logo - Finally Finished
Post by: Ventsi Genchev on November 26, 2009, 23:07:56 pm
Yes, I`m ready.
Tomorrow or Saturday I will be able to publish files.
Title: Re: Manufacturer Logo - Finally Finished
Post by: Ventsi Genchev on November 28, 2009, 09:18:11 am
These are files on VM 1.1.4 with added changes DeeCee. Fixed some errors. For example when working on a local server not appearing images. Course is added procedures, without which there is a problem with IE when working with a manufacturer in the admin panel.

Good luck to all!  :)

I want again to express my gratitude to DeeCee. Wonderful hack.

[attachment cleanup by admin]
Title: Re: Manufacturer Logo - Finally Finished
Post by: Mirco C on November 29, 2009, 23:50:38 pm
THANK YOU A LOT!
Title: Re: Manufacturer Logo - Finally Finished
Post by: Jumbo! on January 07, 2010, 17:52:07 pm
What can be done with Manufacturer Logo for VM 1.1.4?

off:
On September 15, I bought VMJ Estore, but this version is not compatible with VM 1.1.4
I wrote to support, but ... "Mail delivery failed".
The following address(es) failed: webmaster@joomladump.com
 :(

Probably I am late to attend this post.
You sent the email to a wrong address. Our contact address in webmaster(at)vmjunction.com

If you had any problem with our product then you should have posted on our support forum.

Please note that we had upgraded VMJ eStore for VM 1.1.4. And the same is available for all existing and new customers. :)
Title: Re: Manufacturer Logo - Finally Finished
Post by: Jurijus on March 07, 2010, 11:26:50 am
VM 1.1.4.
Fatal error: Call to a member function image_tag() on a non-object in
X:\..\administrator\components\com_virtuemart\html\manufacturer.manufacturer_form.php on line 144
Title: Re: Manufacturer Logo - Finally Finished
Post by: Hermes on March 09, 2010, 13:58:53 pm
Thanks DeeCee for this Hack. I just posted my own code about this ability, but unfortunately doesn't works. Your code works like a charm. Thanks Again!!
Title: Re: Manufacturer Logo - Finally Finished
Post by: klutzon on March 09, 2010, 15:33:35 pm
I tried this hack before in its 1.1.3 form, now using the latest 1.1.4 version, and it works really well. My only issue is that when I try to save the full / thumb image for the logo, the change isn't saved in the DB, and although the thumb is correctly generated, the image for the logo itself does not appear in the "Manufacturer Image" tab like you'd normally expect a newly-uploaded "Product Image" to appear in the Product Image tab.

I remember getting around this the last time by manually entering the file name of the logo and the thumb into the manufacturer table of the VM DB, but I thought I wouldn't have to still do this after all this time.

This hack seems to work flawlessly for most people, so I'm hoping someone can enlighten me as to what's different about my setup that I had to do this then and have to do it now... :)
Title: Re: Manufacturer Logo - Finally Finished
Post by: msv on March 10, 2010, 11:15:28 am
VM 1.1.4.
Fatal error: Call to a member function image_tag() on a non-object in
X:\..\administrator\components\com_virtuemart\html\manufacturer.manufacturer_form.php on line 144

I have the same problem. I found that this error occur only in "Extended Layout". In  "Simple Layout" everything work perfect.
Title: Re: Manufacturer Logo - Finally Finished
Post by: mbit on May 07, 2010, 17:48:13 pm
i am trying this hack at vm 1.1.4. At the backend everything seems to work, i edited a existing manufacturer and i uploaded an image with no problems. I added     <?php echo $manufacturer_logo ?> in flypage but  i get a ? inside a frame at the place of manufacturer logo, if i open it in new tab i get  the page ../components/com_virtuemart/shop_image/manufacturer/ where all images are listed in row. any ides why this happens?

Thanks in advance
Title: Re: Manufacturer Logo - Finally Finished
Post by: novice binder on June 25, 2010, 00:40:31 am
I have the same problem as kutzton. On my vm 1.1.4 i installed everything as written above but image does not show either on flypage and manufacturer page in admin panel.
Title: Re: Manufacturer Logo - Finally Finished
Post by: novice binder on June 25, 2010, 16:40:37 pm
All works now you can see on spa23.ru

To those who will have same problem. Do your SQL query correctly.
In my case my table had different name so i just changed query and all worked

Thanks to author!
Title: Re: Manufacturer Logo - Finally Finished
Post by: chinnu on July 02, 2010, 11:07:36 am
Hi,
I want this hack. My needed functionaly is see all link should be displayed in maufacturers module. that link should go to list of   manufactures page with logo of the manufacturers displaying.

Thanks and sorry for my english.
Title: Re: Manufacturer Logo - Finally Finished
Post by: omd123 on August 07, 2010, 11:07:55 am
Hi,

Did anyone check already if theis hack works correcly with VM 1.1.5?

Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on August 07, 2010, 15:44:12 pm
Wow - people are still using this :)
Makes a guy feel pretty proud that so many people have got some use out of this hack :D

Don't know if updated hack for 1.1.4 works for 1.1.5

I suggest you setup a test site and evaluate the performance of the 1.1.4 hack for other 1.1.5 users :)

Cheers
Dave
Title: Re: Manufacturer Logo - Finally Finished
Post by: Ventsi Genchev on August 07, 2010, 18:49:38 pm
Hi Dave,

Where you gone? Almost one year you are not written in the forum.

Your hack is wonderful, so people still use it. There is even a module that is based on this hack.  :)

This is to do something really useful. Doing a lot of people happy.

Venci
Title: Re: Manufacturer Logo - Finally Finished
Post by: DeeCee on August 08, 2010, 00:41:57 am
Hi Venci,

I've stopped running my own business and have gone back to corporate IT doing project management :)

The money is a lot better than running my own business haha - at least I get paid instead of dealing with the up's and down's of running my own business.

I may try and find sometime to contribute back to community, but at this stage I have no plans to. I had about 15-20 small to large hacks or methods that first time users of VM should incorporate or learn how to use to make their life a lot easier using this cart.

Good to see you around still :) I may make a future appearence occassionaly lol

Cheers
Dave
Title: Re: Manufacturer Logo - Finally Finished
Post by: Jumbo! on August 18, 2010, 19:59:56 pm
Guys, I should update you. DeeCee's hacks work just fine with VM 1.1.5. This is tested as the hacks also used in one of our theme VMJ eStore. http://www.vmjunction.com/virtuemart_extensions/vmj-estore-complete-theme-with-manufactuer-logo-and-tabbed-flypage.html

@DeeCee: I would love to see more such hacks from you in future. All the best.
Title: Re: Manufacturer Logo - Finally Finished
Post by: omd123 on December 10, 2010, 15:05:27 pm
Did anybody try to bring the manufacturer logo also to the browse page?
If you, can you share the solution?
Title: Re: Manufacturer Logo - Finally Finished
Post by: Jumbo! on December 10, 2010, 20:36:26 pm
Did anybody try to bring the manufacturer logo also to the browse page?
If you, can you share the solution?
We already did that. Please check this Virtuemart theme. http://www.vmjunction.com/virtuemart_extensions/vmj-estore-complete-theme-with-manufactuer-logo-and-tabbed-flypage.html
Title: Re: Manufacturer Logo - Finally Finished
Post by: omd123 on December 11, 2010, 00:01:08 am
Are you willing to publish the code?
Title: Re: Manufacturer Logo - Finally Finished
Post by: Zyama on December 15, 2010, 19:39:50 pm
To add manufacturer logo to the browse page I used this code,

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

  <img src="/components/com_virtuemart/shop_image/manufacturer/<?php echo ps_product::get_mf_full_image$product_id );?>">

It's modified version of http://forum.virtuemart.net/index.php?topic=74077.0


I'm looking for solution to add manufacturer logo to productsnapshot template.
Please share if You have.
Title: Re: Manufacturer Logo - Finally Finished
Post by: lipes on December 15, 2010, 19:45:03 pm
How to add the link to go to oficial product website?

full problem question here:
http://forum.virtuemart.net/index.php?topic=79183.0 (http://forum.virtuemart.net/index.php?topic=79183.0)
Title: Re: Manufacturer Logo - Finally Finished
Post by: omd123 on December 25, 2010, 17:48:51 pm
Hi just did an update to VM 1.16 in combination with Joomla 1.5.22. All works great, and meanwhile I solved my old old question for the manufacturer logo in the browase page.

I added the following code to the browse page:

Quote
         <div id="fabrikantlink">   
        <?php echo $manufacturer_link ?>
    <img src="/components/com_virtuemart/shop_image/manufacturer/<?php echo ps_product::get_mf_full_image( $product_id );?>">

You can see the result here: http://www.mijnictwinkel.nl/KVM-Switches/Uniclass/VGA/Bekijk-alle-producten.html.
Title: Re: Manufacturer Logo - Finally Finished
Post by: tuya33 on January 13, 2011, 01:07:38 am
Version 1.5.22
VirtueMart 1.1.6
logo wont' show?
Title: Re: Manufacturer Logo - Finally Finished
Post by: atranaz on April 08, 2011, 17:50:37 pm
all work great & its a great effort for all  members but now i have some question if someone solve its so kindly share  it ....   

my    question & problem is   can we show all manuf... logo in one page of vm without help for mod 
Title: Re: Manufacturer Logo - Finally Finished
Post by: Vix87 on May 17, 2011, 19:52:05 pm
This update work on
Joomla  1.5.23
VirtueMart 1.1.8
? I realy NEED IT :P
Title: Re: Manufacturer Logo - Finally Finished
Post by: omd123 on July 02, 2011, 21:21:27 pm
Just did an update on Joomla 1.5.23 and VirtueMart 1.1.8 to VirtueMart 1.1.9. Th hack still works great ;D ;D
http://www.mijnictwinkel.nl
Title: Re: Manufacturer Logo - Finally Finished
Post by: Jumbo! on July 23, 2011, 07:57:23 am
Have you guys checked out our new Complete Virtuemart Theme - VMJ Color Plus. We have added several new things with Manufacturer Logo. You can show it on Browse Page, Featured products and also added a Manufacturer Logo jCarousel Module. Here this the link of the live demo site. http://demo.vmjunction.com/color_plus/ (http://demo.vmjunction.com/color_plus/)

It even works with latest Virtuemart 1.1.9.
Title: Re: Manufacturer Logo - Finally Finished
Post by: mbit on July 23, 2011, 15:57:25 pm
any idea about the meta of manufacturer pages? i am stacked trying to fix this..
Quote
from file shop.browse.php
line 603 code :
Code: [Select]

   }
   elseif( $manufacturer_id) {
      $db->query( "SELECT manufacturer_id, mf_name, mf_desc 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' );

all my manufacturers have same meta description.. Can i add any code under the mainframe->SetpageTitlte that ll generate the Meta desription of the page?? eg the url or the description as meta -description?