News:

Support the VirtueMart project and become a member

Main Menu

Ask for price error

Started by jorgepracticum, November 18, 2015, 11:44:59 AM

Previous topic - Next topic

jorgepracticum

Hi
I don't know if now you have solved this problem
When I enable the "ask for price" function and I disable the "Ask a question" function, I couldn't send any email asking for the price
I was checking the code and I realized that in one line of the code (I don't remember where it is), both "ask for price" and "ask a question" function check if the "ask a question" function is enable
I think that if I want to let the users ask for the price I don't want the appear the "ask a question" button in the item details
Regards

Milbo

hmm, sounds valid bug, file and line?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

jorgepracticum

The file is: components/com_virtuemart/controllers/productdetails.php
And the line is 69

AH

#3
Agreed, the sublayout for prices uses the function mailAskquestion but the  controller only considers if the config for "ask_question" is set
QuoteModified above for clarity

Quote
if ($product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) and isset($product->images[0]) and !$product->images[0]->file_is_downloadable) {
      $askquestion_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', FALSE);
      ?>
      <a class="ask-a-question bold" href="<?php echo $askquestion_url ?>" rel="nofollow" ><?php echo vmText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE') ?></a>
      <?php
   } else {



ask question url from controller


public function mailAskquestion () {

JSession::checkToken () or jexit ('Invalid Token');

$app = JFactory::getApplication ();
if(!VmConfig::get('ask_question',false)){
$app->redirect (JRoute::_ ('index.php?option=com_virtuemart&tmpl=component&view=productdetails&task=askquestion&virtuemart_product_id=' . vRequest::getInt ('virtuemart_product_id', 0)), 'Function disabled');
}
Regards
A

Joomla 4.4.5
php 8.1

jorgepracticum

I don't understand your point...
Is this an error or not?
If u are saying that is not an error I don't understand it... Why do you want to check if ask_question function is enable if you only want to ask for price?
Regards

AH

QuoteI don't understand your point...

I was agreeing with you -

"Show call for price, when the price is empty" setting - is not considered separately when using the function mailAskquestion



Regards
A

Joomla 4.4.5
php 8.1

jorgepracticum

Oh
Sorry, I'm spanish and my english is not very good  :'(

AH

No problem - you English will be better than my Spanish  ;)

My first response was not very clear - so I have modified it, just in case someone else reads it
Regards
A

Joomla 4.4.5
php 8.1

Milbo

just use in line 69 if(!VmConfig::get('ask_question',false) and !VmConfig::get ('askprice', 1)){
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

jorgepracticum