Product Description data not showing in Shopping Cart

Please post your issues and questions about One Page Checkout for Virtuemart 2 to this forum.

Product Description data not showing in Shopping Cart

Postby pdhlambert@.....com » Mon Oct 01, 2012 3:55 pm

Hi All,

I want to modify the shopping cart page so I can see a product description column.
I have been able to modify basket.html.php so that I can see the row heading 'Product Description' by adding the following line:

Code: Select all
   <th class="vmsectiontableheader"><?php echo $VM_LANG->_('PHPSHOP_PRODUCT_DESC') ?></th>


However I cannot get the actual product description data to show in the row.
I have added the following line which I think should call the data but nothing is showing:

Code: Select all
   <td align="left"><?php echo $product['product_desc'] ?></td>


Here is the code associated with this part of the cart:

Code: Select all
?>

<h1><?php echo $VM_LANG->_('PHPSHOP_CART_TITLE'); ?></h1>
<table width="100%" cellspacing="0" cellpadding="4" border="0" style="border:1px solid #BEBCB7;margin-bottom:10px;">

  <tr align="left" >
        <th colspan="3" class="vmsectiontableheader"><?php echo $VM_LANG->_('PHPSHOP_CART_NAME') ?></th>
   <th class="vmsectiontableheader"><?php echo $VM_LANG->_('PHPSHOP_PRODUCT_DESC') ?></th>
   <th class="vmsectiontableheader"><?php echo $VM_LANG->_('PHPSHOP_CART_PRICE') ?></th>
   <th class="vmsectiontableheader"><?php echo $VM_LANG->_('PHPSHOP_CART_QUANTITY') ?> / <?php echo $VM_LANG->_('PHPSHOP_CART_ACTION') ?></th>
   <th class="vmsectiontableheader"><?php echo $VM_LANG->_('PHPSHOP_CART_SUBTOTAL') ?></th>
  </tr>
<?php
$c = 0;
foreach( $product_rows as $product ) {
$c++;
if ($c&1) $i = '2'; else $i='1';
$product['row_color'] = 'sectiontableentry'.$i;
?>
  <tr valign="top" class="<?php echo $product['row_color'] ?>">
   <td colspan="3"><?php echo $product['product_sku'] ?></td>
   <td align="left"><?php echo $product['product_desc'] ?></td>
<td align="left"><?php echo $product['product_price'] ?></td>
   <td valign="top" >
     <div style="position: relative;">
      <?php echo $product['update_form'] ?>
      <?php echo $product['delete_form'] ?>
     </div>
   </td>
    <td align="right"><?php echo $product['subtotal'] ?></td>
  </tr>
<?php } ?>


Can someone tell me what the obvious thing is I am missing here!
Thanks
Paul
pdhlambert@.....com
 
Posts: 3
Joined: Sun Sep 30, 2012 12:01 am

Re: Product Description data not showing in Shopping Cart

Postby admin » Tue Oct 02, 2012 12:12 pm

Hello Paul, the basket theme for OPC2 is located in /components/com_onepage/themes/YOUR SELECTED THEME/overrides/basket.html.php

Please see especially
/components/com_onepage/themes/icetheme_thestore/overrides/basket.html.php

which includes developer information on how to show additional product information.

You might want to do
<?php var_dump($product['info']); ?> which will show you all loaded information about the product including the description.

Best Regards,
Stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm


Return to One Page Checkout for Virtuemart 2