Помогите имитировать нажатие кнопки на странице гостевого оформления заказа

Автор Димарик 777, 11 ноября 2015, 15:41:11

« назад - далее »

Димарик 777

Есть кнопка на странице при нажатие на которую вылазиет форма быстрого заказа, нужно как то съимитировать ее нажатие, чтобы страница открывалась сразу с открытой формой (без нажатия по кнопке)
Вот код всего файла: (сама кнопка выделена смайлом)
Версия prestashop 1.6.1.1

<div id="opc_new_account" class="opc-main-block">
<div id="opc_new_account-overlay" class="opc-overlay" style="display: none;"></div>
<h1 class="page-heading step-num" hidden><span></span> {l s='Account'}</h1>

<form action="{$link->getPageLink('authentication', true)|escape:'html':'UTF-8'}" method="post" id="new_account_form" class="std" autocomplete="on" autofill="on">
<fieldset>
<div class="box">
<h3 id="new_account_title" class="page-subheading">{l s='Введите данные для оформления заказа:'}</h3>
<div id="opc_account_choice" class="row">
<div class="col-xs-12 col-md-6">
<p class="title_block" style="display:none;">{l s='Instant Checkout'}</p>
<p class="opc-button">
<button type="submit" class="btn btn-default button button-medium exclusive" id="opc_guestCheckout"><span>{l s='Guest checkout'}</span></button>
</p>


</div>
<!--<div class="col-xs-12 col-md-6">
<p class="title_block">{l s='Create your account today and enjoy:'}</p>
<ul class="bullet">
<li>- {l s='Personalized and secure access'}</li>
<li>- {l s='A fast and easy check out process'}</li>
<li>- {l s='Separate billing and shipping addresses'}</li>
</ul>
<p class="opc-button">
<button type="submit" class="btn btn-default button button-medium exclusive" id="opc_createAccount"><span><i class="icon-user left"></i>{l s='Create an account'}</span></button>
</p>
</div>-->
</div>
<div id="opc_account_form" class="unvisible" style="display:none;">
{$HOOK_CREATE_ACCOUNT_TOP}
<!-- Error return block -->
<div id="opc_account_errors" class="alert alert-danger" style="display:none;"></div>
<!-- END Error return block -->
<!-- Account -->
<input type="hidden" id="is_new_customer" name="is_new_customer" value="0" />
<input type="hidden" id="opc_id_customer" name="opc_id_customer" value="{if isset($guestInformations) && isset($guestInformations.id_custome r) && $guestInformations.id_customer}{$gu estInformations.id_customer}{else}0 {/if}" />
<input type="hidden" id="opc_id_address_delivery" name="opc_id_address_delivery" value="{if isset($guestInformations) && isset($guestInformations.id_address _delivery) && $guestInformations.id_address_deliv ery}{$guestInformations.id_address_ delivery}{else}0{/if}" />
<input type="hidden" id="opc_id_address_invoice" name="opc_id_address_invoice" value="{if isset($guestInformations) && isset($guestInformations.id_address _delivery) && $guestInformations.id_address_deliv ery}{$guestInformations.id_address_ delivery}{else}0{/if}" />
<p class="required" hidden><sup></sup>{l s='Required field'}</p>
<div class="required text form-group">
<label for="email">{l s='Введите ваш E-mail:'} <sup>*</sup></label>
<input type="email" class="text form-control validate" id="email" name="email" data-validate="isEmail" value="{if isset($guestInformations) && isset($guestInformations.email) && $guestInformations.email}{$guestInf ormations.email}{/if}" />
</div>
<!--<div class="required password is_customer_param form-group">
<label for="passwd">{l s='Придумайте пароль: (5-10 символов)'} <sup>*</sup></label>
<input type="password" class="text form-control validate" name="passwd" id="passwd" data-validate="isPasswd" />
</div>-->

DarinSr

В js коде измените событие click на выполнение при загрузки страницы
$(document).ready(function()

Димарик 777

Я так понимаю сдесь надо менять? Не помогает чтото, уже все перепробовал. Посмотрите пожалуйста, а то уже 3 дня мучаюсь, весь инет перекопал:(
if ((typeof isLogged == 'undefined' || !isLogged) || (typeof isGuest !== 'undefined' && isGuest))
{
if (guestCheckoutEnabled && !isLogged && !isGuest)
{
$('#opc_account_choice').show();
$('#opc_account_form, #opc_invoice_address').hide();

$(document).on('click', '#opc_createAccount',function(e){
e.preventDefault();
$('.is_customer_param').show();
$('#opc_account_form').slideDown('slow');
$('#is_new_customer').val('1');
$('#opc_account_choice, #opc_invoice_address').hide();
if (typeof bindUniform !=='undefined')
bindUniform();
});
$(document).on('click', '#opc_guestCheckout', function(e){
e.preventDefault();
$('.is_customer_param').hide();
$('#opc_account_form').slideDown('slow');
$('#is_new_customer').val('0');
$('#opc_account_choice, #opc_invoice_address').hide();
$('#new_account_title').html(txtInstantCheckout);
$('#submitAccount').attr({id : 'submitGuestAccount', name : 'submitGuestAccount'});
if (typeof bindUniform !=='undefined')
bindUniform();
});
}

coder

ЦитироватьЕсть кнопка на странице при нажатие на которую вылазиет форма быстрого заказа,
Это не стандартный заказ, это модуль быстрого заказа. Вот его нужно поменять

1. У этой кнопки какой класс или ид? Находите ид/класс.
2. В модуле быстрого заказа открываете файл js, ищите по ид/классу кнопки событие click, меняете функцию, как написал DarinSr.

Димарик 777

Цитата: coder от 11 ноября 2015, 17:12:45
ЦитироватьЕсть кнопка на странице при нажатие на которую вылазиет форма быстрого заказа,
Это не стандартный заказ, это модуль быстрого заказа. Вот его нужно поменять

1. У этой кнопки какой класс или ид? Находите ид/класс.
2. В модуле быстрого заказа открываете файл js, ищите по ид/классу кнопки событие click, меняете функцию, как написал DarinSr.
Это стандартный заказ. Форма быстрого заказа, стандартная не модуль (гостевая покупка) извиняюсь не так написал выше!

Димарик 777

Может поможет кто через TeamViever?
Готов даже заплатить ну так на пивасик или приколюшки
Почта: alex-lavruha@yandex.ru

coder

При стандартной схеме заказа ничего не всплывает. Там кнопки добавить/сменить адрес и выбор оплаты, по клике переход не другую страницу.