News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Call for Price

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

Previous topic - Next topic

PRO

Quote from: 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.

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

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

you could do a separate product page layout for those products, with no add to cart button

prismalight

Quote from: 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
<?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

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

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

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

Quote from: 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

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

Another issue: can somebody tell me how I can remove the "Add to Cart" button for the products with no price?

Thanks!

PRO

Quote from: 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!


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

Hello,

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


PRO

Quote from: 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



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

COM_VIRTUEMART_PRODUCT_ENQUIRY_LBL="Request Quote/Ask Question"


ivus

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

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