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

eporedieis

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

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10377
  • VirtueMart Version: 3+
Re: "call for price" link removal - Different request
« Reply #31 on: February 18, 2011, 17:52:56 pm »
eporedieis, does every product have a price of 0?
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

eporedieis

  • Beginner
  • *
  • Posts: 10
Re: "call for price" link removal - Different request
« Reply #32 on: February 18, 2011, 17:59:31 pm »
No. Any products are their price, any other not :-)

PRO

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

eporedieis

  • Beginner
  • *
  • Posts: 10
Re: "call for price" link removal - Different request
« Reply #34 on: February 19, 2011, 10:02:32 am »
Not bad this idea. You're a genious :) :)
Now I try!

eporedieis

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

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10377
  • VirtueMart Version: 3+
Re: "call for price" link removal - Different request
« Reply #36 on: February 19, 2011, 14:37:42 pm »
thats because my code goes in the flypage

replace <? php echo $product_price ?> with my code
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

eporedieis

  • Beginner
  • *
  • Posts: 10
Re: "call for price" link removal - Different request
« Reply #37 on: February 19, 2011, 19:18:32 pm »
Ok thanks!! Tomorrow I'll try it!! :)

eporedieis

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

eporedieis

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

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10377
  • VirtueMart Version: 3+
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

eporedieis

  • Beginner
  • *
  • Posts: 10
Re: "call for price" link removal - Different request
« Reply #41 on: February 20, 2011, 19:10:34 pm »
U're my God :)

Florencia

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

treodude

  • Jr. Member
  • **
  • Posts: 57
Re: "call for price" link removal - Different request
« Reply #43 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