VirtueMart Forum

VirtueMart 2 + 3 => Administration & Configuration => Topic started by: denyal on December 14, 2011, 12:15:03 pm

Title: Call for Price
Post by: denyal 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
Title: Re: Call for Price
Post by: denyal 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"
Title: Re: Call for Price
Post by: denyal 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 ... :-/
Title: Re: Call for Price
Post by: PRO 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>';}
?>


Title: Re: Call for Price
Post by: xdoktor on December 17, 2011, 15:31:16 pm
Banquet Tables Pro = LEGEND!
Title: Re: Call for Price
Post by: denyal on December 23, 2011, 09:44:40 am
but I'm a noob, I couldn't make it work like that  :-\
Title: Re: Call for Price
Post by: PRO on December 23, 2011, 18:42:31 pm
it will only work in the product page like that
Title: Re: Call for Price
Post by: Jeff on December 28, 2011, 06:44:56 am
I need it to show on the category page as well as the product page
Title: Re: Call for Price
Post by: PRO 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->
Title: Re: Call for Price
Post by: PRO on December 28, 2011, 11:23:22 am
this will be added to the core templates soon
Title: Re: Call for Price
Post by: PRO 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"
Title: Re: Call for Price
Post by: PRO 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.
Title: Re: Call for Price
Post by: ChristinaT 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.
Title: Re: Call for Price
Post by: PRO 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?
Title: Re: Call for Price
Post by: ChristinaT 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.
Title: Re: Call for Price
Post by: PRO on January 26, 2012, 19:24:20 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.

do you want to disable the add to cart for all products? and have them call for price for everything?

tell me more about your shop setup
Title: Re: Call for Price
Post by: ChristinaT on January 27, 2012, 13:00:27 pm
No, it is not something I want to apply to all the products, but to have the ability to add it to some products and some custom fields.

Thank you for your time!
Title: Re: Call for Price
Post by: PRO on January 27, 2012, 13:30:44 pm
you could do a separate product page layout for those products, with no add to cart button
Title: Re: Call for Price
Post by: prismalight on January 27, 2012, 19:19:51 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"

is line 212 still up to date. would be great if you can indicate / quote the code to add this!
On top of this I would like to ask how to add the product sku or a link of the product to the body message in contact.
I also would link to use this function instead of the link ask for more details about this product. I would recommend to use for all email request the com_module as this can be easily modified like "captcha" and is one central module.
Title: Re: Call for Price
Post by: prismalight on January 27, 2012, 19:26:43 pm
is line 212 still up to date. would be great if you can indicate / quote the code to add this!
On top of this I would like to ask how to add the product sku or / and a link of the product to the body message of contact module.
I also would like to use this function instead of the link "ask for more details about this product" at product detail page.
I would recommend to use for all email request the contact_module as this can be easily modified like "captcha" and is one central module.
Title: Re: Call for Price
Post by: PRO on January 27, 2012, 20:00:54 pm
call for price is already available in the latest verion
https://dev.virtuemart.net/svn/virtuemart/trunk/virtuemart/components/com_virtuemart/views/category/tmpl/default.php

if(empty($product->prices) and VmConfig::get('callfprice',1) and empty($product->images[0]->file_is_downloadable) ){
                     echo JText::_('COM_VIRTUEMART_PRODUCT_ASKPRICE');
Title: Re: Call for Price
Post by: ChristinaT on January 28, 2012, 23:32:23 pm
Is it also available for a custom field? Could you please tell me if not, the code in order to achieve it? Which means if I leave empty a custom field price to display a "call for price" message?

thanks in advance
Title: Re: Call for Price
Post by: PRO on January 29, 2012, 04:11:07 am
Is it also available for a custom field? Could you please tell me if not, the code in order to achieve it? Which means if I leave empty a custom field price to display a "call for price" message?

thanks in advance

The custom field has used a language string   "Free" for customs that dont cost extra.
You could change the language string,


or do a strip and replace.
views/productdetails/tmpl/default.php

<?php $field->display = str_replace( 'Free', 'WHAT-U-WANT-HERE', $field->display ); ?><?php echo $field->display ?>
Title: Re: Call for Price
Post by: ChristinaT on February 23, 2012, 12:46:57 pm
Another issue: can somebody tell me how I can remove the "Add to Cart" button for the products with no price?

Thanks!
Title: Re: Call for Price
Post by: PRO on February 23, 2012, 17:16:42 pm
Another issue: can somebody tell me how I can remove the "Add to Cart" button for the products with no price?

Thanks!


The code is already in the latest version. MAKE sure you are not using a template override.

      <?php
      // Add To Cart Button
//          if (!empty($this->product->prices) and !empty($this->product->images[0]) and $this->product->images[0]->file_is_downloadable==0 ) {
      if (!VmConfig::get('use_as_catalog', 0) and !empty($this->product->prices)) {
          echo $this->loadTemplate('addtocart');
      }  // Add To Cart Button END
      ?>
Title: Re: Call for Price
Post by: Tirrawarra on July 24, 2012, 16:58:08 pm
Hello,

where in 2.06 would I modify the 'call for price' text to say (example) "call for pricing"
thanks in advance.  Steve

Title: Re: Call for Price
Post by: PRO on July 24, 2012, 18:22:29 pm
Hello,

where in 2.06 would I modify the 'call for price' text to say (example) "call for pricing"
thanks in advance.  Steve



http://forum.virtuemart.net/index.php?topic=92944.0

COM_VIRTUEMART_PRODUCT_ENQUIRY_LBL="Request Quote/Ask Question"

Title: Re: Call for Price
Post by: ivus on July 24, 2012, 20:47:23 pm
Hi Tirrawarra and BanquetTables.pro,

That file "en-gb.override.php" is used by Joomla in the admin section.

Admin > Extensions > Language Manager > Overrides
/administrator/index.php?option=com_languages&view=override&layout=edit

Simply create a new item, and do a VALUE search for "call for price" in the right hand panel. This will give you results which contain your phrases. Then it's simply a case of finding and altering the one you want to change.

This takes the guess work out of knowing the constant name.

I hope this helps.
Title: Re: Call for Price
Post by: Tirrawarra on July 25, 2012, 12:45:33 pm
Hi Ivus,

thank you.
It didn't make sense till I followed your links to Admin > Extensions > Language Manager > Overrides and found an interface to make the manual overrides - which worked perfect.

much appreciated.

Cheers Steve