Jump to content

Order_id & Invoice


rbb11

Recommended Posts

Try to do this

TRUNCATE TABLE `ps_orders`;
TRUNCATE TABLE `ps_order_detail`;
TRUNCATE TABLE `ps_order_discount`;
TRUNCATE TABLE `ps_order_history`;
TRUNCATE TABLE `ps_order_message`;
TRUNCATE TABLE `ps_order_message_lang`;
TRUNCATE TABLE `ps_order_return`;
TRUNCATE TABLE `ps_order_return_detail`;
TRUNCATE TABLE `ps_order_slip`;
TRUNCATE TABLE `ps_order_slip_detail`;




In my signature you have the link to make a Total Reset to your Store ;)

Link to comment
Share on other sites

How can I change the order_id to start at another number instead of 0? where can I edit the invoice pdf to change the logo size? I have searched here and cannot find my answers.

Help is very much appreciated!


HI,

To change the LOGO that appears on the PDF invoices, You'll need to have another image and upload it to your image folder.
then go to:

classes\PDF.php
then search for logo.jpg and change it to the name of your new image. (Note: you can only use .jpg extention)

This will only appear on your pdf invoices and Packing slip.

Hope that helps.
Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...

i also want to customize order_id, but i cannot find where the code that creates order_id. can someone tell me where the code is?

I get "Hack attempt (Order -> id_order is empty)" when I try to change the code in classes/order.php to this:

class        Order extends ObjectModel
{
   /** @var integer order id */
   public         $id_order;

   /** @var integer Delivery address id */
   public         $id_address_delivery;

   /** @var integer Invoice address id */
   public         $id_address_invoice;

   /** @var integer Cart id */
   public         $id_cart;

   /** @var integer Currency id */
   public         $id_currency;

   /** @var integer Language id */
   public         $id_lang;

   /** @var integer Customer id */
   public         $id_customer;

   /** @var integer Carrier id */
   public         $id_carrier;

   /** @var string Secure key */
   public        $secure_key;

   /** @var string Payment method id */
   public         $payment;

   /** @var string Payment module */
   public         $module;

   /** @var boolean Customer is ok for a recyclable package */
   public        $recyclable = 1;

   /** @var boolean True if the customer wants a gift wrapping */
   public        $gift = 0;

   /** @var string Gift message if specified */
   public         $gift_message;

   /** @var string Shipping number */
   public         $shipping_number;

   /** @var float Discounts total */
   public         $total_discounts;

   /** @var float Total to pay */
   public         $total_paid;

   /** @var float Total really paid */
   public         $total_paid_real;

   /** @var float Products total */
   public         $total_products;

   /** @var float Shipping total */
   public         $total_shipping;

   /** @var float Wrapping total */
   public         $total_wrapping;

   /** @var integer Invoice number */
   public         $invoice_number;

   /** @var integer Delivery number */
   public         $delivery_number;

   /** @var string Invoice creation date */
   public         $invoice_date;

   /** @var string Delivery creation date */
   public         $delivery_date;

   /** @var boolean Order validity (paid and not canceled) */
   public         $valid;

   /** @var string Object creation date */
   public         $date_add;

   /** @var string Object last modification date */
   public         $date_upd;

   protected $tables = array ('orders');

   protected    $fieldsRequired = array('id_order', 'id_address_delivery', 'id_address_invoice', 'id_cart', 'id_currency', 'id_lang', 'id_customer', 'id_carrier', 'payment', 'total_paid', 'total_paid_real', 'total_products');
   protected    $fieldsSize = array('payment' => 32);
   protected    $fieldsValidate = array(
       'id_order' => 'isUnsignedId',    
       'id_address_delivery' => 'isUnsignedId',
       'id_address_invoice' => 'isUnsignedId',
       'id_cart' => 'isUnsignedId',
       'id_currency' => 'isUnsignedId',
       'id_lang' => 'isUnsignedId',
       'id_customer' => 'isUnsignedId',
       'id_carrier' => 'isUnsignedId',
       'secure_key' => 'isMd5',
       'payment' => 'isGenericName',
       'recyclable' => 'isBool',
       'gift' => 'isBool',
       'gift_message' => 'isMessage',
       'total_discounts' => 'isPrice',
       'total_paid' => 'isPrice',
       'total_paid_real' => 'isPrice',
       'total_products' => 'isPrice',
       'total_shipping' => 'isPrice',
       'total_wrapping' => 'isPrice',
       'shipping_number' => 'isUrl'
   );

   /* MySQL does not allow 'order' for a table name */
   protected     $table = 'orders';
   protected     $identifier = 'id_order';

   public function getFields()
   {
       parent::validateFields();

               // This is hardcode order ID, i will change it to dynamic later
               $id_order = '236000001';

       $fields['id_order'] = intval($id_order);
       $fields['id_address_delivery'] = intval($this->id_address_delivery);
       $fields['id_address_invoice'] = intval($this->id_address_invoice);
       $fields['id_cart'] = intval($this->id_cart);
       $fields['id_currency'] = intval($this->id_currency);
       $fields['id_lang'] = intval($this->id_lang);
       $fields['id_customer'] = intval($this->id_customer);
       $fields['id_carrier'] = intval($this->id_carrier);
       $fields['secure_key'] = pSQL($this->secure_key);
       $fields['payment'] = pSQL($this->payment);
       $fields['module'] = pSQL($this->module);
       $fields['recyclable'] = intval($this->recyclable);
       $fields['gift'] = intval($this->gift);
       $fields['gift_message'] = pSQL($this->gift_message);
       $fields['shipping_number'] = pSQL($this->shipping_number);
       $fields['total_discounts'] = floatval($this->total_discounts);
       $fields['total_paid'] = floatval($this->total_paid);
       $fields['total_paid_real'] = floatval($this->total_paid_real);
       $fields['total_products'] = floatval($this->total_products);
       $fields['total_shipping'] = floatval($this->total_shipping);
       $fields['total_wrapping'] = floatval($this->total_wrapping);
       $fields['invoice_number'] = intval($this->invoice_number);
       $fields['delivery_number'] = intval($this->delivery_number);
       $fields['invoice_date'] = pSQL($this->invoice_date);
       $fields['delivery_date'] = pSQL($this->delivery_date);
       $fields['valid'] = intval($this->valid) ? 1 : 0;
       $fields['date_add'] = pSQL($this->date_add);
       $fields['date_upd'] = pSQL($this->date_upd);

       return $fields;
   }

Link to comment
Share on other sites

  • 2 months later...
  • 2 years 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...