VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Products, Prices, Tax and Categories VM 1.1 => Topic started by: djreason on January 13, 2010, 01:53:23 am

Title: "call for price" link removal - Different request
Post by: djreason on January 13, 2010, 01:53:23 am
I know there are a ton of questions out there concerning how to totally remove the link from the flypage if you do not wish to display the "call for pricing" option on those products that do not have pricing defined. 

However, I still want this message to appear.  What i DONT want is for it to be a clickable link to a separate email form. All I want is the text "Call for Pricing". 

How/Where can I remove the functionality of this part of my flypage so that it looks like static text and not a clickable link?

I am using Joomla 1.5.14 and VM 1.1.3 with the default theme.
Title: Re: "call for price" link removal - Different request
Post by: rojones31 on January 14, 2010, 16:08:29 pm
I'm having the same problem. Can anyone point me in right direction. I want to get rid/disable the "Call for pricing" link shown in the cart.  Please help!
Title: Re: "call for price" link removal - Different request
Post by: LeopardMan on February 01, 2010, 09:35:58 am
Yep - me too, having the same problem.
It seems most threads on this topic date back to 2006 and 2007, as do the answers.
But the solutions given are not to be found in the latest version of VM.

Can anybody help out?

In which file can I find the "mailto" link that is under "Call for pricing"?
I have changed the "Call for pricing" in english.php in the language directory, but the link to "mailto" still exists...
Title: Re: "call for price" link removal - Different request
Post by: Forrest on February 02, 2010, 22:51:02 pm
Here's a quick and easy fix that is template based as to not hack your core. Go to your category and product details templates:
/components/com_virtuemart/themes/vmj_genx/templates/browse
/components/com_virtuemart/themes/vmj_genx/templates/product_details

and where it normally calls out for "<?php echo $product_price ?>" you can  check for the "Call for Pricing" string, and if that exists, then do something other than "<?php echo $product_price ?>".... like this:


