VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: ngodoan on December 10, 2012, 06:39:21 AM

Title: "Call for price" dont show
Post by: ngodoan on December 10, 2012, 06:39:21 AM
I using JL 2.5 & Vm 2.0.12b . I checked "call for price, when the price is empty" in Price configuration. But it dont show anything.

Plz see an image in attach file and tell me how I can show "Call for price"

Thanks alot.


[attachment cleanup by admin]
Title: Re: "Call for price" dont show
Post by: bytelord on December 10, 2012, 08:04:50 AM
Hello,

I am using the following code for the ask for price inside default_showprices.php

if (empty($this->product->prices['salesPrice']) and VmConfig::get ('askprice', 1) and isset($this->product->images[0]) and !$this->product->images[0]->file_is_downloadable) {
      ?>
      <a class="ask-a-question bold" href="<?php echo $this->askquestion_url ?>"><?php echo JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE') ?></a>

Also please can you turn vmdebug on and check the prices if are 0?

Regards
Title: Re: "Call for price" dont show
Post by: ngodoan on December 10, 2012, 08:47:40 AM
thanks for reply.
my file : default_showprice.php is:

//vmdebug('view productdetails layout default show prices, prices',$this->product->prices);
if (empty($this->product->prices) and VmConfig::get ('askprice', 1) and !$this->product->images[0]->file_is_downloadable) {
?>
<a class="ask-a-question bold" href="<?php echo $this->askquestion_url ?>"><?php echo JText::('COM_VIRTUEMART_PRODUCT_ASKPRICE'?></a>
<?php
}


How I can rewrite it to show "Call for price" ?
Title: Re: "Call for price" dont show
Post by: bytelord on December 10, 2012, 08:54:10 AM
I think i post it before

if (empty($this->product->prices['salesPrice']) and VmConfig::get ('askprice', 1) and isset($this->product->images[0]) and !$this->product->images[0]->file_is_downloadable) {


Regards
Title: Re: "Call for price" dont show
Post by: bytelord on December 10, 2012, 08:55:10 AM
btw, you should upgrade at least to version 2.0.12f  if not to 2.0.14

Regards
Title: Re: "Call for price" dont show
Post by: ngodoan on December 10, 2012, 11:30:35 AM
thanks all. I have upadated to VM 2.0.14 & fixed Call for price.
Title: Re: "Call for price" dont show
Post by: bytelord on December 10, 2012, 12:04:13 PM
Nice,

Don't forget to update your template files: http://virtuemart.net/index.php?option=com_content&id=416

Regards
Title: Re: "Call for price" dont show in category view
Post by: etna on December 16, 2012, 14:29:55 PM
Hello
My problem is that I cannot turn on the link "Call for price" in category view.
To do this I think that we must change the category/default.php  code below to be a link in the popup call for price:
echo JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE');
How can we achieve that?
Thank you


Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Title: Re: "Call for price" dont show
Post by: bytelord on December 16, 2012, 14:34:38 PM
Hello,

I use this (may be i use different classes), make it as you wish:

<?php //code to display call for price in category with enabled !
if (empty($product->prices['salesPrice']) and VmConfig::get ('askprice'1)) {
    $url JRoute::_('index.php?option=com_virtuemart&view=productdetails&task=askquestion&virtuemart_product_id=' $product->virtuemart_product_id '&virtuemart_category_id=' $product->virtuemart_category_id '&tmpl=component');
?>

       <div class="call-for-price">
<a class="modal button" rel="{handler: 'iframe', size: {x: 700, y: 550}}" href="<?php echo $url ?>"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ASKPRICE_CART'?></a>
       </div>
      <?php ?>


Regards
Title: Re: "Call for price" dont show
Post by: etna on December 16, 2012, 19:44:37 PM
Yes it worked !!!
Fast and reliable.
(I just added a "?>" in the 1st line.)
As I checked in VM 2.0.15d the link is also missing.
I think that somebody should put it in the next revisions.

Thank you
Title: Re: "Call for price" dont show
Post by: jenkinhill on December 16, 2012, 19:48:30 PM
etna I believe that is already done. Odd numbered verions (like 2.0.15) are test versions for debugging, not for use on live sites.
Title: Re: "Call for price" dont show
Post by: bytelord on December 16, 2012, 20:19:59 PM
Yes,

Is embedded under prices section, printouts only the label, not the 'link' to open the from like "ask a question" ... i think :)
Title: Re: "Call for price" dont show
Post by: etna on December 17, 2012, 17:25:46 PM
Problema!
"Call for price" works perfect locally (WAMP) but when in live I got a blank page.
Writing back the original code
echo JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE');
turns OK.
The only difference is the PHP version, instead of 5.3.13 is 5.3.10
Any ideas?

Thank you.

Title: Re: "Call for price" dont show
Post by: bytelord on December 17, 2012, 17:30:25 PM
Hello,

I think this is related to your sef/htaccess settings. Please disable them for start (disable both joomla/vm2 sef and also mod_url_rerwriting and rename your htaccess file to something else). Also please check your joomla error log file and paste here your results.

Regards
Title: Re: "Call for price" dont show
Post by: etna on December 17, 2012, 18:32:07 PM
Well
I disabled both SEF, renamed .htaccess, cleared the cache, reupload the file and worked.
Then I reactivate both SEF .htaccess and it worked again.
I think that it was cache issue.

Thank you again



Title: Re: "Call for price" dont show
Post by: bytelord on December 17, 2012, 18:34:12 PM
Yes, or maybe wrong session information when testing ...

but you solved it.

Regards