Author Topic: "Call for price"-link disappeared after update to 2.0.12  (Read 5398 times)

webzie

  • Beginner
  • *
  • Posts: 9
"Call for price"-link disappeared after update to 2.0.12
« on: October 09, 2012, 17:50:47 pm »
When the product-price is left empty and the checkbox for 'Show call for price, when the price is empty' is checked in VM configuration, the link 'call for price'  doesn't show anymore in VM after update to 2.0.12.

In the file '/com_virtuemart/category/default.php' when i looked at the line:
   if(empty($product->prices) and VmConfig::get('askprice',1) and empty($product->images[0]->file_is_downloadable) ){
                     echo JText::_('COM_VIRTUEMART_PRODUCT_ASKPRICE');
                  }
When I changed 'empty($product->prices)' to '!empty($product->prices)', the link appears all of a sudden(with all products of course), implying that the SQL table ..._virtuemart_product_prices is not really empty when the price is set to zero, and it isn't because there is a price of 0.0000 showing in the table since the update and not empty anymore.

is this a bug, or am I doing something wrong?
Thnx

elcoserv

  • Beginner
  • *
  • Posts: 3
Re: "Call for price"-link disappeared after update to 2.0.12
« Reply #1 on: October 10, 2012, 00:46:44 am »
I have exactly the same issue.
I have joomla 2.5.7 and after upgrading virtuemart to 2.0.12b the label "call for price" is disappeared.
I tried many times to activate/deactivate call for price option, delete price and put it again...but without success.
Please help to fix it.

Thanks

Jonski13

  • Beginner
  • *
  • Posts: 12
    • Web Design Cambridge
Re: "Call for price"-link disappeared after update to 2.0.12
« Reply #2 on: October 10, 2012, 18:03:35 pm »
Anyone have any luck finding a solution to this?

Ran the update today and the call for price vanishes - which is essential for pretty much all the products at the mo.

Guessing the only way to address this in the short term is to roll back to version 2.0.10?

Thanks

John

webzie

  • Beginner
  • *
  • Posts: 9
Re: "Call for price"-link disappeared after update to 2.0.12
« Reply #3 on: October 10, 2012, 18:19:05 pm »
As I stated earlier, it seems that VM in 2.0.12 fills the tables with zero's when the price is empty, so essentially the table is not empty, but there are zero's, before the update the tables were empty. That's my guess, look for yourself in the code.

The call for price link only shows when the prices are empty. I'm not 100% sure about this though. This could be a bug.

elcoserv

  • Beginner
  • *
  • Posts: 3
Re: "Call for price"-link disappeared after update to 2.0.12
« Reply #4 on: October 10, 2012, 20:08:00 pm »
As I stated earlier, it seems that VM in 2.0.12 fills the tables with zero's when the price is empty, so essentially the table is not empty, but there are zero's, before the update the tables were empty. That's my guess, look for yourself in the code.

The call for price link only shows when the prices are empty. I'm not 100% sure about this though. This could be a bug.

I dont think so because I have edited these fields from SQL database phpmyadmin and just erased all zeros and left fields empty. But still have a same problem

ceekee

  • Beginner
  • *
  • Posts: 6
Re: "Call for price"-link disappeared after update to 2.0.12
« Reply #5 on: October 10, 2012, 23:38:03 pm »
I have the same problem with this version. The field $this->product->prices is never empty !!! With or without a price it is filled with what I don't know

