News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

(fixed) Link to product details from category header

Started by sunnysbulbs, July 04, 2012, 19:11:20 PM

Previous topic - Next topic

sunnysbulbs

Need a little PHP help. In \html\com_virtuemart\category\default.php I have the following..

<div class="width55 floatcenter">
          <h2>
            <!-- <?php echo JHTML::link($product->link$product->product_name); ?>-->
            <?php echo $product->product_name?>
          </h2>


I think that piece of code is what generates the product name as a header in the virtuemart category view. What I would like to do is also make that header link to the actual product page. Thought this was the solution... http://docs.joomla.org/JHtml::link/1.6 but couldn't work out how to use '$url'

Any help is greatly appreciated!

Corey

Joomla 2.5/Virtuemart 2.0.6

In \html\com_virtuemart\category\default.php the following from...

<div class="width55 floatcenter">
          <h2>
            <!-- <?php echo JHTML::link($product->link$product->product_name); ?>-->
            <?php echo $product->product_name?>
          </h2>


to..

<?php echo JHTML::link(JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$product->virtuemart_category_id), $product->product_name, array('title' => $product->product_name)); ?>

srajca

I think by default that is a feature of virtuemart
try un-commenting the code - use the one below
<div class="width55 floatcenter">
          <h2>
            <?php echo JHTML::link($product->link$product->product_name); ?>
            <?php echo $product->product_name?>
          </h2>

or try this one if the one above will generate two headings
<div class="width55 floatcenter">
          <h2>
            <?php echo JHTML::link($product->link$product->product_name); ?>
           </h2>



i have this one I changed the heading<h6><?php echo JHTML::link($product->link$product->product_name); ?></h6>


sunnysbulbs

Thanks for the quick reply. I did the following and it works for sure.

In \html\com_virtuemart\category\default.php the following from...

<div class="width55 floatcenter">
          <h2>
            <!-- <?php echo JHTML::link($product->link$product->product_name); ?>-->
            <?php echo $product->product_name?>
          </h2>


to..

<?php echo JHTML::link(JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$product->virtuemart_category_id), $product->product_name, array('title' => $product->product_name)); ?>

srajca