Author Topic: Call for Price  (Read 12095 times)

denyal

  • Beginner
  • *
  • Posts: 8
Call for Price
« on: December 14, 2011, 12:15:03 pm »
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

Code: [Select]
// 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

  • Beginner
  • *
  • Posts: 8
Re: Call for Price
« Reply #1 on: December 14, 2011, 14:05:12 pm »
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
Code: [Select]
<?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

  • Beginner
  • *
  • Posts: 8
Re: Call for Price
« Reply #2 on: December 14, 2011, 15:51:17 pm »
well ... nope

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

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10442
  • VirtueMart Version: 3+
Re: Call for Price
« Reply #3 on: December 14, 2011, 17:14:01 pm »

<?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

  • Jr. Member
  • **
  • Posts: 71
Re: Call for Price
« Reply #4 on: December 17, 2011, 15:31:16 pm »
Banquet Tables Pro = LEGEND!

denyal

  • Beginner
  • *
  • Posts: 8
Re: Call for Price
« Reply #5 on: December 23, 2011, 09:44:40 am »
but I'm a noob, I couldn't make it work like that  :-\

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10442
  • VirtueMart Version: 3+
Re: Call for Price
« Reply #6 on: December 23, 2011, 18:42:31 pm »
it will only work in the product page like that

Jeff

  • Jr. Member
  • **
  • Posts: 90
    • Web Stokers
Re: Call for Price
« Reply #7 on: December 28, 2011, 06:44:56 am »
I need it to show on the category page as well as the product page
Jeff MacDougall

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10442
  • VirtueMart Version: 3+
Re: Call for Price
« Reply #8 on: December 28, 2011, 11:22:57 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

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10442
  • VirtueMart Version: 3+
Re: Call for Price
« Reply #9 on: December 28, 2011, 11:23:22 am »
this will be added to the core templates soon

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10442
  • VirtueMart Version: 3+
Re: Call for Price
« Reply #10 on: December 28, 2011, 20:07:41 pm »
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

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10442
  • VirtueMart Version: 3+
Re: Call for Price
« Reply #11 on: December 28, 2011, 20:58:37 pm »
this has been added to the svn for category, and product details.

Category does pop up ask question.

ChristinaT

  • Beginner
  • *
  • Posts: 8
Re: Call for Price
« Reply #12 on: January 26, 2012, 17:08:18 pm »
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

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10442
  • VirtueMart Version: 3+
Re: Call for Price
« Reply #13 on: January 26, 2012, 18:06:15 pm »
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

  • Beginner
  • *
  • Posts: 8
Re: Call for Price
« Reply #14 on: January 26, 2012, 18:29:15 pm »
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.