News:

Looking for documentation? Take a look on our wiki

Main Menu

Need help with reconfigured ask question email

Started by guybr, June 09, 2015, 19:41:15 PM

Previous topic - Next topic

guybr

I'm using VM 2.6.6. I wanted to replicate and alter the text of the "ask a question" email and use it to let users contact me to "make an offer" on certain products.

I've been able to get the special contact-us option to display conditionally - but I can't get the URLs to render correctly:

I used the original "ask a question" URL (from productdetails/view.html.php):

   $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);

   $this->assignRef('askquestion_url', $askquestion_url);


and assigned a variation of it to the customized contact option I want to display just below in that file:

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

   $this->assignRef('makeoffer_url', $makeoffer_url);

But when the product details page displays, the URL for the "make offer" button does not include the &task= part nor the &tmpl= part, and so it pulls up the site homepage.

I also tried using the URL format of the "recommend" email, and there I can get the 2 missing portions to display... but then the itemid and language elements go missing and the URL still doesn't work.

This is how I'm getting the button displayed (identical style code to the "ask question" except that the URL isn't correct...):

<?php
// Make an Offer contact us option, if set for this item. The customfield should be admin only and hidden.
if (!empty($this->product->customfieldsSorted['offer'])) {
    ?>
          <div class="make-an-offer">
            <a class="make-an-offer" href="<?php echo $this->makeoffer_url ?>" rel="nofollow" ><?php echo JText::_('COM_VIRTUEMART_PRODUCT_MAKE_OFFER_LBL') ?></a>
              <!--<a class="ask-a-question modal" rel="{handler: 'iframe', size: {x: 700, y: 550}}" href="<?php echo $this->makeoffer_url ?>"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_MAKE_OFFER_LBL') ?></a>-->
          </div>
      <?php }
      ?>



any ideas what I'm doing wrong? What does the "FALSE" in the URL do?

(I have, of course, duplicated the "askquestion" view, renamed it to "makeoffer" and made all the string-label and css adjustments [ref: vmsite-ltr.css] to reflect that this is a separate email)