I want to add the "ask a question about this product" button to each product in category view
I have tried to add
<?php // Ask a question about this product
if (VmConfig::get('ask_question', 1) == 1) {
?>
<div class="ask-a-question">
<a class="ask-a-question modal" rel="{handler: 'iframe', size: {x: 700, y: 550}}" href="<?php echo $this->askquestion_url ?>"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ENQUIRY_LBL') ?></a>
</div>
<?php } ?>
but it doesn't seem to be working ...
Any help would be mutch appreciated
Try $product->askquestion_url
The solution is the following ..
I have added the following code to category view .. :::
<?php // Ask a question about this product
if (VmConfig::get('ask_question', 1) == 1) {
?>
<div class="ask-a-question">
<a class="ask-a-question modal" rel="{handler: 'iframe', size: {x: 700, y: 550}}" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=productdetails&task=askquestion&virtuemart_product_id=' . $product->virtuemart_product_id . '&virtuemart_category_id=' . $product->virtuemart_category_id . '&tmpl=component'); ?>"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ENQUIRY_LBL') ?></a>
</div>
<?php } ?>
SOLVED
Thanks,
Shyntaxx