Skip to main content

"Contact Us for More Information" button problem

More
12 years 9 months ago #137794 by kchahine
-- url of the page with the problem -- : www.salsashoes.com.au/hikashop-menu-for-...uct/274-160805-.html
-- HikaShop version -- : Essential 2.2.3
-- Joomla version -- : 2.5.17

Hi,
For one reason or the other, the "Contact Us for More Information" button is not functioning as expected. To start with, once the user click on the button, he/she is prompted to another page to enter details of the message. Once the user click on OK, he/she is prompted to another blank page (no confirmation message or any other sign). Any idea what could be the problem?
Also, the page where the user enters details needs to be changed, where can I do so?
Any better idea about improving the look of the whole process?

Many thanks in advance.

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #137815 by Jerome
Hi,

Please edit the file "components/com_hikashop/views/product/tmpl/contact.php" and replace:
Code:
<input type="hidden" name="tmpl" value="<?php echo JRequest::getVar('tmpl'); ?>" />
By:
Code:
<?php if(JRequest::getVar('tmpl', '') == 'component') { ?> <input type="hidden" name="tmpl" value="component" /> <?php } ?>
It will fix the problem.

Sorry for the inconvenient.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: kchahine

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #137840 by kchahine

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #145393 by aleks59
Hello,

If the customer submits the “Contact us for more information”-form with incorrect data or empty required fields, he gets the EMPTY form back. All the submitted data gets lost.
Since I have many input fields in my contact form its very inconvenient for the customer to fill the hole form ones again.
Are there any possibilities to display the submitted data after failed submission?
Joomla 2.5.11, Hikashop Business 2.2.2

Thanks in advance.

Aleks

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #145691 by Xavier
Hi,

We just corrected it on our end.
As temporary fix, you can replace the view "product / contact" by:
Code:
<div id="hikashop_product_contact_<?php echo JRequest::getInt('cid');?>_page" class="hikashop_product_contact_page"> <fieldset> <div class="" style="float:left"> <h1><?php if(!empty($this->product->images)) { $image = reset($this->product->images); $img = $this->imageHelper->getThumbnail($image->file_path, array(50,50), array('default' => true), true); if($img->success) { echo '<img src="'.$img->url.'" alt="" style="vertical-align:middle"/> '; } } echo $this->product->product_name; ?></h1> </div> <div class="toolbar" id="toolbar" style="float: right;"> <button class="btn" type="button" onclick="checkFields('hikashop_contact_form');"><img src="<?php echo HIKASHOP_IMAGES; ?>ok.png" alt=""/><?php echo JText::_('OK'); ?></button> <?php if(JRequest::getCmd('tmpl', '') != 'component') { ?> <button class="btn" type="button" onclick="history.back();"><img src="<?php echo HIKASHOP_IMAGES; ?>cancel.png" alt=""/><?php echo JText::_('HIKA_CANCEL'); ?></button> <?php } ?> </div> <div style="clear:both"></div> </fieldset> <?php $formData = JRequest::getVar('formData',''); if(isset($this->element->name) && !isset($formData->name)){ $formData->name = $this->element->name; } if(isset($this->element->email) && !isset($formData->email)){ $formData->email = $this->element->email; } ?> <form action="<?php echo hikashop_completeLink('product'); ?>" id="hikashop_contact_form" name="hikashop_contact_form" method="post"> <dl> <dt><label for="data[contact][name]"><?php echo JText::_( 'HIKA_USER_NAME' ); ?></label></dt> <dd> <input type="text" name="data[contact][name]" size="40" value="<?php echo $this->escape(@$formData->name);?>" /> </dd> <dt><label for="data[contact][email]"><?php echo JText::_( 'HIKA_EMAIL' ); ?></label></dt> <dd> <input type="text" name="data[contact][email]" size="40" value="<?php echo $this->escape(@$formData->email);?>" /> </dd> <dt><label for="data[contact][altbody]"><?php echo JText::_( 'ADDITIONAL_INFORMATION' ); ?></label></dt> <dd> <textarea cols="60" rows="10" name="data[contact][altbody]" style="width:100%;"> <?php if(isset($formData->altbody)) echo $formData->altbody; ?> </textarea> </dd> </dl> <input type="hidden" name="data[contact][product_id]" value="<?php echo JRequest::getInt('cid');?>" /> <input type="hidden" name="cid" value="<?php echo JRequest::getInt('cid');?>" /> <input type="hidden" name="option" value="<?php echo HIKASHOP_COMPONENT; ?>" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="ctrl" value="product" /> <input type="hidden" name="redirect_url" value="<?php $redirect_url = JRequest::getString('redirect_url', ''); echo $this->escape($redirect_url); ?>" /> <?php if(JRequest::getVar('tmpl', '') == 'component') { ?> <input type="hidden" name="tmpl" value="component" /> <?php } ?> <?php echo JHTML::_( 'form.token' ); ?> </form> </div> <script type="text/javascript"> function checkFields(form){ var varform = document[form]; var nameField = varform.elements['data[contact][name]']; var emailField = varform.elements['data[contact][email]']; var altbodyField = varform.elements['data[contact][altbody]']; if(nameField.value == ''){ alert('".JText::_('SPECIFY_A_NAME')."'); return false; } if(emailField.value == ''){ alert('".JText::_('EMAIL_INVALID')."'); return false; }else{ emailField.value = emailField.value.replace(/ /g,\"\"); var filter = /^([a-z0-9_'&\.\-\+])+\@(([a-z0-9\-])+\.)+([a-z0-9]{2,10})+$/i; if(!emailField || !filter.test(emailField.value)){ alert('".JText::_('EMAIL_INVALID')."'); return false; } } if(altbodyField.value == ''){ alert('".JText::_('PLEASE_FILL_ADDITIONAL_INFO')."'); return false; } window.hikashop.submitform('send_email', 'hikashop_contact_form'); } </script>
The following user(s) said Thank You: aleks59

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #145772 by aleks59
Thanks for the fix!

Although the $formData remains empty the javaScript does the job. for the time being it will be sufficient.

Regards,

Aleks

Please Log in or Create an account to join the conversation.

Time to create page: 0.243 seconds
Powered by Kunena Forum