- Posts: 11
- Thank you received: 0
Customizing invoices
12 years 2 weeks ago #172004
by ben1265
Customizing invoices was created by ben1265
-- 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?
-- 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.
Less
More
- Posts: 12953
- Thank you received: 1778
12 years 2 weeks ago - 12 years 2 weeks ago #172100
by Mohamed Thelji
Replied by Mohamed Thelji on topic Customizing invoices
Hello,
Even if it's not totally optimized, a solution can be to change these lines :
By :
And use that php code to display your product warehouse name inside the foreach loop :
Even if it's not totally optimized, a solution can be to change these lines :
Code:
foreach($this->order->products as $product){
if($group && $product->order_product_option_parent_id) continue;
Code:
$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 :
Code:
$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: 12 years 2 weeks ago by Mohamed Thelji.
Please Log in or Create an account to join the conversation.
Time to create page: 0.202 seconds