devlad

Рейтинг
83
Регистрация
13.05.2015

SeVlad, там саппорт дохлый, никто не отвечает вообще неделями.

Прошу прощения, сам магазин на опенкарте.

Можете еще попробовать плагин Contact Form 7

Gerga, Наконец-то!!!!

Спасибо Вам огромное!

все ходил вокруг да около) ну как можно было проглядеть))

Gerga, пробовал так раньше, но и это не помогло.

Еще пробовал вот здесь

if ($commentSize<$min ||  $commentSize>$max || !$validMail ) {

убрать первое условие, но как будто игнорирует просто(

опять выскакивает предуреждение😡

Gerga, Попробовал, но нет(

Это же проверяет мин количество символов в поле "имя", а я так понял проверяет поле "сообщение", но дело в том что его нет в форме. А проверку имени проходит.

Спасибо, вот код) Или нужен еще один файл view.html.php??

defined ( '_JEXEC' ) or die ( 'Restricted access' );

$min = VmConfig::get('asks_minimum_comment_length', 0);
$max = VmConfig::get('asks_maximum_comment_length', 2000) ;
vmJsApi::JvalideForm();
vmJsApi::addJScript('askform','
jQuery(function($){
$("#askform").validationEngine("attach");
$("#comment").keyup( function () {
var result = $(this).val();
$("#counter").val( result.length );
});
});
');
/* Let's see if we found the product */
if (empty ( $this->product )) {
echo vmText::_ ( 'COM_VIRTUEMART_PRODUCT_NOT_FOUND' );
echo '<br /><br /> ' . $this->continue_link_html;
} else {
$session = JFactory::getSession();
$askQuestionData = $session->get('askquestion', 0, 'vm');
if(!empty($this->login)){
echo $this->login;
}
if(empty($this->login) or VmConfig::get('recommend_unauth',false)){
?>
<div class="ask-a-question-view">
<h1><?php echo vmText::_('COM_VIRTUEMART_PRODUCT_ASK_QUESTION') ?></h1>

<div class="product-summary">
<div class="width70 floatleft">
<h2><?php echo $this->product->product_name ?></h2>

<?php // Product Short Description
if (!empty($this->product->product_s_desc)) { ?>
<div class="short-description">
<?php echo $this->product->product_s_desc ?>
</div>
<?php } // Product Short Description END ?>

</div>

<div class="width10 floatright center">
<?php // Product Image
echo $this->product->images[0]->displayMediaThumb('class="product-image"',false); ?>
</div>

<div class="clear"></div>
</div>

<div class="form-field">

<form method="post" class="form-validate" action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$this->product->virtuemart_product_id.'&virtuemart_category_id='.$this->product->virtuemart_category_id.'&tmpl=component', FALSE) ; ?>" name="askform" id="askform">

<table class="askform">
<tr>
<td><label for="name"><?php echo vmText::_('COM_VIRTUEMART_USER_FORM_NAME') ?> : </label></td>
<td><input type="text" class="validate[required,minSize[3],maxSize[64]]" value="<?php echo $this->user->name ? $this->user->name : $askQuestionData['name'] ?>" name="name" id="name" size="30" validation="required name"/></td>
</tr>
<tr>
<td><label for="email"><?php echo vmText::_('COM_VIRTUEMART_USER_FORM_EMAIL') ?> : </label></td>
<td><input type="text" class="validate[required,custom]" value="<?php echo $this->user->email ? $this->user->email : $askQuestionData['email'] ?>" name="email" id="email" size="30" validation="required email"/></td>
</tr>
<tr>
<td><label for="phone"><?php echo vmText::_('Ваш телефон') ?> : </label></td>
<td><input type="text" class="" value="<?php echo $this->user->phone ? $this->user->phone : $askQuestionData['phone'] ?>" name="phone" id="phone" size="30" validation="Введите номер телефона"/></td>
</tr>
<!--<tr>
<td colspan="2"><label for="comment"><?php echo vmText::sprintf('COM_VIRTUEMART_ASK_COMMENT'); ?></label></td>
</tr>-->
<tr>
<td colspan="2"><textarea title="<?php echo vmText::sprintf('COM_VIRTUEMART_ASK_COMMENT') ?>" class="field" id="comment" name="comment" rows="8"><?php echo $askQuestionData['comment'] ?></textarea></td>
</tr>


</table>

<div class="submit">
<?php // captcha addition
if(VmConfig::get ('ask_captcha')){
JHTML::_('behavior.framework');
JPluginHelper::importPlugin('captcha');
$dispatcher = JDispatcher::getInstance(); $dispatcher->trigger('onInit','dynamic_recaptcha_1');
?>
<div id="dynamic_recaptcha_1"></div>
<?php
}
// end of captcha addition
?>
<div>
<div class="floatleft width50">
<input class="highlight-button" type="submit" name="submit_ask" title="<?php echo vmText::_('COM_VIRTUEMART_ASK_SUBMIT') ?>" value="<?php echo vmText::_('COM_VIRTUEMART_ASK_SUBMIT') ?>" />
</div>
<!--<div class="floatleft width50 text-right">
<label for="counter"><?php echo vmText::_('COM_VIRTUEMART_ASK_COUNT') ?></label>
<input type="text" value="0" size="4" class="counter" id="counter" name="counter" maxlength="4" readonly="readonly" />
</div>-->
<div class="clear"></div>
</div>
</div>

<input type="hidden" name="virtuemart_product_id" value="<?php echo vRequest::getInt('virtuemart_product_id',0); ?>" />
<input type="hidden" name="tmpl" value="component" />
<input type="hidden" name="view" value="productdetails" />
<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="virtuemart_category_id" value="<?php echo vRequest::getInt('virtuemart_category_id'); ?>" />
<input type="hidden" name="task" value="mailAskquestion" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>

</div>
</div>
<?php
}
} ?>


---------- Добавлено 07.11.2015 в 17:24 ----------

ArbitHome, нашел вроде бы ту функцию.

<?php

/**
*
* Controller for the front end Manufacturerviews
*
* @package VirtueMart
* @subpackage User
* @author Oscar van Eijk
* @author Max Milbers
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2004 - 2014 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* @version $Id: manufacturer.php 2420 2010-06-01 21:12:57Z oscar $
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

// Load the controller framework
jimport('joomla.application.component.controller');

/**
* VirtueMart Component Controller
*
* @package VirtueMart
*/
class VirtueMartControllerVendor extends JControllerLegacy
{

/**
* Send the ask question email.
* @author Kohl Patrick, Christopher Roussel
*/
public function mailAskquestion () {

vRequest::vmCheckToken();

if(!class_exists('shopFunctionsF')) require(VMPATH_SITE.DS.'helpers'.DS.'shopfunctionsf.php');

$model = VmModel::getModel('vendor');
$mainframe = JFactory::getApplication();
$vars = array();
$min = VmConfig::get('asks_minimum_comment_length', 0)+1;
$max = VmConfig::get('asks_maximum_comment_length', 2000)-1 ;
$commentSize = vRequest::getString ('comment');
if (function_exists('mb_strlen')) {
$commentSize = mb_strlen($commentSize);
} else {
$commentSize = strlen($commentSize);
}

$validMail = filter_var(vRequest::getVar('email'), FILTER_VALIDATE_EMAIL);

$virtuemart_vendor_id = vRequest::getInt('virtuemart_vendor_id',1);

if(!class_exists('VirtueMartModelVendor')) require(VMPATH_ADMIN.DS.'models'.DS.'vendor.php');
$userId = VirtueMartModelVendor::getUserIdByVendorId($virtuemart_vendor_id);

//$vendorUser = JFactory::getUser($userId);
if ( $commentSize<$min || $commentSize>$max || !$validMail ) {
$this->setRedirect(JRoute::_ ( 'index.php?option=com_virtuemart&view=vendor&task=contact&virtuemart_vendor_id=' . $virtuemart_vendor_id , FALSE),vmText::_('COM_VIRTUEMART_COMMENT_NOT_VALID_JS'));
return ;
}


$user = JFactory::getUser();

$fromMail = vRequest::getVar('email'); //is sanitized then
$fromName = vRequest::getVar('name','');//is sanitized then
$fromMail = str_replace(array('\'','"',',','%','*','/','\\','?','^','`','{','}','|','~'),array(''),$fromMail);
$fromName = str_replace(array('\'','"',',','%','*','/','\\','?','^','`','{','}','|','~'),array(''),$fromName);
if (!empty($user->id)) {
if(empty($fromMail)){
$fromMail = $user->email;
}
if(empty($fromName)){
$fromName = $user->name;
}
}

$vars['user'] = array('name' => $fromName, 'email' => $fromMail);

$VendorEmail = $model->getVendorEmail($virtuemart_vendor_id);
$vars['vendor'] = array('vendor_store_name' => $fromName );

if (shopFunctionsF::renderMail('vendor', $VendorEmail, $vars,'vendor')) {
$string = 'COM_VIRTUEMART_MAIL_SEND_SUCCESSFULLY';
}
else {
$string = 'COM_VIRTUEMART_MAIL_NOT_SEND_SUCCESSFULLY';
}
$mainframe->enqueueMessage(vmText::_($string));

// Display it all
$view = $this->getView('vendor', 'html');

$view->setLayout('mail_confirmed');
$view->display();
}

}

// No closing tag

но пробовал снова ставить ноль возле значения мин

и еще пробовал убрать из кода проверку размера коммента. Все равно результат прежний.

Пользы для тебя особо нет) Если нужно просмотреть посещаемость, то достаточно Аналитикс и Метрики. Разве что у тебя 100500 тысяч посещений и ты хочешь этим похвастаться😂

Так можно заменить сразу пр редактировании каждой отдельной формы...по-моему вкладка "письмо"🙄

Будет индексироваться, у меня два сайта, так реализованы и Гугль кушает с аппетитом😂

Спасибо за наводку..я как -то и не обратил внимание на такое большое количество вхождений и за Н1 спасибо тоже.

А насчет метатегов вроде все ок, в выдаче я еще и не такие изощренные видал😂

1 234
Всего: 37