VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: graphicdev on November 04, 2014, 07:22:07 AM

Title: "Ask a Question about this product" Displaying Blank
Post by: graphicdev on November 04, 2014, 07:22:07 AM
Hi,
I urgently need help with the "Ask a Question about this product" or "Call for Price" pop up.
Here is a link the site: http://lnxweb01.ecotechconverge.co.za/~uoas/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=122&virtuemart_category_id=22&Itemid=0&showall=1
When you click on the "Ask a Question about this product" or "Call for Price" link the contact form pops up. Once you have filled in your information and question and press send the pop up goes blank and the message does not go to the relevant email address. Attached is a screenshot.

Site Information:
Joomla: 2.5.17      Virtuemart: 2.0.26d   PHP: 5.4.31

[attachment cleanup by admin]
Title: Re: "Ask a Question about this product" Displaying Blank
Post by: John2400 on November 04, 2014, 07:52:02 AM
These versions are too old. Many of these types of issues have been solved by simply updating. There have been nearly 27 updates since this version.


http://dev.virtuemart.net/projects/virtuemart/files

Title: Re: "Ask a Question about this product" Displaying Blank
Post by: graphicdev on November 04, 2014, 09:12:38 AM
I have done the updates as suggested. The pop still goes blank after clicking send.
Title: Re: "Ask a Question about this product" Displaying Blank
Post by: jenkinhill on November 04, 2014, 10:44:17 AM
Then next step is to check for 500 errors:  http://forum.virtuemart.net/index.php?topic=121692
Title: Re: "Ask a Question about this product" Displaying Blank
Post by: graphicdev on November 05, 2014, 07:09:19 AM
I enable the vmdebug. Tried the contact form again.
Got this error:
Fatal error: Call to undefined function mb_strlen() in /home/uoas/public_html/components/com_virtuemart/controllers/productdetails.php on line 77

Any suggestions on what could cause this?
Title: Re: "Ask a Question about this product" Displaying Blank
Post by: Milbo on November 07, 2014, 13:57:18 PM
ahh found, just use there instead of

$commentSize = mb_strlen( JRequest::getString('comment') );


this

$commentSize = JRequest::getString ('comment');
if (function_exists('mb_strlen')) {
$commentSize =  mb_strlen($commentSize);
} else {
$commentSize =  strlen($commentSize);
}
Title: Re: "Ask a Question about this product" Displaying Blank
Post by: graphicdev on November 10, 2014, 06:53:13 AM
Thank you so much.

The code I need to replace, would you confirm that I replace it in this document productdetails.php ?

Title: Re: "Ask a Question about this product" Displaying Blank
Post by: graphicdev on November 13, 2014, 06:57:02 AM
Thanks again. Added the suggest code and it fixed my problem.
;D :D ;D
Title: Re: "Ask a Question about this product" Displaying Blank
Post by: guybr on June 10, 2015, 15:44:27 PM
Hi Milbo, I'm using VM 2.6.6 and I'm trying to duplicate the "ask a question" email in order to display it as a "make an offer" email, which would be displayed conditionally (based on custom field setting in the Admin).

I've been able to get the button to display conditionally, but in this file controllers/productdetails.php, when I try to copy-paste the section for "MailAskquestion" and change all the values for "makeoffer", I get a blank screen. The message I get is:
Parse error: syntax error, unexpected 'public' (T_PUBLIC) in /home/content/15/9930015/html/online-store/components/com_virtuemart/controllers/productdetails.php on line 157

The file has a lot of spaces between the lines, so I don't know what line 157 refers to: according to the numbering in notepad++ it refers to the line $commentSize = mb_strlen( JRequest::getString('comment') );, so I changed it with the code you proposed above - but I still get the same error.

Is it possible that I'm doing something wrong with the code by copying-pasting the "ask question" segment and simply replacing the name? I already prepared the alternate email by duplicating the "askquestion" view and altering the names and string labels, and creating replicated css in vmsite-ltr...