News:

Support the VirtueMart project and become a member

Main Menu

Call for Price

Started by denyal, December 14, 2011, 12:15:03 PM

Previous topic - Next topic

denyal

J 1.7.3 V 2.0.0RC3

When I leave a price empty, I'd like to show a link Call For Price. Or maybe I could write some text instead of putting numbers in Price.

I'm reading that this could be done in V 1.1

edit: this is some code from V 1.1 that I found in the forum, but I don't know if or how I can use it in V 2

// User is not allowed to see a price or there is no price
if( !$auth['show_prices'] || !isset($price_info["product_price_id"] )) {

$link = $sess->url( $_SERVER['PHP_SELF'].'?page=shop.ask&product_id='.$product_id.'&subject='. urlencode( $VM_LANG->_('PHPSHOP_PRODUCT_CALL').": $product_name") );
echo vmCommonHTML::hyperLink( $link, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') );
}
?>


and this is the topic where it says how to modify it in the old VM http://forum.virtuemart.net/index.php?topic=65510.0 - but I cannot find anything similar in the new VM

PS: Personally I'm interested in showing Call For Price in Category page

denyal

this is a quick fix I made

I put a link-button under the pic-thumbs in Category when the price is empty, and it connects me to my Contact form

in line 212
\components\com_virtuemart\views\category\tmpl\default.php

I added
<?php if ($this->show_prices == '1'){
if(empty(
$product->prices)){?>

<div class="ask-a-question">
<a class="ask-a-question" href="contact.html" ><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ASKPRICE'?></a>
</div>
<?php }
}
?>


and in
\language\en-GB\en-GB.com_virtuemart.ini

I added:
COM_VIRTUEMART_PRODUCT_ASKPRICE="Call for price"

denyal

well ... nope

If you put Prices ON, and you leave the price empty, then on Product Details page, you got a 'Price:' showing ... :-/

PRO


<?php if(empty($this->$basePrice)){  echo '<div class="ask-a-question">
<a class="ask-a-question" href="contact.html" ><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ASKPRICE') ?></a>
</div>';}
?>



xdoktor

Banquet Tables Pro = LEGEND!

denyal

but I'm a noob, I couldn't make it work like that  :-\

PRO

it will only work in the product page like that

Jeff

I need it to show on the category page as well as the product page
Jeff MacDougall

PRO

Quote from: Jeff on December 28, 2011, 06:44:56 AM
I need it to show on the category page as well as the product page


different between category and product page is $this->

$product->

PRO

this will be added to the core templates soon

PRO

Jeff, this can be added to the product page , but for the category page you will not get the ask question modal link. BUT it can display

"Call for price"

PRO

this has been added to the svn for category, and product details.

Category does pop up ask question.

ChristinaT

I am using Joomla! 1.7 and Virtuemart 2 and I would like to have a "call for price" (in a multilingual site) in a product when I leave the price empty and also in some custom fields that i define as cart variants. Please give me a detailed answer as I am a new to this.

Thank you in advance.

PRO

ChristinaT, what have you done? and where is the problem?

Vmart already has call for price.

Are you having problems with the other languages strings?

ChristinaT

When I leave the price empty in a custom field it is filled automatically with a zero, which is not what I want, and in a product it is just left empty and when added to cart it seems to be also free.