Jump to content

One Page checkout auto expand instant checkout form


Recommended Posts

Hi,

I am running the latest version of Prestashop with the one page checkout option, set via preferences in the back office and what I am trying to do is remove the option to register/login so the only option is instant checkout! I have removed all the login/register boxes, but now need the instant checkout form to be automatically selected/expanded when you arrive at the cart summary/checkout! As shown in the image provided.

Any help please!

48745_sCU2iDC2lHM1iuXbEoLh_t

Link to comment
Share on other sites

I'm trying to do the same. Still without results :D



edit: Ok, I think my solution will work =)

1. go to MAINFOLDER/themes/yourtheme/js folder
2. find a file called order-opc.js
3. find this section (from line 358 in my theme)

$(function() {
   // GUEST CHECKOUT / NEW ACCOUNT MANAGEMENT
   if ((!isLogged) || (isGuest))
   {
       if (guestCheckoutEnabled && !isLogged)
       {
           $('#opc_account_choice').show();
           $('#opc_account_form').hide();
           $('#opc_invoice_address').hide();

           $('#opc_createAccount').click(function() {
               $('.is_customer_param').show();
               $('#opc_account_form').slideDown('slow');
               $('#is_new_customer').val('1');
               $('#opc_account_choice').hide();
               $('#opc_invoice_address').hide();
               updateState();
               updateNeedIDNumber();
               updateZipCode();
           });
           $('#opc_guestCheckout').click(function() {
               $('.is_customer_param').hide();
               $('#opc_account_form').slideDown('slow');
               $('#is_new_customer').val('0');
               $('#opc_account_choice').hide();
               $('#opc_invoice_address').hide();
               $('#new_account_title').html(txtInstantCheckout);
               updateState();
               updateNeedIDNumber();
               updateZipCode();
           });
       }
       else if (isGuest)



and add one line at the end of it:

$(function() {
   // GUEST CHECKOUT / NEW ACCOUNT MANAGEMENT
   if ((!isLogged) || (isGuest))
   {
       if (guestCheckoutEnabled && !isLogged)
       {
           $('#opc_account_choice').show();
           $('#opc_account_form').hide();
           $('#opc_invoice_address').hide();

           $('#opc_createAccount').click(function() {
               $('.is_customer_param').show();
               $('#opc_account_form').slideDown('slow');
               $('#is_new_customer').val('1');
               $('#opc_account_choice').hide();
               $('#opc_invoice_address').hide();
               updateState();
               updateNeedIDNumber();
               updateZipCode();
           });
           $('#opc_guestCheckout').click(function() {
               $('.is_customer_param').hide();
               $('#opc_account_form').slideDown('slow');
               $('#is_new_customer').val('0');
               $('#opc_account_choice').hide();
               $('#opc_invoice_address').hide();
               $('#new_account_title').html(txtInstantCheckout);
               updateState();
               updateNeedIDNumber();
               updateZipCode();
           });
           $('#opc_guestCheckout').click(); // I'm calling click button automatically
       }
       else if (isGuest)




It works in my shop v. 1.4.3.

  • Like 3
Link to comment
Share on other sites

  • 7 months later...
  • 2 months later...
  • 3 months later...

How about being able to auto-save the address (i.e. take out the step where the customer has to click on the save button)?

 

Exactly the next problem I see in the instant check out form, Going to try the solution above now, hope it works for me... Thanks :)

Link to comment
Share on other sites

  • 3 months later...
  • 9 months later...
  • 11 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...