Hola, por más que he buscado no sé cómo hacerlo. Necesito que en el listado de productos, dónde aparecen los datos y la imagen, así com referncia y añadir al carro, me salga también el fabricante. Tengo el espacio creado pero no consigo que lo llame.
¿Cómo he de hacerlo?
Adjnto imagen.
URL del sitio: Contenido solo visible a usuarios registrados
Hola,
En primer lugar vete a la administración de Virtuemart y entra en el apartado Configuración. Pulsa en la pestaña Plantillas y comprueba que tienes activado el parámetro Muestra fabricantes.
Si se sigue sin mostrar el fabricante edita la plantilla que estás usando para el listado de productos de una categoría y agregar en el lugar donde quieres mostrar el fabricante el siguiente código:
mf_name; ?>
No consigo hacer que aparezca, entro en browse_listtable.tpl.php y lo pongo pero no consigo hacer que aparezca. ¿Cuál puede ser el problema? A continuación detallo el php.
_('PHPSHOP_PRODUCT_FORM_THUMB_IMAGE');
$tableheader[] = $VM_LANG->_('PHPSHOP_CART_NAME');
$tableheader[] = $VM_LANG->_('PHPSHOP_CART_SKU');
$tableheader[] = $VM_LANG->_('PHPSHOP_MANUFACTURER_MOD');
if( _SHOW_PRICES && $auth['show_prices'] ) {
$tableheader[] = $VM_LANG->_('PHPSHOP_CART_PRICE');
}
if( _SHOW_PRICES && $auth['show_prices'] && USE_AS_CATALOGUE != '1' ) {
$tableheader[] = $VM_LANG->_('PHPSHOP_CART_ACTION');
}
// Creates a new HTML_Table object that will help us
// to build a table holding all the products
$table =& new HTML_Table('width="100%"');
$table->addRow( $tableheader, 'class="sectiontableheader"', 'th', true );
foreach( $products as $product ) {
foreach( $product as $attr => $val ) {
// Using this we make all the variables available in the template
// translated example: $this->set( 'product_name', $product_name );
$this->set( $attr, $val );
}
$data[$row][] = ''
. ps_product::image_tag( $product['product_thumb_image'] )
. '';
$data[$row][] = ''.$product['product_name'].'';
$data[$row][] = $product['product_sku'];
$data[$row][] = $product['product_manufacturer_mod'];
if( _SHOW_PRICES && $auth['show_prices'] ) {
$data[$row][] = $product['product_price'];
}
if( $product['has_addtocart'] ) {
$data[$row][] = $product['form_addtocart'];
}
$row++;
}
// Loop through each row and build the table
foreach($data as $key => $value) {
$table->addRow( $data[$key], 'class="sectiontableentry'.$i.'"', 'td', true );
$i = $i == 1 ? 2 : 1;
}
// Display the table
echo $table->toHtml();
?>
get_cfg( 'showFeatured', 1 )) {
/* featuredproducts(random, no_of_products,category_based) no_of_products 0 = all else numeric amount
edit featuredproduct.tpl.php to edit layout */
echo $ps_product->featuredProducts(true,10,true);
} ?>
Si la tengo activada, pero no sé qué problema hay que no consigo que aparezca.
Hola Miguel,
La ruta que utilizas es la que te adjunto?: /components/com_virtuemart/themes/ja-zeolite/templates/browse/includes/browse_listtable.tpl.php, este debe ser el fichero a modificar.
Saludos.
Si, ese es el fichero que modifico, pero no consigo hacer que aparezca. ¿Cúal puede ser la causa?
Hola Miguel,
No brindamos soporte en cuanto a programación, como alternativa puedes evaluar el siguiente articulo:
Filtrar por fabricante categoría de productos en Virtuemart
Saludos.
Pero supuestamente, ¿si hay una pestaña para que se pueda ver el fabricante ha de verse no? Creo que hay algún error que no está permitiendo que se vea.
Hola Miguel,
En el código que muestras en tu respuesta #85994 no veo que hayas insertado el código que te indicó Pablo:
mf_name; ?>
Saludos
Hola Jordi, ¿dónde exactamente debería ponerlo?
Hola Miguel
Puedes colocarlo de acuerdo a donde quieres que aparezca.
Puedes insertar el código directamente con: echo $product->mf_name; si estas ya dentro de etiquetas php.
Asegúrate de que sea el archivo correcto, esto lo puedes comprobar imprimiendo algún codigo por ejemplo : echo "hola mundo"
Si tienes el template webempresa , es posible que el archivo se encuentre en :
/components/com_virtuemart/themes/webempresa/templates/browse/includes/browse_listtable.tpl.php
Saludos.
Resulata extraño, cuando pongo en el sitio del fabricante product_sku, me pone sin problemas el código del producto por duplicado, en referencia y en fabricante. Sin embargo, cuando pongo el código mf_name no me llama al fabricante. ¿alguna ida de lo que puede estar pasando?
Aquí dejo el archivo modificado, pero aún no me enseña el fabricante:
_('PHPSHOP_PRODUCT_FORM_THUMB_IMAGE');
$tableheader[] = $VM_LANG->_('PHPSHOP_CART_NAME');
$tableheader[] = $VM_LANG->_('PHPSHOP_CART_SKU');
$tableheader[] = $VM_LANG->_('PHPSHOP_MANUFACTURER_MOD');
if( _SHOW_PRICES && $auth['show_prices'] ) {
$tableheader[] = $VM_LANG->_('PHPSHOP_CART_PRICE');
}
if( _SHOW_PRICES && $auth['show_prices'] && USE_AS_CATALOGUE != '1' ) {
$tableheader[] = $VM_LANG->_('PHPSHOP_CART_ACTION');
}
// Creates a new HTML_Table object that will help us
// to build a table holding all the products
$table =& new HTML_Table('width="100%"');
$table->addRow( $tableheader, 'class="sectiontableheader"', 'th', true );
foreach( $products as $product ) {
foreach( $product as $attr => $val ) {
// Using this we make all the variables available in the template
// translated example: $this->set( 'product_name', $product_name );
$this->set( $attr, $val );
}
$data[$row][] = ''
. ps_product::image_tag( $product['product_thumb_image'] )
. '';
$data[$row][] = ''.$product['product_name'].'';
$data[$row][] = $product['product_sku'];
$data[$row][] = $product['mf_name'];
if( _SHOW_PRICES && $auth['show_prices'] ) {
$data[$row][] = $product['product_price'];
}
if( $product['has_addtocart'] ) {
$data[$row][] = $product['form_addtocart'];
}
$row++;
}
// Loop through each row and build the table
foreach($data as $key => $value) {
$table->addRow( $data[$key], 'class="sectiontableentry'.$i.'"', 'td', true );
$i = $i == 1 ? 2 : 1;
}
// Display the table
echo $table->toHtml();
?>
get_cfg( 'showFeatured', 1 )) {
/* featuredproducts(random, no_of_products,category_based) no_of_products 0 = all else numeric amount
edit featuredproduct.tpl.php to edit layout */
echo $ps_product->featuredProducts(true,10,true);
} ?>