Jump to content

Can i hide Carrier Selection step in PrestaShop


Recommended Posts

Try changing lines 95-96 of order.php from:

autoStep(2);
displayCarrier();



to:

//autoStep(2);
//displayCarrier();
autoStep(3);
checkFreeOrder();
displayPayment();



then change line 24 of order-paymnet.tpl in your theme's directory from:


<a href="{$base_dir_ssl}order.php?step=2" title="{l s='Previous'}" class="button">« {l s='Previous'}



to:


<a href="{$base_dir_ssl}order.php?step=1" title="{l s='Previous'}" class="button">« {l s='Previous'}

Link to comment
Share on other sites

  • 1 month later...
  • 7 months later...

The code is very similiar. Try overriding the process() function in OrderController and change lines 97-98 (in PrestaShop v1.4.3) of OrderController.php from:

$this->autoStep();
$this->_assignCarrier();



to:

//$this->autoStep();
//$this->_assignCarrier();
$this->autoStep();
/* Bypass payment step if total is 0 */
if (($id_order = $this->_checkFreeOrder()) AND $id_order)
{
   if (self::$cookie->is_guest)
   {
       $email = self::$cookie->email;
       self::$cookie->logout(); // If guest we clear the cookie for security reason
       Tools::redirect('guest-tracking.php?id_order='.(int)$id_order.'&email;='.urlencode($email));
   }
   else
       Tools::redirect('history.php');
}
$this->_assignPayment();



then change line 68 (in PrestaShop v1.4.3) of order-payment.tpl in your theme's directory from:


<a href="{$link->getPageLink('order.php', true)}?step=2" title="{l s='Previous'}" class="button">« {l s='Previous'}



to:


<a href="{$link->getPageLink('order.php', true)}?step=1" title="{l s='Previous'}" class="button">« {l s='Previous'}



I haven't tested this, but hopefully it will work.

Link to comment
Share on other sites

Hey, sounds good.

I`ve tested many things and for me only works to copy step=3 to step=2 change few lines and comment out old step=2.
Else the order-address.js throws the error ".. address can`t be saved ..."

The important in PS1.4.1 controllers/OrderController.php is to take:

$this->processAddress();
$this->_assignCarrier();



from the old case 2: into a renamed copy of case 3:

public function process()
...
/*            
            case 2:        
               if(Tools::isSubmit('processAddress'))
               $this->processAddress();
               $this->autoStep();
               $this->_assignCarrier();
               break;
*/            

// copy all from case 3: and rename it case 2: and change first 3 lines
// 1. because processCarrier is not yet executed comment out
// and between insert ... end use new lines

           case 2:

//     if(Tools::isSubmit('processCarrier'))    
// insert 
               $this->processAddress();
               $this->_assignCarrier();                
// end                
               $this->processCarrier();                
               $this->autoStep();
                /* Bypass payment step if total is 0 */
// ... and so on
               break;          

           case 3:        

// unchanged

          break;



and to display the new step=2 as payment also, few lines down copy case 3: also in renamed case 2:

public function displayContent()
...
/*
case 2:
   self::$smarty->display(_PS_THEME_DIR_.'order-carrier.tpl');
   break;
*/

   case 2:    
   self::$smarty->display(_PS_THEME_DIR_.'order-payment.tpl');
   break;

   case 3:    
   self::$smarty->display(_PS_THEME_DIR_.'order-payment.tpl');
   break;

   default:
   self::$smarty->display(_PS_THEME_DIR_.'shopping-cart.tpl');
   break;



also one change because step=3 isn´t real: maybe test this part

public function autoStep()
...
//        elseif ($this->step >= 3 AND !self::$cart->id_carrier AND !$isVirtualCart)
//            Tools::redirect('order.php?step=2');
       elseif ($this->step >= 2 AND !self::$cart->id_carrier AND !$isVirtualCart)
           Tools::redirect('order.php?step=1');



ok, i will post my solution in the thread from steviger tomorrow, if it is well. Because there are all steps to be done right for PS 1.3 and ....

EDIT 07/18/2011: I made an update of the code, because of the back button in bankwire !

Link to comment
Share on other sites

  • 2 weeks later...
  • 7 months later...

I was wondering why I didn't make any difference in my shop, but I'm using one page checkout... duh.

I guess the only thing I have to do is in order-opc.tpl comment the carrier in line 92-94

<!-- Carrier -->
 {include file="$tpl_dir./order-carrier.tpl"}
 <!-- END Carrier -->

Nope, that didn't work. Any tips on how to remove the carrier in the OPC page?

 

 

Cheers!

 

Steven

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

×
×
  • Create New...