VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: shyntaxx on September 14, 2013, 16:57:10 PM

Title: [SOLVED] How to add "Ask a question about this product" button in category view
Post by: shyntaxx on September 14, 2013, 16:57:10 PM
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
Title: Re: How to add "Ask a question about this product" button in category view
Post by: Maxim Pishnyak on September 16, 2013, 05:12:00 AM
Try $product->askquestion_url
Title: Re: How to add "Ask a question about this product" button in category view
Post by: shyntaxx on September 24, 2013, 19:47:21 PM
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