News:

Support the VirtueMart project and become a member

Main Menu

Only show ask a question about product when product have price

Started by luiskar, May 10, 2014, 11:50:59 AM

Previous topic - Next topic

luiskar

I want the button ask a question only shows when the product have price, because if the product don't have it already shows a consult button. I look for in the code and i think here is where i need to change the code, but i don't know what to do. I added && $product->prices['salesPrice']>0 in the if sentence but doesn't work.

if (VmConfig::get('ask_question', 0) == 1 ] && $product->prices['salesPrice']>0) {


    ?>

    <div class="ask-a-question">

        <a class="ask-a-question" href="<?php echo $this->askquestion_url ?>" rel="nofollow" ><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ENQUIRY_LBL'?></a>

        <!--<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 }

?>

luiskar

Finally I figure out. if anyone are interested, this is the code
if ($this->product->prices['salesPrice']>0 and VmConfig::get('ask_question', 0) == 1) {

    ?>

    <div class="ask-a-question">

        <a class="ask-a-question" href="<?php echo $this->askquestion_url ?>" rel="nofollow" ><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ENQUIRY_LBL'?></a>

        <!--<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 }

?>