Jump to content
Roarke80

How to remove Shipping Address and skip Address step in Checkout?

Recommended Posts

Hi,

I have searched all related posts in this forum and tried all the code changes proposed, but can't find a successful solution.

I want to sell a virtual product WITHOUT using the virtual product option because the product takes a few days to prepare before the customer can download it.

I have set up a universal carrier for online download and that works fine.

However I want to skip the Address step in checkout since there is no need for billing or shipping address.

All the code offered on this forum result in either a 'There is no valid carrier' error, or doesn't work when the customer clicks on 'Cart' and logs in instead of checking out straightaway.

I am using 1.2.4.

Please can someone help? Thanks in advance.

Share this post


Link to post
Share on other sites

At your root directory file order.php.
At line 85, you'll see script written with switch blahblahblah.
Below it there is case 1 : displayAddress().
Block that line with // and write another line to be like this

case 1:
displayPayment();        
//displayAddress();
break;



This will make user go straight to payment choice.

At order-steps.tpl, inside your themes directory, line 22, add <!-- and end with --> at line 39

<!--    
       {if $current_step=='payment' || $current_step=='shipping'}

           {l s='Address'}

       {else}
       {l s='Address'}
       {/if}
-->
<!--    
       {if $current_step=='payment'}

           {l s='Shipping'}

       {else}
       {l s='Shipping'}
       {/if}
-->



Now other steps are disabled.
Lastly, order-payment.tpl also inside your themes directory.

Go to line 24, check this line :
{$base_dir_ssl}order.php?step=2

Change 2 to 0, this will make back button at payment choose screen revert to the cart list.

This probably work very good if you only have 1 carrier as set up... dunno with multiple carrier tough, since skipping carrier choice will automatically choose your default carrier.

On you problem for shipping problem :
Admin shipping tab --> countries, zones, carriers : Make sure a customer country available for the carrier.
Admin shipping tab --> price ranges : Make sure the max number price range is high enough. ( I think it is limited to 10,000,000 )
Admin shipping tab --> re-save both top handling and fees table. ( yes, re-save those.... )

Hope it help...

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for your reply and code!

It works great when the user is logged in BEFORE adding anything to the shopping cart.

However, if I add items to my cart before logging in, after I log in during the checkout the error message is displayed 'There is no payment module installed.'

Any ideas?

Thanks so much for your help

Share this post


Link to post
Share on other sites

Yes, you're correct in this one, I always assume that user should log in 1st before start clicking...
I'll try to look again.

Share this post


Link to post
Share on other sites

Thanks for your help.

My carrier works as it should, and I even tried installing your code and then saving my carrier again in the back office, but I still get the 'No payment modules installed' error. Is there no workaround for this?

Thanks

Share this post


Link to post
Share on other sites

