Jump to content

What the problem with tracking number field display - PS 1.4


Recommended Posts

Hi All!

I updated to PS1-4-1-0 from 1.3.1.1 and I lost the tracking (Shipping) number field

I checked the admin/tabs/adminorders.php file but I did not see any difference!

Please let me know what could be the problem, why I cannot see and set the tracking number field, after I set the status to shipped

there is the code samples..

/* Update shipping number */
       if (Tools::isSubmit('submitShippingNumber') AND ($id_order = (int)(Tools::getValue('id_order'))) AND Validate::isLoadedObject($order = new Order($id_order)))
       {
           if ($this->tabAccess['edit'] === '1')
           {
               if (!$order->hasBeenShipped())
                   die(Tools::displayError('The shipping number can only be set once the order has been shipped.'));
               $_GET['view'.$this->table] = true;

               $shipping_number = pSQL(Tools::getValue('shipping_number'));
               $order->shipping_number = $shipping_number;
               $order->update();
               if ($shipping_number)
               {
                   global $_LANGMAIL;
                   $customer = new Customer((int)($order->id_customer));
                   $carrier = new Carrier((int)($order->id_carrier));
                   if (!Validate::isLoadedObject($customer) OR !Validate::isLoadedObject($carrier))
                       die(Tools::displayError());
                   $templateVars = array(
                       '{followup}' => str_replace('@', $order->shipping_number, $carrier->url),
                       '{firstname}' => $customer->firstname,
                       '{lastname}' => $customer->lastname,
                       '{id_order}' => (int)($order->id)
                   );
                   @Mail::Send((int)($order->id_lang), 'in_transit', Mail::l('Package in transit'), $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname);
               }
           }
           else
               $this->_errors[] = Tools::displayError('You do not have permission to edit here.');
       }



    /* Display shipping number field */
           if ($carrier->url && $order->hasBeenShipped())
            echo '
               <form action="'.$currentIndex.'&view;'.$this->table.'&token;='.$this->token.'" method="post" style="margin-top:10px;">
                   <input type="text" name="shipping_number" value="'. $order->shipping_number.'" />
                   <input type="hidden" name="id_order" value="'.$order->id.'" />
                   <input type="submit" name="submitShippingNumber" value="'.$this->l('Set shipping number').'" class="button" />
               </form>';
           echo '
';

Link to comment
Share on other sites

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