Jump to content

comment supprimer espaces numero suivi Colissimo?


ventesites

Recommended Posts

bonjour

 

le numero de suivi Colissimo que j'entre sur le site contient des espaces ce qui fait que l'url de suivi envoi bien sur la page Colissimo mais sans numero donc le suivi n'apparait pas

 

Il faudrait que je puisse enlever les espaces de $shipping_number mais je ne situe pas bien sur quel fichier le faire ni comment le coder correctement style

 

str_replace (" ","",$shipping_number);

 

est-ce dans

/classes/order/order.php

ou

/controllers/admin/adminOrdersController.php

?

 

je suis sur PS1.6.9

 

merci !

Link to comment
Share on other sites

Bonjour,

Dans AdminOrdersController.php ligne 460:

        if (Tools::isSubmit('submitShippingNumber') && isset($order)) {
            if ($this->tabAccess['edit'] === '1') {
                $order_carrier = new OrderCarrier(Tools::getValue('id_order_carrier'));
                if (!Validate::isLoadedObject($order_carrier)) {
                    $this->errors[] = Tools::displayError('The order carrier ID is invalid.');
                } elseif (!Validate::isTrackingNumber(str_replace(" ", "", Tools::getValue('tracking_number')))) {
                    $this->errors[] = Tools::displayError('The tracking number is incorrect.');
                } else {
                    // update shipping number
                    // Keep these two following lines for backward compatibility, remove on 1.6 version
                    $order->shipping_number = str_replace(" ", "", Tools::getValue('tracking_number'));
                    $order->update();
Edited by Elitius (see edit history)
Link to comment
Share on other sites

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...