Author Topic: "call for price" link removal - Different request  (Read 30052 times)

LikeStuff

  • Beginner
  • *
  • Posts: 48
Re: "call for price" link removal - Different request
« Reply #15 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]

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10319
  • VirtueMart Version: 3+
Re: "call for price" link removal - Different request
« Reply #16 on: September 25, 2010, 23:27:24 pm »
LikeStuff, are all your products like this?
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

I do NOT do development work for hire.

LikeStuff

  • Beginner
  • *
  • Posts: 48
Re: "call for price" link removal - Different request
« Reply #17 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!!

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10319
  • VirtueMart Version: 3+
Re: "call for price" link removal - Different request
« Reply #18 on: September 26, 2010, 13:41:49 pm »
you can take the add to cart out of the flypage template
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

I do NOT do development work for hire.

LikeStuff

  • Beginner
  • *
  • Posts: 48
Re: "call for price" link removal - Different request
« Reply #19 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.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10319
  • VirtueMart Version: 3+
Re: "call for price" link removal - Different request
« Reply #20 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
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

I do NOT do development work for hire.

LikeStuff

  • Beginner
  • *
  • Posts: 48
Re: "call for price" link removal - Different request
« Reply #21 on: October 03, 2010, 20:48:19 pm »
Thanks.  I'm haven't gotten it to work yet but I'm trying...

randomperson

  • Beginner
  • *
  • Posts: 16
Re: "call for price" link removal - Different request
« Reply #22 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?

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10319
  • VirtueMart Version: 3+
Re: "call for price" link removal - Different request
« Reply #23 on: October 09, 2010, 18:05:29 pm »
where would they find the link if the link is not there?
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

I do NOT do development work for hire.

randomperson

  • Beginner
  • *
  • Posts: 16
Re: "call for price" link removal - Different request
« Reply #24 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

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10319
  • VirtueMart Version: 3+
Re: "call for price" link removal - Different request
« Reply #25 on: October 10, 2010, 03:53:31 am »
ok then, delete shop.ask


and if you are a developer, redirect it to homepage
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

I do NOT do development work for hire.

doribeeler

  • Beginner
  • *
  • Posts: 41
Re: "call for price" link removal - Different request
« Reply #26 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

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
 :-\!

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10319
  • VirtueMart Version: 3+
Re: "call for price" link removal - Different request
« Reply #27 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
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

I do NOT do development work for hire.

doribeeler

  • Beginner
  • *
  • Posts: 41
Re: "call for price" link removal - Different request
« Reply #28 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!

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10319
  • VirtueMart Version: 3+
Re: "call for price" link removal - Different request
« Reply #29 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
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

I do NOT do development work for hire.