Customizing invoices

  • Posts: 11
  • Thank you received: 0
10 years 2 months ago #172004

-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3.3
-- PHP version -- : 5.4.32
-- Browser(s) name and version -- : Firefox 32
-- Error-message(debug-mod must be tuned on) -- : N/A

I'm trying to customize the invoice page. I'd like to add a column to show the product warehouse ID (I'm using Warehouse ID as a place to tell the people in charge of shipping out orders where any product is located). I looked at the view called "invoice" (under Display\Back-end), and I can see the code, but I can't see the query that brings in the information. Could anyone point me to that name and location of the file that contains the query?

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
10 years 2 months ago #172100

Hello,
Even if it's not totally optimized, a solution can be to change these lines :

 foreach($this->order->products as $product){
                if($group && $product->order_product_option_parent_id) continue;
By :
              $this->database = JFactory::getDBO();
              foreach($this->order->products as $product){
                if($group && $product->order_product_option_parent_id) continue;

And use that php code to display your product warehouse name inside the foreach loop :
$query='SELECT product_warehouse_id FROM '.hikashop_table('product').' WHERE product_id ='.$product->product_id;
$this->database->setQuery($query);
$product_warehouse_id = $this->database->loadResult();
if($product_warehouse_id != 0){
      $query='SELECT warehouse_name FROM '.hikashop_table('warehouse').' WHERE warehouse_id ='.$product_warehouse_id;
      $this->database->setQuery($query);
      $warehouse_name = $this->database->loadResult();
      echo $warehouse_name;
}

Last edit: 10 years 2 months ago by Mohamed Thelji.

Please Log in or Create an account to join the conversation.

Time to create page: 0.065 seconds
Powered by Kunena Forum