Joomla.it Forum

Componenti per Joomla! => Gestione e-commerce => : Secursystem 26 Jul 2014, 11:48:23

: Prodotti direttamente in pagina Manufacturer VM2
: Secursystem 26 Jul 2014, 11:48:23
Ciao a tutti, riesumo questo topic perchè a me la soluzione non funziona e ci sto diventando matto!!  :o
Vi incollo il mio codice, potreste dirmi cosa devo cambiare per favore??


Virtuemart 2.6.6 su joomla 2.5.22


Percorso file1: components-com_virtuemart-views-manufacturer-tmpl
nome file: default.php
Codice:
:
<?php
/**
*
* Description
*
* @package   VirtueMart
* @subpackage Manufacturer
* @author Kohl Patrick, Eugen Stranz
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2004 - 2010 VirtueMart Team. 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.
* @version $Id: default.php 2701 2011-02-11 15:16:49Z impleri $
*/


// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');


// Category and Columns Counter
$iColumn 1;
$iManufacturer 1;


// Calculating Categories Per Row
$manufacturerPerRow 3;
if (
$manufacturerPerRow != 1) {
   
$manufacturerCellWidth ' width'.floor 100 $manufacturerPerRow );
} else {
   
$manufacturerCellWidth '';
}


// Separator
$verticalSeparator " vertical-separator";
$horizontalSeparator '<div class="horizontal-separator"><>';


