VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Panayiotis Fafakos on August 29, 2018, 23:36:20 PM

Title: Google ReCaptcha does not display in Vendor Contact form
Post by: Panayiotis Fafakos on August 29, 2018, 23:36:20 PM
Hello to all developers of Virtuemart.

First of all, I would like to thank you for this wonderful software, Joomla & Virtuemart.
I am using Joomla v3.8.11 and Virtuemart v3.2.15.

I would like to report a missing feature or bug, as described below...

As anyone can see even in
https://demo.virtuemart.net/vendor/virtuemart-3-sample-store/contact (https://demo.virtuemart.net/vendor/virtuemart-3-sample-store/contact)
and in all demo installations i.e. download and install
https://dev.virtuemart.net/attachments/download/1120/VirtueMart3.2.14_Joomla_3.8.6-Stable-Full_Package.zip (https://dev.virtuemart.net/attachments/download/1120/VirtueMart3.2.14_Joomla_3.8.6-Stable-Full_Package.zip),
even if we enable ReCaptcha in Joomla config, and in VirtueMart configuration,
the ReCaptcha does not show, since (from what I can understand) is it not implemented in the specific contact php file.

Does anybody know what should be added as a template override to enable ReCaptcha in Vendor Contact Form in Virtuemart?

Kind regards to all,

Panos.
Title: Re: Google ReCaptcha does not display in Vendor Contact form
Post by: Panayiotis Fafakos on August 29, 2018, 23:55:41 PM
Please notice that it is not a template problem.

I have tried with the default template "vmbeez3",
with a free VM template (https://www.olympianthemes.com/virtuemart-templates/horme-free-virtuemart-template.html (https://www.olympianthemes.com/virtuemart-templates/horme-free-virtuemart-template.html))
plus with another commercial template from linelab (which I had from VM 2).

I believe this is a contact form which has been forgotten to get up-to-date somehow...

Searching in Google says how to disable the contact links, yet I would like to keep the option to contact the shop vendor.

I hope a developer steps in to help us...
Title: Re: Google ReCaptcha does not display in Vendor Contact form
Post by: Jörgen on August 30, 2018, 07:22:57 AM
Hmmmm, this is a really joomla question, nothing to do with VM.

The contact form is a Joomla view. Works for me with Protostar VM 3.2.12 and 3.2.15.

You have to turn on Recaptcha in Joomla contacts.

Jörgen @ Kreativ Fotografi
Title: Re: Google ReCaptcha does not display in Vendor Contact form
Post by: Panayiotis Fafakos on August 30, 2018, 09:56:16 AM
At, first, thank you all for your replies.

I will try to elaborated a little bit further on the subject...

I have upgraded to latest Joomla v3.8.12 and lastest Virtuemart 3.2.15
in a demo installation and enabled ReCaptcha in Joomla and Virtuemart.

As you can see in the link below the Joomla contact form is a different contact.php file and the ReCaptcha is working.
http://arvecon3.wisdomsoftware.gr/index.php/el/contact/4-uncategorised/1-contact (http://arvecon3.wisdomsoftware.gr/index.php/el/contact/4-uncategorised/1-contact)
This file is located under the templates folder, current template, html/com_contact/contact/default_form.php
Please notice that on top of the form I have added the text "this is the overridden default_form.php in directory /templates/templatename/html/com_contact/contact"

You can also see that the Product "Ask a question", "Recommend to a friend by email" are also working.
http://arvecon3.wisdomsoftware.gr/index.php/en/arvecon-shop/construction-hardware/construction-concrete-mixers/concrete-mixer-130lt-inox-1-detail-page (http://arvecon3.wisdomsoftware.gr/index.php/en/arvecon-shop/construction-hardware/construction-concrete-mixers/concrete-mixer-130lt-inox-1-detail-page)

The problem is with VM vendor communication contact.php which is located elsewhere, specificaly under templates/templatename/html/com_virtuemart/vendor.
Please see the link below:
http://arvecon3.wisdomsoftware.gr/index.php/en/terms-of-service/arvecon-e-shop/contact (http://arvecon3.wisdomsoftware.gr/index.php/en/terms-of-service/arvecon-e-shop/contact)
Please notice that on top of the form I have added another text "this is the overridden contact.php in directory /templates/templatename/html/com_virtuemart/vendor"

So, since in the code there is no reference for a captcha and this is a virtuemart file, I think I have reported this issue correctly.

Can a virtuemart programmer shed some light of knowledge on this please?

Thank you all,

Panos.
Title: Re: Google ReCaptcha does not display in Vendor Contact form
Post by: Panayiotis Fafakos on September 03, 2018, 21:23:36 PM
Please use the following URLs, since I have disabled SEO, etc, in order to simplify the debug process...

The URL links where the ReCaptcha is working are the two below samples.

For a product in virtuemart see the URL below (AskAQuestion, EmailRecommendToFriend):
http://arvecon3.wisdomsoftware.gr/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=6853&virtuemart_category_id=61&Itemid=418&lang=en (http://arvecon3.wisdomsoftware.gr/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=6853&virtuemart_category_id=61&Itemid=418&lang=en)

Moreover the URL where someone can contact the Joomla user is the one below (with ReCaptcha):
http://arvecon3.wisdomsoftware.gr/index.php?option=com_contact&view=contact&id=1:contact&catid=4&lang=en&Itemid=416 (http://arvecon3.wisdomsoftware.gr/index.php?option=com_contact&view=contact&id=1:contact&catid=4&lang=en&Itemid=416)

The problem is with VM vendor communication contact.php
which is located elsewhere, specificaly under templates/templatename/html/com_virtuemart/vendor.
Please see the URL link below:
http://arvecon3.wisdomsoftware.gr/index.php?option=com_virtuemart&view=vendor&layout=contact&virtuemart_vendor_id=1&lang=en (http://arvecon3.wisdomsoftware.gr/index.php?option=com_virtuemart&view=vendor&layout=contact&virtuemart_vendor_id=1&lang=en)

Please note that I have replaced contact.php in folder templates/templatename/html/com_virtuemart/vendor
with the default one from folder components/com_virtuemart/views/vendor/tmpl/contact.php
but the ReCaptcha is still not displayed.

Thank you all for your support.

Panos.
Title: Re: Google ReCaptcha does not display in Vendor Contact form
Post by: GJC Web Design on September 03, 2018, 22:47:02 PM
There is no captcha coded for the contact vendor view

you would need to add to  components\com_virtuemart\views\vendor\view.html.php

$this->captcha = shopFunctionsF::renderCaptcha('ask_captcha');

probably in the elseif ($layoutName=='contact') { block

and in contact.php add

<?php // captcha addition
      echo $this->captcha;
   // end of captcha addition
   ?>
Title: Re: Google ReCaptcha does not display in Vendor Contact form
Post by: Milbo on September 06, 2018, 23:48:44 PM
Thank you for buying a membership, is added. The version will be released tomorrow.