Jump to content

Instant guest checkout


Recommended Posts

You must edit the template file named order-opc-new-account.

 

Remove this (about this, it changes depending on the template)

	<form action="{$link->getPageLink('authentication', true, NULL, "back=order-opc")|escape:'html'}" method="post" id="login_form" class="std">
		<fieldset>
			<h3>{l s='Already registered?'}</h3>
			<p><a href="#" id="openLoginFormBlock">» {l s='Click here'}</a></p>
			<div id="login_form_content" style="display:none;">
				<!-- Error return block -->
				<div id="opc_login_errors" class="error" style="display:none;"></div>
				<!-- END Error return block -->
				<div style="margin-left:40px;margin-bottom:5px;float:left;width:40%;">
					<label for="login_email">{l s='Email address'}</label>
					<span><input type="text" id="login_email" name="email" /></span>
				</div>
				<div style="margin-left:40px;margin-bottom:5px;float:left;width:40%;">
					<label for="login_passwd">{l s='Password'}</label>
					<span><input type="password" id="login_passwd" name="login_passwd" /></span>
					<a href="{$link->getPageLink('password', true)|escape:'html'}" class="lost_password">{l s='Forgot your password?'}</a>
				</div>
				<p class="submit">
					{if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'htmlall':'UTF-8'}" />{/if}
					<input type="submit" id="SubmitLogin" name="SubmitLogin" class="button" value="{l s='Login'}" />
				</p>
			</div>
		</fieldset>
	</form>

Then, in the #new_account_form div, find and remove

<div id="opc_account_choice">
				<div class="opc_float">
					<p class="title_block">{l s='Instant Checkout'}</p>
					<p>
						<input type="button" class="exclusive_large" id="opc_guestCheckout" value="{l s='Guest checkout'}" />
					</p>
				</div>

				<div class="opc_float">
					<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>
						<input type="button" class="button_large" id="opc_createAccount" value="{l s='Create an account'}" />
					</p>
				</div>
				<div class="clear"></div>
			</div>

Finally, on order-opc.js, change

Then edit order-opc.js, and scroll to

			$('#opc_guestCheckout').click(function() {
				$('.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').prop({id : 'submitGuestAccount', name : 'submitGuestAccount'});
				updateState();
				updateNeedIDNumber();
				updateZipCode();
			});

To

$('.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').prop({id : 'submitGuestAccount', name : 'submitGuestAccount'});
				updateState();
				updateNeedIDNumber();
				updateZipCode();

)basically remove the click action)

 

DIdn't test it, but it should work!

Link to comment
Share on other sites

Hello

 

If you go to my site: www.dinsticker.dk

 

It do not show anything now when you go to the cart.

 

please turn on erros that will help determine issue with your change...

http://www.prestashop.com/forums/topic/224525-how-to-turn-on-error-reporting-for-debug-information/

 

 

remember to always back up changes you make to 'any' file first.

Link to comment
Share on other sites

I suggest that you do not make these changes until you are more comfortable working with PrestaShop in general and coding in particular.

 

You can always of course continue trying to make this work for you or hire someone to do it for you (see paid section), or look for a module.

 

But in my honest opinion you are not experienced enough yet to make  these type of changes.

 

best of luck and happy selling

Link to comment
Share on other sites

You should be able to see the error as soon as your reach the problematic page :) (the order page in this case)

Hello Nemo

 

I got a little problem. When i press "save" in the OPC nothing happens. It says it you needs to "log gin" but when you click save to thei nformations you write nothing happens. You can try to add a product on www.dinsticker.dk and go to the cart.

Link to comment
Share on other sites

Easyest way to achieve this is to edit the authentication.tpl file. 

 

Here is what i did 

