VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: gringo211985 on January 21, 2015, 18:18:41 PM

Title: How to change the "ask a question" URL?
Post by: gringo211985 on January 21, 2015, 18:18:41 PM
Hi there,

I figured this out okay with VM2 but VM3 I can't seem to figure it out.

What I want to do is change the "ask a question" URL to my contact page "/contact" could someone help me out with this and provide an example?

Thanks in advance,
Richard
Title: Re: How to change the "ask a question" URL?
Post by: GJC Web Design on January 22, 2015, 01:32:38 AM


change

$askquestion_url = JRoute::_('index.php?option=com_virtuemart&view=productdetails&task=askquestion&virtuemart_product_id=' . $this->product->virtuemart_product_id . '&virtuemart_category_id=' . $this->product->virtuemart_category_id . '&tmpl=component', FALSE);

in the productdetails default
Title: Re: How to change the "ask a question" URL?
Post by: gringo211985 on January 23, 2015, 12:11:23 PM
Hi GJC,

I tried changing what you said, but it's not working for me. I have tried every which way I can think of, but it's still pulling up the old ask a question link.

Could you give me an example of what I need to be replacing it with please? Maybe just to change it to example.com or whatever?

Here's what I changed it to and it was still not changing,

// Ask a question about this product
      if (VmConfig::get('ask_question', 0) == 1) {
         $askquestion_url = JRoute::_('index.php?');
         ?>
         <div class="ask-a-question">
            <a class="ask-a-question" href="<?php echo $askquestion_url ?>" rel="nofollow" ><?php echo vmText::_('COM_VIRTUEMART_PRODUCT_ENQUIRY_LBL') ?></a>

Thanks,
Richard
Title: Re: How to change the "ask a question" URL?
Post by: GJC Web Design on January 23, 2015, 23:09:12 PM
if thats still triggering the ask template your in the wrong file.. check if your using over rides - confirm the actual details file your using
if u don't want a model popup you need to rename the link class as well

<a class="ask-a-questionxx"
Title: Re: How to change the "ask a question" URL?
Post by: gringo211985 on January 26, 2015, 01:58:38 AM
Hi GJC,

I am using the file path components/com_virtuemart/views/productdetails/tmpl/default.php as instructed. Not sure what I am missing here as I thought this was the file to edit, also there are no overrides.

Could the a class be stopping the link from changing? Would it help if I changed it to a btn?

Thanks,
Richard
Title: Re: How to change the "ask a question" URL?
Post by: GJC Web Design on January 26, 2015, 11:11:19 AM
sorry .. crystal ball broke .. if you change it in the default file and it doesn't change - assumption is your in the wrong file
so then u need to find the right file on YOUR install
Title: Re: How to change the "ask a question" URL?
Post by: gringo211985 on January 26, 2015, 18:53:19 PM
Hi GJC,

I've just realized that I'm editing it correctly but I asked the wrong question, hence why I couldn't figure it out. What I want to do is change the "call for price" link, not the "ask a question" sorry, my bad :( Your first reply works for the "ask a question" link for anyone else looking for the answer.

For anyone looking to change the "call for price" link it's in the components/com_virtuemart/sublayouts/prices.php file at around line 30

One last question GJC, how would I stop the "call for price" from opening in a popup?

Thanks,
Richard
Title: Re: How to change the "ask a question" URL?
Post by: GJC Web Design on January 26, 2015, 22:11:56 PM
QuoteOne last question GJC, how would I stop the "call for price" from opening in a popup?

haven't checked but probably change the class of the a -- as mentioned below in ask a ?