VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: devkbsc on July 24, 2012, 13:35:25 PM

Title: Compare product
Post by: devkbsc on July 24, 2012, 13:35:25 PM
Hello,

I am trying to code compare product in cart page. I have coded as below:

<h3>Comparaison des Programmes</h3>

<table width="623" border="0" cellspacing="1" cellpadding="0">
  <tr>
    <th width="200"><div align="left"></div></th>
    <th width="17" rowspan="9"><?php
      $i=1;
      foreach( $this->cart->products as $pkey =>$prow ) { ?></th>
    <th width="300" bgcolor="#EAEAEA"><div align="center"> <?php echo $prow->product_name; ?></div></th>
 
   
   <th width="17" rowspan="9"><?php }?></th>
  </tr>
  <tr>
    <th width="200"><h5 align="left">Code de Programme</h5></th>
    <td width="300"><?php echo $prow->product_sku; ?></td>
  </tr>
  <tr>
    <th width="200"><h5 align="left">Objecif</h5></th>
    <td width="300"><?php $this->product->product_s_desc; ?></td>
  </tr>
  <tr>
    <th width="200"><h5 align="left">Description</h5></th>
    <td width="300"><?php $prow->product_desc; ?></td>
  </tr>
  <tr>
    <th width="200"><h5 align="left">Les Plus</h5></th>
    <td width="300"><?php ?></td>
  </tr>
  <tr>
    <th width="200"><h5 align="left"><?php echo JText::_('COM_VIRTUEMART_DURATION'); ?></h5></th>
    <td width="300"><?php ?></td>
  </tr>
  <tr>
    <th width="200"><h5 align="left">Date&amp;Lieu</h5></th>
    <td width="300">&nbsp;</td>
  </tr>
  <tr>
    <th width="200"><h5 align="left">Formateur</h5></th>
    <td width="300">&nbsp;</td>
  </tr>
  <tr>
    <th width="200"><h5 align="left">Type de Module</h5></th>
    <td width="300">&nbsp;</td>
  </tr>
</table>



the result of the source code is attached img.
, manu
My question is how to fetch the other field of the product such as description, short description, and few custom fields of the product, and also the product manufacturer name?

Any clue, Please reply me. Thank you

[attachment cleanup by admin]
Title: Re: Compare product
Post by: jenkinhill on July 24, 2012, 13:57:44 PM
Why re-invent the wheel?  http://forum.virtuemart.net/index.php?topic=101127.0
Title: Re: Compare product
Post by: devkbsc on July 24, 2012, 14:19:23 PM
Excuse Sir,

I don't have money to buy this extention! thats i am trying to code my self. Would please give any suggestion to get the product field in the cart page? i have already found the two field

- product name
- product sku.

but not the others. At the same time what are product added cart will only display in the comparison table.