// Lets output the categories, if there are some
if (!empty($this->manufacturers)) { ?>



<div class="manufacturer-view-default">


   <?php // Start the Output
   
foreach ( $this->manufacturers as $manufacturer ) {


      
// Show the horizontal seperator
      
if ($iColumn == && $iManufacturer $manufacturerPerRow) {
         echo 
$horizontalSeparator;
      }


      
// this is an indicator wether a row needs to be opened or not
      
if ($iColumn == 1) { ?>

      <div class="row">
      <?php }


      
// Show the vertical seperator
      
if ($iManufacturer == $manufacturerPerRow or $iManufacturer $manufacturerPerRow == 0) {
         
$showVerticalSeparator ' ';
      } else {
         
$showVerticalSeparator $verticalSeparator;
      }


      
// Manufacturer Elements
      
$manufacturerURL JRoute::_('index.php?option=com_virtuemart&view=manufacturer&virtuemart_manufacturer_id=' $manufacturer->virtuemart_manufacturer_idFALSE);
      
$manufacturerIncludedProductsURL JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_manufacturer_id=' $manufacturer->virtuemart_manufacturer_idFALSE);
      
$manufacturerImage $manufacturer->images[0]->displayMediaThumb("",false);


      
// Show Category ?>

      <div class="manufacturer floatleft<?php echo $manufacturerCellWidth $showVerticalSeparator ?>">
         <div class="spacer">
            <h2>
               <a title="<?php echo $manufacturer->mf_name?>" href="<?php echo $manufacturerURL?>"><?php echo $manufacturer->mf_name?>[/url]
            </h2>
            <a title="<?php echo $manufacturer->mf_name?>" href="<?php echo $manufacturerURL?>"><?php echo $manufacturerImage;?>[/url]
         <>
      <>
      <?php
      $iManufacturer 
++;


      
// Do we need to close the current row now?
      
if ($iColumn == $manufacturerPerRow) {
         echo 
'<div class="clear"><><>';
         
$iColumn 1;
      } else {
         
$iColumn ++;
      }
   }


   
// Do we need a final closing row tag?
   
if ($iColumn != 1) { ?>

      <div class="clear"><>
   <>
   <?php ?>


<>
<?php
}
?>

Percorso file2: components-com_virtuemart-views-manufacturer-tmpl
nome file: details.php
Codice:
:
<?php
/**
*
* Description
*
* @package   VirtueMart
* @subpackage Manufacturer
* @author Kohl Patrick, Eugen Stranz
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2004 - 2010 VirtueMart Team. 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.
* @version $Id: default.php 2701 2011-02-11 15:16:49Z impleri $
*/


// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
?>



<div class="manufacturer-details-view">




   <div class="spacer">


   
    <table width="100%" border="0">
  <tr>
    <td width="25%"><?php // Manufacturer Image
   
if (!empty($this->manufacturerImage)) { ?>

      <div class="manufacturer-image">
      <?php echo $this->manufacturerImage?>
      <>
   <?php ?></td>
    <td width="75%">
   <h4><?php echo $this->manufacturer->mf_name?></h4>
   <?php // Manufacturer Description
   
if(!empty($this->manufacturer->mf_desc)) { ?>

      <div class="manufacturer-description"> <?php echo $this->manufacturer->mf_desc ?> <>
      <?php ?></td>
    </tr>
</table>




   <?php // Manufacturer Email
   
if(!empty($this->manufacturer->mf_email)) { ?>

      <div class="manufacturer-email">
      <?php // TO DO Make The Email Visible Within The Lightbox
      
echo JHtml::_('email.cloak'$this->manufacturer->mf_email,true,JText::_('COM_VIRTUEMART_EMAIL'),false?>

      <>
   <?php ?>


   <?php // Manufacturer URL
   
if(!empty($this->manufacturer->mf_url)) { ?>

      <div class="manufacturer-url">
         <a target="_blank" href="<?php echo $this->manufacturer->mf_url ?>"><?php echo JText::_('COM_VIRTUEMART_MANUFACTURER_PAGE'?>[/url]
      <>
   <?php ?>


   


   <?php // Manufacturer Product Link
   
$manufacturerProductsURL JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_manufacturer_id=' $this->manufacturer->virtuemart_manufacturer_idFALSE);


   if(!empty(
$this->manufacturer->virtuemart_manufacturer_id)) { ?>

      <div class="manufacturer-product-link">
         <a target="_top" href="<?php echo $manufacturerProductsURL?>"><?php echo JText::sprintf('COM_VIRTUEMART_PRODUCT_FROM_MF',$this->manufacturer->mf_name); ?>[/url]
      <>
   <?php ?>


   <div class="clear"><>
   <>
<>


Grazie in anticipo!!  :)
: Re:Link diretto Manufacturer VM2
: mmleoni 28 Jul 2014, 14:19:47
meglio non accodarsi mai a topic marcati come risolto.
semmai cita il topic di riferimento aprendo una nuova discussione.

rife:
http://forum.joomla.it/index.php/topic,242453.0.html


ad occhio: crea un override del primo file (vedi documentazione) e sostituisci $manufacturerURL con $manufacturerIncludedProductsURL nella sezione nei links seguenti alla definizione delle variabili.

ciao
: Re:Link diretto Manufacturer VM2
: mmleoni 28 Jul 2014, 14:21:45
a occhio niente, sono gli stessi files dell'altro post, quindi medesima soluzione.
: Re:Link diretto Manufacturer VM2
: Secursystem 29 Jul 2014, 12:47:00
Leggendo bene mi sono accorto che sto chiedendo un'altra cosa, apposta non mi funziona quella modifica!!!

A me serve fare questa cosa:

nella pagina di dettaglio di un produttore dove si vede il logo del produttore e la descrizione, vorrei che al posto del link "mostra tutti i prodotti di questo produttore" comparissero direttamente i prodotti di quel produttore, evitando di dover cliccare e cambiare pagina per farli apparire.  Come posso fare? ;D


   L
: Re:Prodotti direttamente in pagina Manufacturer VM2
: mmleoni 31 Jul 2014, 16:05:26
l'informazione ricercata non è disponibile nella view manufacturer, ma solo in quella categories, ergo se non sai programmare, e benino, non puoi farlo.

dovresti caricarti il model di category nel template di manufacturer e settando gli opportuni parametri in $_REQUEST (id produttore) ottenere i prodotti di ciascun produttore: non impossibile ma certo non banale.


ciao,
marco
: Re:Prodotti direttamente in pagina Manufacturer VM2
: Secursystem 31 Jul 2014, 17:07:16
Questa si che è una pessima notizia.  :'(