Hi,
Someone asked for this kind of functionality in another post.
They did not want to have a mailto link on the product page for asking questions.
This mod is based on the joomla contact form, with the same kind of security measures (I hope!). Although I have no way of testing this.
The images below, although muddled, should show what I mean. One file needs modifying in the html directory and your flypage needs amending with another placeholder. This means that you can limit questions to certain categories using your product flypages. Three extra files are added.
in html/shop.product_details.php after
/** AVAILABILITY **/
// This is the place where it shows:
// Availability: 24h, In Stock: 5 etc.
// You can make changes to this functionality in the file: classes/ps_product.php
if( @$_REQUEST['output'] != "pdf" )
$product_availability = $ps_product->get_availability($product_id);
add
//
// Ask seller question
$ask_seller = "";
$ask_seller = "<a class=\"button\" href=\"$mosConfig_live_site/index.php?option=com_virtuemart&page=shop.ask&flypage=".@$_REQUEST['flypage']."&product_id=$product_id&category_id=$category_id&set=1&Itemid=$Itemid\">";
$ask_seller .= "Enquiry Form</a>";
and near the end of the file after
$template = str_replace( "{product_packaging}", $product_packaging, $template ); // Changed Packaging
add
$template = str_replace( "{ask_seller}", $ask_seller, $template ); // Changed Packaging
in your flypage add a placeholder where you would like the enquiry form button added i.e. {ask_seller}
(I have included a flypage called flypage_ask.php this should explain what I mean).
unzip the attached files into administrator/components/com_virtuemart
these are new files and will not overwrite anything.
in virtuemart, click on admin and then modules, list modules. Locate the module named SHOP to the right of this under functions click on LIST. Here you will find a list of functions related to the shop. Click on NEW to add a new function.
Enter these Details:
Function Name: productAsk
Class Name: ps_ask
Class Method: mail_question
Function Perms: admin,storeadmin,shopper,demo
Function Description: Enquiry form modification
This sets up the function to work within virtuemart.
in html/templates/order_emails there is a new file called enquiry_email.php
This is the html template for the enquiry form sent to the shop admin.
The customer recieves a text email for confirmation.
If the shop is set to use text emails then thats what you'll get.
I hope this explains everything.
Mark
[attachment deleted by admin]
[attachment cleanup by admin]