No luck in trying. :(
Seem like I cannot get this working if the customer haven't log in yet.
If only login part initiated before displaying summary..... that might work. But I don't know how to make it work.

Share this post


Link to post
Share on other sites

any updates on this? anyone worked out how to get it working if customer adds items before logging in?

Share this post


Link to post
Share on other sites

please help!!!!!!!!

virtual products ....................on address options are required and shipping ......on order page is not required..

please help!

Share this post


Link to post
Share on other sites

Hi

I also would like a way to resolve this issue .

I have had a couple of emails telling me they won't buy because of address issue , the checkout is too long and not good for downloadables :(

Thanks to fs_xyz for trying .

Share this post


Link to post
Share on other sites

There is still no solution at this please? I'm selling just key codes so I'd need to remove all the shipping step.

Thank you in advance for any help

Share this post


Link to post
Share on other sites

I've found a way to make it work when user added something to cart and then log in.

The thing is that on Payment step there is a query that checks if payment is enabled for particular country (at least this work this way for 2checkout payment module). Since you have removed

displayAddress();

in step 1 - customer's country won't be set in $cart object. And you will see error 'no payment module is installed'.

What I did is set an invoice address in $cart manually on step 1 before displayPayment(). So now step 1 looks like this:

case 1:
   $customer = new Customer(intval($cookie->id_customer));
   if (Validate::isLoadedObject($customer)){
       // Getting customer addresses
   $customerAddresses = $customer->getAddresses(intval($cookie->id_lang));
   // Setting default addresses for cart
   if ((!isset($cart->id_address_invoice) OR empty($cart->id_address_invoice)) AND sizeof($customerAddresses)){
       $cart->id_address_invoice = intval($customerAddresses[0]['id_address']);
       $update = 1;
   }
       // Update cart addresses only if needed
       if (isset($update) AND $update)
           $cart->update();
   }

   //displayAddress();
   displayPayment();
   break;



I have a downloadable products, so I have set only invoice address. If you need to deliver your products you need to get and set a delivery address in $cart as well. Hope that will help.

Thanks, Eugene

Share this post


Link to post
Share on other sites

This works very well, but, I have a new problem: I have free products and payment step is not activated automatically download (as before the code changes). Appears the paypal payment. Any idea?

Share this post


Link to post
Share on other sites
At your root directory file order.php.
At line 85, you'll see script written with switch blahblahblah.
Below it there is case 1 : displayAddress().
Block that line with // and write another line to be like this

case 1:
displayPayment();        
//displayAddress();
break;



This will make user go straight to payment choice.

At order-steps.tpl, inside your themes directory, line 22, add <!-- and end with --> at line 39

<!--    
       {if $current_step=='payment' || $current_step=='shipping'}

           {l s='Address'}

       {else}
       {l s='Address'}
       {/if}
-->
<!--    
       {if $current_step=='payment'}

           {l s='Shipping'}

       {else}
       {l s='Shipping'}
       {/if}
-->



Now other steps are disabled.
Lastly, order-payment.tpl also inside your themes directory.

Go to line 24, check this line :
{$base_dir_ssl}order.php?step=2

Change 2 to 0, this will make back button at payment choose screen revert to the cart list.

This probably work very good if you only have 1 carrier as set up... dunno with multiple carrier tough, since skipping carrier choice will automatically choose your default carrier.

On you problem for shipping problem :
Admin shipping tab --> countries, zones, carriers : Make sure a customer country available for the carrier.
Admin shipping tab --> price ranges : Make sure the max number price range is high enough. ( I think it is limited to 10,000,000 )
Admin shipping tab --> re-save both top handling and fees table. ( yes, re-save those.... )

Hope it help...



tnx alot , it's working well :D

Share this post


Link to post
Share on other sites

I couldn't get this to work unless i also added these lines for setting the delivery-address. It would trigger a 'hack attempt' somewhere else.

if ((!isset($cart->id_address_invoice) OR empty($cart->id_address_invoice)) AND sizeof($customerAddresses)) {                    
                   $cart->id_address_invoice = intval($customerAddresses[0]['id_address']);
                   $update = 1;
               }

// Add these lines below for setting the delivery address
if ((!isset($cart->id_address_delivery) OR empty($cart->id_address_delivery)) AND sizeof($customerAddresses)) {                    
   $cart->id_address_delivery = intval($customerAddresses[0]['id_address']);
   $update = 1;
}



Cheers for the initial code!

Share this post


Link to post
Share on other sites
I've found a way to make it work when user added something to cart and then log in.

The thing is that on Payment step there is a query that checks if payment is enabled for particular country (at least this work this way for 2checkout payment module). Since you have removed
displayAddress();

in step 1 - customer's country won't be set in $cart object. And you will see error 'no payment module is installed'.

What I did is set an invoice address in $cart manually on step 1 before displayPayment(). So now step 1 looks like this:

case 1:
   $customer = new Customer(intval($cookie->id_customer));
   if (Validate::isLoadedObject($customer)){
       // Getting customer addresses
   $customerAddresses = $customer->getAddresses(intval($cookie->id_lang));
   // Setting default addresses for cart
   if ((!isset($cart->id_address_invoice) OR empty($cart->id_address_invoice)) AND sizeof($customerAddresses)){
       $cart->id_address_invoice = intval($customerAddresses[0]['id_address']);
       $update = 1;
   }
       // Update cart addresses only if needed
       if (isset($update) AND $update)
           $cart->update();
   }

   //displayAddress();
   displayPayment();
   break;



I have a downloadable products, so I have set only invoice address. If you need to deliver your products you need to get and set a delivery address in $cart as well. Hope that will help.

Thanks, Eugene



Been stuck with this for the last 3 hours. Eugene, you saved my life. Thanks a lot!

Share this post


Link to post
Share on other sites

Hi shahriar ,

The above given code is only cut off for progress bar i.e top of the shopping cart but it will not work , i think something missing .

Share this post


Link to post
Share on other sites

Hi. I have tried your code on Prestashop 1.5.3.1 but get white screen when starting the checkout process. Has any code been lost in pasting to WordPress? Maybe you could post a download for a .txt file?

Share this post


Link to post
Share on other sites

I found the file (order.php) but the script is not like u say. this what my file (order.php) contains:

<?php

/*

* 2007-2013 PrestaShop

*

* NOTICE OF LICENSE

*

* This source file is subject to the Open Software License (OSL 3.0)

* that is bundled with this package in the file LICENSE.txt.

* It is also available through the world-wide-web at this URL:

* http://opensource.org/licenses/osl-3.0.php

* If you did not receive a copy of the license and are unable to

* obtain it through the world-wide-web, please send an email

* to license@prestashop.com so we can send you a copy immediately.

*

* DISCLAIMER

*

* Do not edit or add to this file if you wish to upgrade PrestaShop to newer

* versions in the future. If you wish to customize PrestaShop for your

* needs please refer to http://www.prestashop.com for more information.

*

* @author PrestaShop SA <contact@prestashop.com>

* @copyright 2007-2013 PrestaShop SA

* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)

* International Registered Trademark & Property of PrestaShop SA

*/

 

/**

* This file will be removed in 1.6

* You have to use index.php?controller=page_name instead of this page

*

* @deprecated 1.5.0

*/

 

require(dirname(__FILE__).'/config/config.inc.php');

Tools::displayFileAsDeprecated();

 

Tools::redirect('index.php?controller=order'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');

Share this post


Link to post
Share on other sites

It is absolutely shocking that the PS developers haven't fixed this problem, when there were people back in 2010 complaining about this!!

 

So PS developers, what year you think you will think about fixing virtual carts, so if there are only virtual products the checkout funnel does not include the shipping step????

Share this post


Link to post
Share on other sites

agree.. its kinda pathetic you cant remove addresses altogether..

if i cant hack it soon im gonna try other software

Share this post


Link to post
Share on other sites

looks like prestashop development has stopped years ago, anybody know any good replacement?

Share this post


Link to post
Share on other sites

This methode will not work, and you will face so many other errors.

I think the best way to do it is to override the OrderOpcController .

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More