{if isset($inOrderProcess) == false}
    <div class="row">
    <div class="authentication_span authentication_left">
	<form action="{$link->getPageLink('authentication', true)|escape:'html'}" method="post" id="login_form" class="std">
		<fieldset class="block">
			<h3 class="title_block">{l s='Sign in'}</h3>
			<div class="form_content clearfix">
                <ul class="wrapper_block">
                    <li>
                       <!-- <label for="email" class="required"><em>*</em>{l s='Email address'}</label> -->
                        <div class="input-box">
                            <input type="text" id="email" name="email" value="{if isset($smarty.post.email)}{$smarty.post.email|stripslashes}{/if}" placeholder="Email" class="account_input input-text" />
                        </div>
                    </li>
                    <li>
                        <!-- <label for="passwd" class="required"><em>*</em>{l s='Password'}</label> -->
                        <div class="input-box">
                            <input type="password" id="passwd" name="passwd" value="{if isset($smarty.post.passwd)}{$smarty.post.passwd|stripslashes}{/if}" placeholder="Password" class="account_input input-text" />
                        </div>
                    </li>
                </ul>
                <!-- <p class="required_note"><sup>*</sup> {l s='Required Fields'}</p> -->
				<p class="lost_password"><a href="{$link->getPageLink('password')|escape:'html'}" title="{l s='Recover your forgotten password'}" rel="nofollow">{l s='Forgot your password?'}</a></p>
			</div>
			<div class="submit clearfix">
				{if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'htmlall':'UTF-8'}" />{/if}
				<input type="submit" id="SubmitLogin" name="SubmitLogin" class="button btn_primary btn-block" value="{l s='Sign in'}" />
			</div>
		</fieldset>
	</form>
    </div>
    <div class="authentication_span authentication_right">
	<form action="{$link->getPageLink('authentication', true)|escape:'html'}" method="post" id="create-account_form" class="std">
		<fieldset class="block">
			<h3 class="title_block">{l s='Create an account'}</h3>
			<div class="form_content clearfix">
				<!-- <p class="mar_b1">{l s='Please enter your email address to create an account.'}</p> -->
				<div class="error mar_b1" id="create_account_error" style="display:none"></div>
                <ul class="wrapper_block">
                    <li>
                        <!-- <label for="email_create" class="required"><em>*</em>{l s='Email address'}</label> -->
                        <div class="input-box">
                            <input type="text" id="email_create" name="email_create" value="{if isset($smarty.post.email_create)}{$smarty.post.email_create|stripslashes}{/if}" placeholder="Email" class="account_input input-text" />
                        </div>
                    </li>
                </ul>
			</div>
			<div class="submit clearfix">
				{if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'htmlall':'UTF-8'}" />{/if}
				<input type="submit" id="SubmitCreate" name="SubmitCreate" class="button_large btn_primary btn-block" value="{l s='Sign up'}" />
				<input type="hidden" class="hidden" name="SubmitCreate" value="{l s='Create an account'}" />
			</div>
		</fieldset>
	</form>
    </div>
    </div>
	{/if}

As you can see i added a if condition. Be aware that this will work only with quests option enabled. 
if condition determines when to show the login/ already registered part. If user is in orderProcess it wont show but when he tries to log in on a log in site then it will. 

Be noted, my code has probably been altered a lot,  but I just wanted to show you how i used the if condition to get to solve the problem :)

BR's

Edited by senso321 (see edit history)
Link to comment
Share on other sites

Try that first, yes. There are no errors so chances are you deleted something which was needed by mistake

Hello @Nemo1 i revertet everything  and now it works fine. But the "instant guest chechkout" do not work so you have to press guest checkout.

 

In your soloution on page 1 you said I nedded to first edit in the "order-opc-new-account" where I removed something and also removed another thing. I am correct the "#new_account_form" is in the  "order-opc-new-account"?

 

If so I did like you said. Could I maybe send this file and the .js file and you could try to make the changes?

Link to comment
Share on other sites

I fear I don't have enough time to do it myself at the moment :(

 

If you took that out, there is a chance you need a reference to that #new_account_form in the js, but I can't tell it for sure right now. Can you maybe look for that?

Link to comment
Share on other sites

×
×
  • Create New...