<?php if (stristr( $product_price, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') )) { ?>

PUT WHATEVER YOU WANT HERE WHEN NO PRICING. IF NOTHING, THEN REMOVE THIS LINE.

<? } else { ?>

        <?php echo $product_price ?>
        <?php echo $addtocart ?>            

<?php } ?>


In this example, my product price AND addtocart are not called out since there is not point in calling out addtocart when you cant addtocart anyways.
Title: Re: "call for price" link removal - Different request
Post by: LeopardMan on February 05, 2010, 17:55:52 pm
Could you tell me what my options are if the sentence
<?php if (stristr( $product_price, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') )) { ?>
does not appear in any of the files in those two templates?

What are my options of hacking into the core, to get this string out? It now points to a "mailto" link, which I don't want.

Title: Re: "call for price" link removal - Different request
Post by: PRO on February 05, 2010, 18:47:55 pm
templates/common/price.tpl

<?php
// 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&amp;product_id='.$product_id.'&amp;subject='. urlencode( $VM_LANG->_('PHPSHOP_PRODUCT_CALL').": $product_name") );
   echo vmCommonHTML::hyperLink( $link, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') );

}
?>


You are going to have to change the code in bold to whatever you want it to say
Title: Re: "call for price" link removal - Different request
Post by: Forrest on February 05, 2010, 19:14:52 pm
<?php if (stristr( $product_price, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') )) { ?>

will NOT appear in your template... that is what you need to add! Add the whole statement around <?php echo $product_price ?> and if you wish include <?php echo $addtocart ?>.
     
Title: Re: "call for price" link removal - Different request
Post by: PRO on February 05, 2010, 20:32:35 pm
templates/common/price.tpl

<?php
// 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&amp;product_id='.$product_id.'&amp;subject='. urlencode( $VM_LANG->_('PHPSHOP_PRODUCT_CALL').": $product_name") );
   echo vmCommonHTML::hyperLink( $link, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') );

}
?>


You are going to have to change the code in bold to whatever you want it to say



Tried it

Changed it to this, and it worked


<?php
// User is not allowed to see a price or there is no price
if( !$auth['show_prices'] || !isset($price_info["product_price_id"] )) {
   
echo "Please Call";
}
?>
Title: Re: "call for price" link removal - Different request
Post by: GenX1980 on April 07, 2010, 22:58:05 pm
I tried this and it did not work.  I am using Joomla 1.15 and Virtue mart version 1.1.4 and need to get rid of the link for call for pricing and need to replace it with some plain text with no link.  I also need to enlarge the thumbnail size to be a little larger for products..

Any suggestions?
Title: Re: "call for price" link removal - Different request
Post by: Forrest on April 07, 2010, 23:12:32 pm
There are TWO solutions in this post, did you try them both?
Ia m on 1.5.15 and VM 1.1.4, and I know I tested my solution.
Title: Re: "call for price" link removal - Different request
Post by: androydtech on April 15, 2010, 00:00:47 am
templates/common/price.tpl

<?php
// 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&amp;product_id='.$product_id.'&amp;subject='. urlencode( $VM_LANG->_('PHPSHOP_PRODUCT_CALL').": $product_name") );
   echo vmCommonHTML::hyperLink( $link, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') );

}
?>


You are going to have to change the code in bold to whatever you want it to say



Tried it

Changed it to this, and it worked


<?php
// User is not allowed to see a price or there is no price
if( !$auth['show_prices'] || !isset($price_info["product_price_id"] )) {
   
echo "Please Call";
}
?>


Good Idea, but if you want to leave a simple text (eg. Reserved price, register)


<?php
// User is not allowed to see a price or there is no price
if( !$auth['show_prices'] || !isset($price_info["product_price_id"] )) {
   
   echo $VM_LANG->_('PHPSHOP_PRODUCT_CALL') ;
   
}
?>


Remember modify in administrator-->components-->com_virtuemart-->languages-->common

chose the language.php and find "PHPSHOP_PRODUCT_CALL" for to change a text.

Title: Re: "call for price" link removal - Different request
Post by: kemiga on June 04, 2010, 04:17:43 am
Hi Forrest

I am looking for some "show price url range" (product_price) between 2 values ex.
link example (in the left side): http://www.wine.com.br/

00-40
40-80
80-120 etc

I saw your posts related close to what I was looking for.
Do you have an idea of how to solve this?

I'm using Joomla 1.5.17 and VM 1.1.4

By the way: Nice things you have done so far!
Title: Re: "call for price" link removal - Different request
Post by: Forrest on June 04, 2010, 07:12:36 am
Not sure I fully understand you. It looks like you have created categories to accomplish price range assignment. What else are you wanting?
Title: Re: "call for price" link removal - Different request
Post by: kemiga on June 04, 2010, 14:28:29 pm
Sorry for my description. Try to write with more precision.

wine.com.br is not my site, but a reference to what I want in another site.
I want to have the same option as in wine.com.br and to work with virtuemart 1.1.4
Like you said, I could actually do it with categories, but I don't think that is the most optimal solution.

Do you think that it would be possible in joomla/ virtuemart?
Title: Re: "call for price" link removal - Different request
Post by: Forrest on June 05, 2010, 10:35:37 am
Yes, use Product Types... and look for a navigation for products types on this forum... I'm pretty sure there is one.

Otherwise, no, categories is your next best way beyond creating a custom search function.
Title: Re: "call for price" link removal - Different request
Post by: LikeStuff on September 25, 2010, 03:50:31 am

This works for me on the browse page as well as the product details page.

templates/common/price.tpl

Code: [Select]
<?php
// User is not allowed to see a price or there is no price
if( !$auth['show_prices'] || !isset($price_info["product_price_id"] )) {
   
echo 
"Please Call";
}
?>

The only issue is on the product details page the quantity box and add to cart button is not disabled.  I think that because the product is not available these should be disabled because the customer can still add the item to the cart and the cost is $0 (so they may think that it's free)

I have attached an image so you can see what I mean.

Can anyone assist me on how to do this.  Thanks in advance.

[attachment cleanup by admin]
Title: Re: "call for price" link removal - Different request
Post by: PRO on September 25, 2010, 23:27:24 pm
LikeStuff, are all your products like this?
Title: Re: "call for price" link removal - Different request
Post by: LikeStuff on September 25, 2010, 23:32:13 pm
Yes, all the products are set-up the same.  I think that's what you mean?

Thanks!!
Title: Re: "call for price" link removal - Different request
Post by: PRO on September 26, 2010, 13:41:49 pm
you can take the add to cart out of the flypage template
Title: Re: "call for price" link removal - Different request
Post by: LikeStuff on September 27, 2010, 20:29:01 pm
Hi BanquetTables.pro,

If I remove the "Add to Cart" code, as per below, it removes it for all products not just the ones that are unavailable.  I guess I need to know how to hide it if the product is unavailable.

Code: [Select]
<?php echo $addtocart ?>
Thank you.
Title: Re: "call for price" link removal - Different request
Post by: PRO on September 28, 2010, 02:47:29 am
should be able to use an if statement


<?php if($product_price ==0) { ?>
<?php }
elseif($product_price >=1){?><?php echo $addtocart ?>



remember to close the if statement
Title: Re: "call for price" link removal - Different request
Post by: LikeStuff on October 03, 2010, 20:48:19 pm
Thanks.  I'm haven't gotten it to work yet but I'm trying...
Title: Re: "call for price" link removal - Different request
Post by: randomperson on October 09, 2010, 15:55:31 pm
well, you can remove the "call for pricing" link from the virtuemart but that doesn't solve everything. how does that prevent a user to go to the direct link for the "call for pricing" and then sending the mail? how do i disable the page itself?
Title: Re: "call for price" link removal - Different request
Post by: PRO on October 09, 2010, 18:05:29 pm
where would they find the link if the link is not there?
Title: Re: "call for price" link removal - Different request
Post by: randomperson on October 10, 2010, 00:47:07 am
that's like saying that a website can't be hacked because the text field with administrator password is in a hidden div

a person who knows his virtuemart/a bot can abuse the form to generate unwanted spam. that's why i wanted to disable in first place
Title: Re: "call for price" link removal - Different request
Post by: PRO on October 10, 2010, 03:53:31 am
ok then, delete shop.ask


and if you are a developer, redirect it to homepage
Title: Re: "call for price" link removal - Different request
Post by: doribeeler on October 31, 2010, 15:38:44 pm
My turn to add to this thread - I really hope someone is out there still moderating it!

I have attempted to change the page that the "Call for Pricing" link goes too and while I do not get an error, the link seems to go to the right page, but it renders the VM home page content instead of the desired page content...

I will explain in detail what I have done to date:

Opened the english.php file and changed the text on line 285 to read "Contact for Pricing"

I would like then this link to go an existing contact form on the website located at this hard coded URL:
http://www.lumenytesecurity.com/index.php?option=com_contact&view=contact&id=12&Itemid=217 (http://www.lumenytesecurity.com/index.php?option=com_contact&view=contact&id=12&Itemid=217)

So the next step, according to the forums on this topic was to go to this file:
themes/default/templates/common/price.tpl.php
line 7 and change this code:
Code: [Select]
$link = $sess->url( $_SERVER['PHP_SELF'].'?page=shop.ask&amp;product_id='.$product_id.'&amp;subject='. urlencode( $VM_LANG->_('PHPSHOP_PRODUCT_CALL').": $product_name") );
echo vmCommonHTML::hyperLink( $link, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') );

I changed it to this:
Code: [Select]
$link = $sess->url( $_SERVER['PHP_SELF'].'http://www.lumenytesecurity.com/index.php?option=com_contact&view=contact&id=12&Itemid=217'. urlencode( $VM_LANG->_('PHPSHOP_PRODUCT_CALL').": $product_name") );
echo vmCommonHTML::hyperLink( $link, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') );

The key change being - adjusted the link from
?page=shop.ask&amp;product_id='.$product_id.'&amp;subject=

to:
http://www.lumenytesecurity.com/index.php?option=com_contact&view=contact&id=12&Itemid=217

What I get is, instead of the actual form appearing in the content area, I get the modules assigned to that page, but I do not get the contact form, I get the standard content for the VM homepage...

Can someone please advise????
Or perhaps, someone can tell me how to remove the link altogether and have just the text "Contact for pricing"? I am not a code writer or developer so detailed instructions would be much appreciated.
Thank you
 :-\!
Title: Re: "call for price" link removal - Different request
Post by: PRO on October 31, 2010, 19:02:22 pm
$sess->url( $_SERVER['PHP_SELF'].'


I am not a PHP guy, but I dont believe that goes in the code if you are going to add the whole custom url.

THEN this code adds the product name to the url, which does not need to be there
urlencode( $VM_LANG->_('PHPSHOP_PRODUCT_CALL').": $product_name") );
echo vmCommonHTML::hyperLink( $link, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') );


So, you just have some format problems, thats it
Title: Re: "call for price" link removal - Different request
Post by: doribeeler on October 31, 2010, 19:37:02 pm
Thank you for the reply... however Im not a php person either... I tried several variations of your recommendations and Im sorry to say that it didnt work entirely.

In order to keep the "Contact for Pricing" text the
Code: [Select]
urlencode( $VM_LANG->_('PHPSHOP_PRODUCT_CALL').": $product_name") );
echo vmCommonHTML::hyperLink( $link, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') );
actually needed to remain in place, otherwise that text disappeared.

Right now I have the code as such:
Code: [Select]
$link = $sess->url('http://www.lumenytesecurity.com/index.php?option=com_contact&view=contact&id=12&Itemid=217'.urlencode( $VM_LANG->_('PHPSHOP_PRODUCT_CALL').": $product_name") );
echo vmCommonHTML::hyperLink( $link, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') );

So I did utilize part of the suggestion where I remove the portion:
Code: [Select]
[$_SERVER['PHP_SELF'].


The link still goes to another page which is great, however the content being displayed is still the content of the VM homepage.

I might wager a theory that perhaps since in the Configuration of the store, the IP address for the site is still in effect as apposed to the actual domain name, that might be throwing the results off - does anyone have a thought on that?

All input is much appreciated... oh and BTW, Im using VM 1.1.5
Thank you!
Title: Re: "call for price" link removal - Different request
Post by: PRO on November 01, 2010, 14:17:40 pm
try to change it to the ip and see what happens?

or you could just change the code to a href easily
Title: Re: "call for price" link removal - Different request
Post by: eporedieis on February 18, 2011, 16:05:59 pm
Hi, excuse me if I re-open an old thread, but it's very interesting and I've an ask :D

I would to insert, before "call for pricing" a "starting from x.xx$", that is different for every product (that has the price to 0,00$).
It is possible? How can I create this new value for any products? Thank you very much!
Title: Re: "call for price" link removal - Different request
Post by: PRO on February 18, 2011, 17:52:56 pm
eporedieis, does every product have a price of 0?
Title: Re: "call for price" link removal - Different request
Post by: eporedieis on February 18, 2011, 17:59:31 pm
No. Any products are their price, any other not :-)
Title: Re: "call for price" link removal - Different request
Post by: PRO on February 18, 2011, 18:47:26 pm
the only way you can do this without adding a new field is to do something like this
What this code does is uses the "product unit" as the starting from price.
So, for all NON $0 items, you use "piece" for product unit. AND if the price is $0. You put the starting from in the product unit field.

Code: [Select]
<?php if ($product_unit == 'piece') { ?><? php echp $product_price ?><?php } if ($product_unit != 'piece') { ?>Starting&nbsp;From&nbsp;$<?php echo $product_unit ?><?php echo $product_price ?><?php ?>
Title: Re: "call for price" link removal - Different request
Post by: eporedieis on February 19, 2011, 10:02:32 am
Not bad this idea. You're a genious :) :)
Now I try!
Title: Re: "call for price" link removal - Different request
Post by: eporedieis on February 19, 2011, 10:54:53 am
Mmm...there is an error, but I'm not too good to solve it :( Can you help me please?
Code: [Select]
<?php if ($product_unit == 'piece') { ?> <? php echo $product_price ?><?php } if ($product_unit != 'piece') { ?>A&nbsp;Partire&nbsp;da&nbsp;$<?php echo $product_unit ?><?php echo $product_price ?><?php ?>
I insert the code at line 9 of price.tpl.php
Code: [Select]
<?php
// User is not allowed to see a price or there is no price
if( !$auth['show_prices'] || ( !isset($price_info["product_price_id"] ) && ( !$parent_has_children) ) ) {

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

And the error is
Quote
Parse error: parse error, unexpected '<' in (site)\components\com_virtuemart\themes\default\templates\common\price.tpl.php on line 9

Thank you very much  :)
Title: Re: "call for price" link removal - Different request
Post by: PRO on February 19, 2011, 14:37:42 pm
thats because my code goes in the flypage

replace <? php echo $product_price ?> with my code
Title: Re: "call for price" link removal - Different request
Post by: eporedieis on February 19, 2011, 19:18:32 pm
Ok thanks!! Tomorrow I'll try it!! :)
Title: Re: "call for price" link removal - Different request
Post by: eporedieis on February 20, 2011, 11:00:01 am
Great, it works!
I've modified the default value to view "Starting from": not yet "price" but an empty value. So if the product_price is empty, is visible only the price. If product_price isn't empty, you can see "Starting from".
Thank you very much!

Code: [Select]
<?php if ($product_unit == '') { ?> <? php echo $product_price ?><?php } if ($product_unit != '') { ?>Starting&nbsp;From&nbsp;<?php echo $product_unit ?><?php ?>
Title: Re: "call for price" link removal - Different request
Post by: eporedieis on February 20, 2011, 11:37:07 am
Another question (excuse me eheh).

Why this script doesn't work in the browse_1.php? It says "Undefined variable"...
Title: Re: "call for price" link removal - Different request
Post by: PRO on February 20, 2011, 18:28:03 pm
http://virtuemart.net/documentation/Developer_Manual/Modifying_the_Layout.html#Templates
Title: Re: "call for price" link removal - Different request
Post by: eporedieis on February 20, 2011, 19:10:34 pm
U're my God :)
Title: Re: "call for price" link removal - Different request
Post by: Florencia on April 06, 2012, 19:58:29 pm
How about? I've been going through the same, however, achieved through the code that set up:

<Php?
/ / El usuario no se le permite ver un precio o no hay un precio
if (! $ auth [ de los show_prices ] | | (isset (! $ price_info [ "product_price_id" ]) && (! $ parent_has_children )))
   
   $ Product_name " ));
   echo  vmCommonHTML :: hipervínculo (  $ link ,  $ VM_LANG -> _ ( 'PHPSHOP_PRODUCT_CALL' ));
*** aquí código ***
}
?>
Title: Re: "call for price" link removal - Different request
Post by: treodude on January 05, 2013, 13:49:05 pm
Quote
try to change it to the ip and see what happens?

or you could just change the code to a href easily

Hi guys, I am enoucntering the same problem atm.
I've tried changing the php code as well, and also came to the point of making it return tot the VM homepage.
However, I want this to change to the Contact page, using a href. Can someone help me please?

Thanks in advance