I have changed the code to:

       if ($this->product->prices <> 0) {      
           echo $this->product->prices, 'TEST';
     ?>


When i echo this field I a getting the following output: "ArrayTEST "

I am getting this output, with and without a price.

Please advice.

webzie

  • Beginner
  • *
  • Posts: 9
Re: "Call for price"-link disappeared after update to 2.0.12
« Reply #6 on: October 11, 2012, 08:33:01 am »
Thnak you for reply, can you output the contents of the prices-array? Maybe product ID is in the array?

webzie

  • Beginner
  • *
  • Posts: 9
Re: "Call for price"-link disappeared after update to 2.0.12
« Reply #7 on: October 11, 2012, 09:24:07 am »
if you change  if(empty($product->prices) into  if(empty($product->prices[basePrice]) you will get the link back in category view. Later i will check how to het the link back in productview.

ceekee

  • Beginner
  • *
  • Posts: 6
Re: "Call for price"-link disappeared after update to 2.0.12
« Reply #8 on: October 11, 2012, 09:33:52 am »
Here is the array of $this->product:
Code: [Select]
[prices] => Array (
[costPrice] => 0
[basePrice] => 0
[basePriceVariant] =>
[basePriceWithTax] =>
[discountedPriceWithoutTax] =>
[priceBeforeTax] =>

ceekee

  • Beginner
  • *
  • Posts: 6
Re: "Call for price"-link disappeared after update to 2.0.12
« Reply #9 on: October 11, 2012, 09:39:38 am »
if you change  if(empty($product->prices) into  if(empty($product->prices[basePrice]) you will get the link back in category view. Later i will check how to het the link back in productview.

You also have to change the add to cart piece in the default.php

Code: [Select]
// 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
?>


ceekee

  • Beginner
  • *
  • Posts: 6
Re: "Call for price"-link disappeared after update to 2.0.12
« Reply #10 on: October 11, 2012, 11:16:14 am »
This behaviour is also present in version 2.10 :'(

webzie

  • Beginner
  • *
  • Posts: 9
Re: "Call for price"-link disappeared after update to 2.0.12
« Reply #11 on: October 11, 2012, 15:05:42 pm »
For now my final solution to get the link back in productview en category view, only when the baseprice for a product is zero, is a hack in the code in the next two files:
- /components/com_virtuemart/views/productdetails/tmpl/default_showprices.php
replace
Code: [Select]
if (empty($this->product->prices) and VmConfig::get ('askprice', 1) and !$this->product->images[0]->file_is_downloadable) with
Code: [Select]
if (empty($this->product->prices[basePrice]) and VmConfig::get ('askprice', 1)  and !$this->product->images[0]->file_is_downloadable)
And in:
- /components/com_virtuemart/views/category/tmpl/default.php

replace
Code: [Select]
if(empty($product->prices) and VmConfig::get('askprice',1) and empty($product->images[0]->file_is_downloadable) )with
Code: [Select]
if(empty($product->prices[basePrice]) and VmConfig::get('askprice',1) and empty($product->images[0]->file_is_downloadable) )
The "call for price"-link will only show when you did not enter a price. If you use a template put it in the template-html of course.

ceekee

  • Beginner
  • *
  • Posts: 6
Re: "Call for price"-link disappeared after update to 2.0.12
« Reply #12 on: October 15, 2012, 09:52:47 am »
For now my final solution to get the link back in productview en category view, only when the baseprice for a product is zero, is a hack in the code in the next two files:
- /components/com_virtuemart/views/productdetails/tmpl/default_showprices.php
replace
Code: [Select]
if (empty($this->product->prices) and VmConfig::get ('askprice', 1) and !$this->product->images[0]->file_is_downloadable) with
Code: [Select]
if (empty($this->product->prices[basePrice]) and VmConfig::get ('askprice', 1)  and !$this->product->images[0]->file_is_downloadable)
And in:
- /components/com_virtuemart/views/category/tmpl/default.php

replace
Code: [Select]
if(empty($product->prices) and VmConfig::get('askprice',1) and empty($product->images[0]->file_is_downloadable) )with
Code: [Select]
if(empty($product->prices[basePrice]) and VmConfig::get('askprice',1) and empty($product->images[0]->file_is_downloadable) )
The "call for price"-link will only show when you did not enter a price. If you use a template put it in the template-html of course.

Thank you Webzie, your fix took care of the problem. Much appreciated.