News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Duplicate and Customize askquestion form?

Started by idor, July 05, 2019, 13:59:04 PM

Previous topic - Next topic

idor

Hello,

JOOMLA 3.9.8, VM 3.4.2

I need to create a form in the product page with a button of lowest price.
When the user clicks on the button I want to open a form similar to the askquestion form, with some additional fields.
I tried to copy the folder "askquestion" folder, renamed it "lowprice" in the templates/MYTEMPLATE/layouts/default/html/com_virtuemart
I copied all the files of the original folder form.php mail_confirmed.php, mail_html_question.php, mail_raw_question.php, metadata.xml, view.html.php

Also in the default product´s page I created this:
$lowprice_url               = JRoute::_('index.php?option=com_virtuemart&view=productdetails&task=lowprice&virtuemart_product_id=' . $this->product->virtuemart_product_id .
                                           '&virtuemart_category_id=' . $this->product->virtuemart_category_id . '&tmpl=component', false);


and the button
<button type="button" class="btn btn-nobg hover-invert" data-iframe="modal" data-modaltitle="<?php echo vmText::_('Lowest Price') ?>" title="<?php echo vmText::_('Lowest Price') ?>" data-url="<?php echo $lowprice_url ?>">
                   <span><?php echo vmText::_('Have you found a lower price?') ?></span>
                </button>

It opens the modal pop up but inside appears the category page. No form appears.
The generated url is
/categoryname/productname-detail/lowprice.html?tmpl=component"

I am something missing.

Is there any extension to make a customized contact form for VM tu pass the product´s details?

Studio 42

because task "lowprice" do not exist(in the controller and in the router, Virtuemart search for category
In any case you have to hack the core to add a new task or use a customfield plugin. Or another plugin and use com_ajax to add the modal content(raw or Json)