$okmessage = (string)$okmessage->content;
}
- $this->_datas->addReplace('#' . $formID, '<div id="confirmationQuote">' . $okmessage . '</div>');
+ // If we're processing the popup form, the success message will replace the whole section including the text
+ // Otherwise, just the form itself is replaced.
+ if ($formID == 'requestQuotePopup') {
+ // Todo: work out why CSS isn't taking effect (see #confirmationQuote in 315-quote.less) - using inline CSS for now.
+ // Todo: see issue https://team.cubedesigners.com/redmine/issues/737 for possible cause
+ $this->_datas->addReplace('#' . $formID .'Wrapper', '<div id="confirmationQuote" style="background-color:#fff">' . $okmessage . '</div>');
+ } else {
+ $this->_datas->addReplace('#' . $formID, '<div id="confirmationQuote">' . $okmessage . '</div>');
+ }
+
+
$this->_datas->addGAEvent('form', 'sent', 'quote');
} else {
$this->_datas->refreshForm($form); // Respond with validation errors
if ($formID) {
$form->setId($formID);
$form->setAction($form->getAction() . '/' . $formID);
- }
+ } else {
+ $formID = $form->getId();
+ }
- $res = '<div class="request-quote content-wrapper grid">';
+ $res = '<div class="request-quote content-wrapper grid" id="'. $formID .'Wrapper">';
$res .= '<div class="text col-2">';
$res .= $this->title($this->option('quote_heading'));
$res .= $this->markupDotclear($this->option('quote_description'));