Bonjour, here is what i did
<br>
<br>
Override **AdminOrderPreferencesController** and add a boolean configuration field to toggle this functionnality
$this->fields_options = array(
[...]
'PS_ORDER_PROCESS_BYPASS_SHIPPING' => array(
'title' => $this->l('Bypass shipping step'),
'hint' => $this->l('Do not show shipping step in order process.'),
'validation' => 'isBool',
'cast' => 'intval',
'type' => 'bool'
)
);
You can now find a toggle button in Backoffice under **Preferences > Orders**
<br>
Override **OrderController** and add an `if` in `init()` method to set the current step to *payment step* if the controller inits itself on *delivery step*
public function init()
{
global $orderTotal;
parent::init();
$this->step = (int)Tools::getValue('step');
// HERE IT IS
if((bool)Configuration::get('PS_ORDER_PROCESS_BYPASS_SHIPPING') && $this->step == self::STEP_DELIVERY){
$this->step = self::STEP_PAYMENT;
}
if (!$this->nbProducts) {
$this->step = -1;
}
Also bypass the CGV checking verification on payment step in `initContent()` method.
<br>
If you don't, CGV will never be checked, it will redirect you on *delivery step*, you will tell him that he is in fact on *payment step*, he will check for CGV again, he will do the same redirection ... and you are in an infinite loop
case OrderController::STEP_PAYMENT:
$cgv = Tools::getValue('cgv') || $this->context->cookie->check_cgv;
if (
!(bool)Configuration::get('PS_ORDER_PROCESS_BYPASS_SHIPPING') && // HERE IT IS
$is_advanced_payment_api === false && Configuration::get('PS_CONDITIONS')
&& (!Validate::isBool($cgv) || $cgv == false)
) {
Tools::redirect('index.php?controller=order&step=2');
}
Pass the configuration parameter to the view to modify display
$this->context->smarty->assign('bypass_shipping_step', (bool)Configuration::get('PS_ORDER_PROCESS_BYPASS_SHIPPING'));
And in your views, do you styling stuff with some `if`<br>
In **order-steps.tpl** you can add an `{if not $bypass_shipping_step}...{/if}` around the fourth `li` to hide it, and do something like :
{if $bypass_shipping_step}
<style>
ul.step li{
width:25%;
}
</style>
{/if}
or import a dedicated stylesheet which would be cleaner.
<br>
<br>
<br>
Hope it helped.