Author Topic: Call for Price  (Read 11362 times)

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10435
  • VirtueMart Version: 3+
Re: Call for Price
« Reply #15 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

ChristinaT

  • Beginner
  • *
  • Posts: 8
Re: Call for Price
« Reply #16 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!

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10435
  • VirtueMart Version: 3+
Re: Call for Price
« Reply #17 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

prismalight

  • Beginner
  • *
  • Posts: 19
Re: Call for Price
« Reply #18 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.

prismalight

  • Beginner
  • *
  • Posts: 19
Re: Call for Price
« Reply #19 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.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10435
  • VirtueMart Version: 3+
Re: Call for Price
« Reply #20 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');

ChristinaT

  • Beginner
  • *
  • Posts: 8
Re: Call for Price
« Reply #21 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

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10435
  • VirtueMart Version: 3+
Re: Call for Price
« Reply #22 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 ?>

ChristinaT

  • Beginner
  • *
  • Posts: 8
Re: Call for Price
« Reply #23 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!

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10435
  • VirtueMart Version: 3+
Re: Call for Price
« Reply #24 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
      ?>

Tirrawarra

  • Beginner
  • *
  • Posts: 36
Re: Call for Price
« Reply #25 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


PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10435
  • VirtueMart Version: 3+
Re: Call for Price
« Reply #26 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"


ivus

  • Full Member
  • ***
  • Posts: 534
  • - YAY me... proud member of the 500 club...
Re: Call for Price
« Reply #27 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.

Tirrawarra

  • Beginner
  • *
  • Posts: 36
Re: Call for Price
« Reply #28 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