[Skip to main content](#vessel-content)

#   Vendor name in PDF invoice

##

- **[river](/forum/user/9591-river "View river's Profile")**
- [![river's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar9591.gif)](/forum/user/9591-river "View river's Profile") Topic Author
- [ Offline](/forum/user/9591-river)

Less More

- Posts: 344
- Thank you received: 3
-
-

9 years 11 months ago -  9 years 11 months ago [\#256793](#256793) by [river](/forum/user/9591-river "View river's Profile")  *[Vendor name in PDF invoice](/forum/23-market-how-to/887772-vendor-name-in-pdf-invoice#256793 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.4 -- PHP version -- : 7  Joomla 3.6.4 Hikashop 2.6.4 Hikamarket 1.7.2  Just bought Hikamarket. Very happy about it. Is it possible to place the &quot;Vendor name&quot; which is attached to the product below the product name in the on the PDF invoice.  Please see image below.  If so, any advice on what the code will be ?  Tnx.")* was created by *[river](/forum/user/9591-river "View river's Profile")*

-- HikaShop version -- : 2.6.4
-- HikaMarket version -- : 1.7.2
-- Joomla version -- : 3.6.4
-- PHP version -- : 7

Joomla 3.6.4
Hikashop 2.6.4
Hikamarket 1.7.2

Just bought Hikamarket. Very happy about it.
Is it possible to place the "Vendor name" which is attached to the product below the product name in the on the PDF invoice.

Please see image below.

[ ![vendor&#95;name.png](/forum/attachment/34978) ](/forum/attachment/34978 "vendor&#95;name.png")

If so, any advice on what the code will be ?

Tnx.

Last edit: 9 years 11 months ago by [river](/forum/user/9591-river "View river's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg3NzcyLXZlbmRvci1uYW1lLWluLXBkZi1pbnZvaWNlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26395
- Thank you received: 4077
-
- [](http://obsi.dev)
-

9 years 11 months ago -  9 years 11 months ago [\#256827](#256827) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Vendor name in PDF invoice](/forum/23-market-how-to/887772-vendor-name-in-pdf-invoice#256827 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.4 -- PHP version -- : 7  Joomla 3.6.4 Hikashop 2.6.4 Hikamarket 1.7.2  Just bought Hikamarket. Very happy about it. Is it possible to place the &quot;Vendor name&quot; which is attached to the product below the product name in the on the PDF invoice.  Please see image below.  If so, any advice on what the code will be ?  Tnx.")*

Hi,

Here the code you can use in the "invoice.php" file of the "attachinvoice" plugin. Code:

if(empty($this-&gt;db)) $this-&gt;db = JFactory::getDBO(); $query = 'SELECT hkop.*, hko.order_vendor_id, hmv.vendor_name, hmv.vendor_id '. ' FROM ' . hikashop_table('order_product') . ' as hkop '. ' INNER JOIN ' . hikashop_table('order'). ' AS hko ON hkop.order_id = hko.order_id '. ' LEFT JOIN ' .'#__hikamarket_vendor'. ' AS hmv ON hmv.vendor_id = hko.order_vendor_id '. ' WHERE hko.order_type = \'subsale\' AND hko.order_parent_id = '. (int)$order-&gt;order_id . ' ORDER BY hko.order_id DESC'; $this-&gt;db-&gt;setQuery($query); $vendorProducts = $this-&gt;db-&gt;loadObjectList(); foreach($order-&gt;products as &amp;$product) { foreach($vendorProducts as $vendorProduct) { if((int)$vendorProduct-&gt;order_product_parent_id != $product-&gt;order_product_id) continue; if((int)$vendorProduct-&gt;vendor_id &lt;= 1) break; if(empty($product-&gt;extraData)) $product-&gt;extraData = array(); $product-&gt;extraData['vendor'] = '&lt;span class="order_product_vendor"&gt;'.JText::sprintf('SOLD_BY_VENDOR', $vendorProduct-&gt;vendor_name).'&lt;/span&gt;'; break; } } unset($product);

Then, after the product code is displayed Code:

if ($config-&gt;get('show_code')) { echo '&lt;br/&gt;'.$product-&gt;order_product_code; }

You can add some code to display the content from $product-&gt;extraData .

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Last edit: 9 years 11 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: fixing code for $this-&gt;db

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg3NzcyLXZlbmRvci1uYW1lLWluLXBkZi1pbnZvaWNlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[river](/forum/user/9591-river "View river's Profile")**
- [![river's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar9591.gif)](/forum/user/9591-river "View river's Profile") Topic Author
- [ Offline](/forum/user/9591-river)

Less More

- Posts: 344
- Thank you received: 3
-
-

9 years 11 months ago -  9 years 11 months ago [\#256835](#256835) by [river](/forum/user/9591-river "View river's Profile")  Replied by *[river](/forum/user/9591-river "View river's Profile")* on topic *[Vendor name in PDF invoice](/forum/23-market-how-to/887772-vendor-name-in-pdf-invoice#256835 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.4 -- PHP version -- : 7  Joomla 3.6.4 Hikashop 2.6.4 Hikamarket 1.7.2  Just bought Hikamarket. Very happy about it. Is it possible to place the &quot;Vendor name&quot; which is attached to the product below the product name in the on the PDF invoice.  Please see image below.  If so, any advice on what the code will be ?  Tnx.")*

OK excellent. tnx

Any advice on in which line I should paste this code ?

Last edit: 9 years 11 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: remove duplicate code

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg3NzcyLXZlbmRvci1uYW1lLWluLXBkZi1pbnZvaWNlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26395
- Thank you received: 4077
-
- [](http://obsi.dev)
-

9 years 11 months ago [\#256845](#256845) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Vendor name in PDF invoice](/forum/23-market-how-to/887772-vendor-name-in-pdf-invoice#256845 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.4 -- PHP version -- : 7  Joomla 3.6.4 Hikashop 2.6.4 Hikamarket 1.7.2  Just bought Hikamarket. Very happy about it. Is it possible to place the &quot;Vendor name&quot; which is attached to the product below the product name in the on the PDF invoice.  Please see image below.  If so, any advice on what the code will be ?  Tnx.")*

Hi,

Before the "foreach" for the listing of the order products.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg3NzcyLXZlbmRvci1uYW1lLWluLXBkZi1pbnZvaWNlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[river](/forum/user/9591-river "View river's Profile")**
- [![river's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar9591.gif)](/forum/user/9591-river "View river's Profile") Topic Author
- [ Offline](/forum/user/9591-river)

Less More

- Posts: 344
- Thank you received: 3
-
-

9 years 11 months ago [\#256948](#256948) by [river](/forum/user/9591-river "View river's Profile")  Replied by *[river](/forum/user/9591-river "View river's Profile")* on topic *[Vendor name in PDF invoice](/forum/23-market-how-to/887772-vendor-name-in-pdf-invoice#256948 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.4 -- PHP version -- : 7  Joomla 3.6.4 Hikashop 2.6.4 Hikamarket 1.7.2  Just bought Hikamarket. Very happy about it. Is it possible to place the &quot;Vendor name&quot; which is attached to the product below the product name in the on the PDF invoice.  Please see image below.  If so, any advice on what the code will be ?  Tnx.")*

OK so I placed the code before the line
Code:

foreach($order-&gt;products as $j =&gt; $optionElement){

...on line number 171 in invoice.php file.

Im not sure if this is the correct place.

Anyway, then I need to add....

> You can add some code to display the content from $product-&gt;extraData .

But what exactly would this code be, any advice ?

Tnx

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg3NzcyLXZlbmRvci1uYW1lLWluLXBkZi1pbnZvaWNlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26395
- Thank you received: 4077
-
- [](http://obsi.dev)
-

9 years 11 months ago [\#256951](#256951) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Vendor name in PDF invoice](/forum/23-market-how-to/887772-vendor-name-in-pdf-invoice#256951 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.4 -- PHP version -- : 7  Joomla 3.6.4 Hikashop 2.6.4 Hikamarket 1.7.2  Just bought Hikamarket. Very happy about it. Is it possible to place the &quot;Vendor name&quot; which is attached to the product below the product name in the on the PDF invoice.  Please see image below.  If so, any advice on what the code will be ?  Tnx.")*

Hi,

Unfortunately no, it is not the right place.
That place would be better : Code:

$fieldsClass = hikashop_get('class.field'); $group = $config-&gt;get('group_options',0); foreach($order-&gt;products as $product){

Afterwards you will be able to display the product vendor using Code:

if(!empty($product-&gt;extraData['vendor'])) echo $product-&gt;extraData['vendor'];

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg3NzcyLXZlbmRvci1uYW1lLWluLXBkZi1pbnZvaWNlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[river](/forum/user/9591-river "View river's Profile")**
- [![river's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar9591.gif)](/forum/user/9591-river "View river's Profile") Topic Author
- [ Offline](/forum/user/9591-river)

Less More

- Posts: 344
- Thank you received: 3
-
-

9 years 11 months ago -  9 years 11 months ago [\#257133](#257133) by [river](/forum/user/9591-river "View river's Profile")  Replied by *[river](/forum/user/9591-river "View river's Profile")* on topic *[Vendor name in PDF invoice](/forum/23-market-how-to/887772-vendor-name-in-pdf-invoice#257133 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.4 -- PHP version -- : 7  Joomla 3.6.4 Hikashop 2.6.4 Hikamarket 1.7.2  Just bought Hikamarket. Very happy about it. Is it possible to place the &quot;Vendor name&quot; which is attached to the product below the product name in the on the PDF invoice.  Please see image below.  If so, any advice on what the code will be ?  Tnx.")*

OK so I place the main code before the line Code:

foreach($order-&gt;products as $product){

But then I get the message

An error has occurred.
0 Call to a member function setQuery() on null

I also tried to place the code before the whole paragraph below
Code:

$fieldsClass = hikashop_get('class.field'); $group = $config-&gt;get('group_options',0); foreach($order-&gt;products as $product){

But get the same error message as above.

Any advice ?

tnx

Last edit: 9 years 11 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: removing duplicate code

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg3NzcyLXZlbmRvci1uYW1lLWluLXBkZi1pbnZvaWNlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26395
- Thank you received: 4077
-
- [](http://obsi.dev)
-

9 years 11 months ago [\#257134](#257134) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Vendor name in PDF invoice](/forum/23-market-how-to/887772-vendor-name-in-pdf-invoice#257134 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.4 -- PHP version -- : 7  Joomla 3.6.4 Hikashop 2.6.4 Hikamarket 1.7.2  Just bought Hikamarket. Very happy about it. Is it possible to place the &quot;Vendor name&quot; which is attached to the product below the product name in the on the PDF invoice.  Please see image below.  If so, any advice on what the code will be ?  Tnx.")*

Hi,

I edit my previous post.
Please add the content Code:

if(empty($this-&gt;db)) $this-&gt;db = JFactory::getDBO();

in order to fix the database object.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [river](/forum/user/9591-river "View river's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg3NzcyLXZlbmRvci1uYW1lLWluLXBkZi1pbnZvaWNlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[river](/forum/user/9591-river "View river's Profile")**
- [![river's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar9591.gif)](/forum/user/9591-river "View river's Profile") Topic Author
- [ Offline](/forum/user/9591-river)

Less More

- Posts: 344
- Thank you received: 3
-
-

9 years 11 months ago [\#257138](#257138) by [river](/forum/user/9591-river "View river's Profile")  Replied by *[river](/forum/user/9591-river "View river's Profile")* on topic *[Vendor name in PDF invoice](/forum/23-market-how-to/887772-vendor-name-in-pdf-invoice#257138 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.4 -- PHP version -- : 7  Joomla 3.6.4 Hikashop 2.6.4 Hikamarket 1.7.2  Just bought Hikamarket. Very happy about it. Is it possible to place the &quot;Vendor name&quot; which is attached to the product below the product name in the on the PDF invoice.  Please see image below.  If so, any advice on what the code will be ?  Tnx.")*

FINALLY IT WORKS !

You're the best Jerome

Tnx a lot ![=)](/smile.gif "=)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg3NzcyLXZlbmRvci1uYW1lLWluLXBkZi1pbnZvaWNlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[river](/forum/user/9591-river "View river's Profile")**
- [![river's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar9591.gif)](/forum/user/9591-river "View river's Profile") Topic Author
- [ Offline](/forum/user/9591-river)

Less More

- Posts: 344
- Thank you received: 3
-
-

9 years 11 months ago -  9 years 11 months ago [\#257374](#257374) by [river](/forum/user/9591-river "View river's Profile")  Replied by *[river](/forum/user/9591-river "View river's Profile")* on topic *[Vendor name in PDF invoice](/forum/23-market-how-to/887772-vendor-name-in-pdf-invoice#257374 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.4 -- PHP version -- : 7  Joomla 3.6.4 Hikashop 2.6.4 Hikamarket 1.7.2  Just bought Hikamarket. Very happy about it. Is it possible to place the &quot;Vendor name&quot; which is attached to the product below the product name in the on the PDF invoice.  Please see image below.  If so, any advice on what the code will be ?  Tnx.")*

The vendor name is only displaying on the PDF for the main order.

The vendor name is NOT displaying on the PDF invoice for the sub orders ?

.....any advice on how to fix it ?

Last edit: 9 years 11 months ago by [river](/forum/user/9591-river "View river's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg3NzcyLXZlbmRvci1uYW1lLWluLXBkZi1pbnZvaWNlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26395
- Thank you received: 4077
-
- [](http://obsi.dev)
-

9 years 11 months ago [\#257397](#257397) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Vendor name in PDF invoice](/forum/23-market-how-to/887772-vendor-name-in-pdf-invoice#257397 "-- HikaShop version -- : 2.6.4 -- HikaMarket version -- : 1.7.2 -- Joomla version -- : 3.6.4 -- PHP version -- : 7  Joomla 3.6.4 Hikashop 2.6.4 Hikamarket 1.7.2  Just bought Hikamarket. Very happy about it. Is it possible to place the &quot;Vendor name&quot; which is attached to the product below the product name in the on the PDF invoice.  Please see image below.  If so, any advice on what the code will be ?  Tnx.")*

Hi,

There is nothing to "fix".
You asked here how display the vendor name in the PDF invoice ; regarding your screenshot it was related to the PDF invoice generated for the customer.
And I gave you the code for that purpose.

Now you want to go deeper in the customization of the "attachinvoice" plugin, with new modifications.
I'm afraid that it is going outside the support range I can provide for HikaMarket.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg3NzcyLXZlbmRvci1uYW1lLWluLXBkZi1pbnZvaWNlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.082 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
