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

#   Question about vendor listing

##

- **[ronron](/forum/user/40399-ronron "View ronron's Profile")**
- [![ronron's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/bad_baby.jpg)](/forum/user/40399-ronron "View ronron's Profile") Topic Author
- [ Offline](/forum/user/40399-ronron)

Less More

- Posts: 490
- Thank you received: 2
-
-

9 years 9 months ago [\#261208](#261208) by [ronron](/forum/user/40399-ronron "View ronron's Profile")  *[Question about vendor listing](/forum/23-market-how-to/888640-question-about-vendor-listing#261208 "-- HikaShop version -- : 2.6.3 -- HikaMarket version -- : 1.7.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  i created a hikamarket vendor listing menu. MY problem is that it displays all users even do they have not posted anything. i think it has something to do with my setting to simplified registration with password and vendor automatic creation.  is there a way not to display vendors who just registered and has not actually posted anything? or maybe not to display vendors who has not completed certain fields?  thanks")* was created by *[ronron](/forum/user/40399-ronron "View ronron's Profile")*

-- HikaShop version -- : 2.6.3
-- HikaMarket version -- : 1.7.0
-- Joomla version -- : 3.4.5
-- PHP version -- : 5.5
-- Error-message(debug-mod must be tuned on) -- : none

hi

i created a hikamarket vendor listing menu. MY problem is that it displays all users even do they have not posted anything. i think it has something to do with my setting to simplified registration with password and vendor automatic creation.

is there a way not to display vendors who just registered and has not actually posted anything? or maybe not to display vendors who has not completed certain fields?

thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg4NjQwLXF1ZXN0aW9uLWFib3V0LXZlbmRvci1saXN0aW5nP3RtcGw9bWFya2Rvd24=) 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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

9 years 9 months ago -  9 years 9 months ago [\#261293](#261293) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Question about vendor listing](/forum/23-market-how-to/888640-question-about-vendor-listing#261293 "-- HikaShop version -- : 2.6.3 -- HikaMarket version -- : 1.7.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  i created a hikamarket vendor listing menu. MY problem is that it displays all users even do they have not posted anything. i think it has something to do with my setting to simplified registration with password and vendor automatic creation.  is there a way not to display vendors who just registered and has not actually posted anything? or maybe not to display vendors who has not completed certain fields?  thanks")*

Hello,

Sorry for the delay.
I needed to performed some tests in order to be sure of my answer.

I understand your request and it could be something interesting to put in HikaMarket.
Creating a dynamic filter in order to check the vendor completion will be a little bit complicated.
For the products, it requires to add a link with the hikashop product table.

In HikaMarket, you have a trigger for the vendor listing :
[ www.hikashop.com/support/documentation/1...VendorListingDisplay](https://www.hikashop.com/support/documentation/163-hikamarket-developer.html#onBeforeVendorListingDisplay)

So thanks to a custom plugin, you can add your own filters and you can modify dynamically the query which will be processed by HikaMarket.
In the parameter $sql_params, you can add a SQL join for the product table.
But if you want to only display the vendor with products, it will require to perform an "HAVING" in the SQL query and currently, there is no parameter for that (so we need to add it).

In the file "components/com_hikamarket/views/vendormarket/view.html.php"

Replacing: Code:

$order = '';

By Code:

$order = ''; $having = array();

And Code:

'order_accept' =&gt; &amp;$orderingAccept );

By Code:

'order_accept' =&gt; &amp;$orderingAccept, 'having' =&gt; &amp;$having );

And finally Code:

if($this-&gt;params-&gt;get('random')) $order = ' ORDER BY RAND()';

By Code:

if($this-&gt;params-&gt;get('random')) $order = ' ORDER BY RAND()'; if(!empty($having)) $order = ' HAVING ' . implode(' AND ', $having) . $order;

Then it will be possible in the plugin to modify "join" to like with the HikaShop table products, "select" to get the count of products and "having" to only get vendor with products. Code:

$sql_params['join']['vendor_products'] = 'LEFT JOIN #__hikashop_product AS hkp ON hkp.product_vendor_id = vendor.vendor_id AND hkp.product_published = 1 and hkp.product_type = \'main\''; $sql_params['select']['vendor_products'] = 'COUNT(hkp.product_id) AS vendor_products'; $sql_params['having']['vendor_products'] = 'vendor_products &gt; 0';

And it should do the trick !

Regards,

---

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

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

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

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

- **[ronron](/forum/user/40399-ronron "View ronron's Profile")**
- [![ronron's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/bad_baby.jpg)](/forum/user/40399-ronron "View ronron's Profile") Topic Author
- [ Offline](/forum/user/40399-ronron)

Less More

- Posts: 490
- Thank you received: 2
-
-

9 years 9 months ago [\#261709](#261709) by [ronron](/forum/user/40399-ronron "View ronron's Profile")  Replied by *[ronron](/forum/user/40399-ronron "View ronron's Profile")* on topic *[Question about vendor listing](/forum/23-market-how-to/888640-question-about-vendor-listing#261709 "-- HikaShop version -- : 2.6.3 -- HikaMarket version -- : 1.7.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  i created a hikamarket vendor listing menu. MY problem is that it displays all users even do they have not posted anything. i think it has something to do with my setting to simplified registration with password and vendor automatic creation.  is there a way not to display vendors who just registered and has not actually posted anything? or maybe not to display vendors who has not completed certain fields?  thanks")*

hi Jerome and thank you

i have been trying this but i cant move forward.

i always get this error

Warning

JInstaller: :Install: Can't find Joomla XML setup file.
×
Error

Unable to find install package

i attached the plugin i created, maybe you can point me to the right direction?

thank you  *This attachment is hidden for guests.
Please log in or register to see it.*

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg4NjQwLXF1ZXN0aW9uLWFib3V0LXZlbmRvci1saXN0aW5nP3RtcGw9bWFya2Rvd24=) 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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

9 years 9 months ago [\#261711](#261711) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Question about vendor listing](/forum/23-market-how-to/888640-question-about-vendor-listing#261711 "-- HikaShop version -- : 2.6.3 -- HikaMarket version -- : 1.7.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  i created a hikamarket vendor listing menu. MY problem is that it displays all users even do they have not posted anything. i think it has something to do with my setting to simplified registration with password and vendor automatic creation.  is there a way not to display vendors who just registered and has not actually posted anything? or maybe not to display vendors who has not completed certain fields?  thanks")*

Hi,

Your XML is malformed, the header contains special characters instead of classical double quotes for the version parameter : Code:

&lt;extension type="plugin" version=“2.5” method="upgrade" group="hikamarket"&gt;

Regards,

---

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

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

- **[ronron](/forum/user/40399-ronron "View ronron's Profile")**
- [![ronron's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/bad_baby.jpg)](/forum/user/40399-ronron "View ronron's Profile") Topic Author
- [ Offline](/forum/user/40399-ronron)

Less More

- Posts: 490
- Thank you received: 2
-
-

9 years 9 months ago [\#261836](#261836) by [ronron](/forum/user/40399-ronron "View ronron's Profile")  Replied by *[ronron](/forum/user/40399-ronron "View ronron's Profile")* on topic *[Question about vendor listing](/forum/23-market-how-to/888640-question-about-vendor-listing#261836 "-- HikaShop version -- : 2.6.3 -- HikaMarket version -- : 1.7.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  i created a hikamarket vendor listing menu. MY problem is that it displays all users even do they have not posted anything. i think it has something to do with my setting to simplified registration with password and vendor automatic creation.  is there a way not to display vendors who just registered and has not actually posted anything? or maybe not to display vendors who has not completed certain fields?  thanks")*

your right, thank you.

i got it to install but having this error
Code:

Unknown column 'vendor_products' in 'having clause' SQL=SELECT COUNT(vendor.vendor_id) FROM #__hikamarket_vendor AS vendor LEFT JOIN #__hikashop_product AS hkp ON hkp.product_vendor_id = vendor.vendor_id AND hkp.product_published = 1 and hkp.product_type = 'main' WHERE (vendor_published = 1) AND (vendor.vendor_id &gt; 1) HAVING vendor_products &gt; 0 ORDER BY vendor.vendor_id ASC

what could it be?

thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg4NjQwLXF1ZXN0aW9uLWFib3V0LXZlbmRvci1saXN0aW5nP3RtcGw9bWFya2Rvd24=) 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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

9 years 9 months ago [\#261839](#261839) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Question about vendor listing](/forum/23-market-how-to/888640-question-about-vendor-listing#261839 "-- HikaShop version -- : 2.6.3 -- HikaMarket version -- : 1.7.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  i created a hikamarket vendor listing menu. MY problem is that it displays all users even do they have not posted anything. i think it has something to do with my setting to simplified registration with password and vendor automatic creation.  is there a way not to display vendors who just registered and has not actually posted anything? or maybe not to display vendors who has not completed certain fields?  thanks")*

Hi,

Please replace the line Code:

$db-&gt;setQuery('SELECT COUNT(vendor.vendor_id) ' . $query);

By Code:

$db-&gt;setQuery('SELECT COUNT(vendor.vendor_id) FROM '.hikamarket::table('vendor').' AS vendor ' . $sql_joins . $filters);

So it will avoid the issue.

Regards,

---

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

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

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

- **[ronron](/forum/user/40399-ronron "View ronron's Profile")**
- [![ronron's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/bad_baby.jpg)](/forum/user/40399-ronron "View ronron's Profile") Topic Author
- [ Offline](/forum/user/40399-ronron)

Less More

- Posts: 490
- Thank you received: 2
-
-

9 years 9 months ago -  9 years 9 months ago [\#262090](#262090) by [ronron](/forum/user/40399-ronron "View ronron's Profile")  Replied by *[ronron](/forum/user/40399-ronron "View ronron's Profile")* on topic *[Question about vendor listing](/forum/23-market-how-to/888640-question-about-vendor-listing#262090 "-- HikaShop version -- : 2.6.3 -- HikaMarket version -- : 1.7.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  i created a hikamarket vendor listing menu. MY problem is that it displays all users even do they have not posted anything. i think it has something to do with my setting to simplified registration with password and vendor automatic creation.  is there a way not to display vendors who just registered and has not actually posted anything? or maybe not to display vendors who has not completed certain fields?  thanks")*

hi thanks jerome

the error is gone but no vendor is displaying even do vendors have products.
Code:

&lt;?php class plgHikamarketVendor_wproduct_only extends JPlugin { public function onBeforeVendorListingDisplay(&amp;$view, &amp;$sql_params) { $sql_params['join']['vendor_products'] = 'LEFT JOIN #__hikashop_product AS hkp ON hkp.product_vendor_id = vendor.vendor_id AND hkp.product_published = 1 and hkp.product_type = \'main\''; $sql_params['select']['vendor_products'] = 'COUNT(hkp.product_id) AS vendor_products'; $sql_params['having']['vendor_products'] = 'vendor_products &gt; 0'; } }

thanks so much

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg4NjQwLXF1ZXN0aW9uLWFib3V0LXZlbmRvci1saXN0aW5nP3RtcGw9bWFya2Rvd24=) 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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

9 years 9 months ago [\#262142](#262142) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Question about vendor listing](/forum/23-market-how-to/888640-question-about-vendor-listing#262142 "-- HikaShop version -- : 2.6.3 -- HikaMarket version -- : 1.7.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  i created a hikamarket vendor listing menu. MY problem is that it displays all users even do they have not posted anything. i think it has something to do with my setting to simplified registration with password and vendor automatic creation.  is there a way not to display vendors who just registered and has not actually posted anything? or maybe not to display vendors who has not completed certain fields?  thanks")*

Hi,

I'm sorry but if I run the query in PHPMyAdmin Code:

SELECT vendor.*, COUNT(hkp.product_id) AS vendor_products FROM #__hikamarket_vendor AS vendor LEFT JOIN #__hikashop_product AS hkp ON hkp.product_vendor_id = vendor.vendor_id AND hkp.product_published = 1 and hkp.product_type = 'main' WHERE (vendor_published = 1) AND (vendor.vendor_id &gt; 1) HAVING vendor_products &gt; 0 ORDER BY vendor.vendor_id ASC

(and I replace "#_" by my joomla database prefix)
I right code my vendors with products.

So please check that query in your end and you can see to perform a display of the SQL query just before his processing to check that you're having the same content.

Regards,

---

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

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

- **[ronron](/forum/user/40399-ronron "View ronron's Profile")**
- [![ronron's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/bad_baby.jpg)](/forum/user/40399-ronron "View ronron's Profile") Topic Author
- [ Offline](/forum/user/40399-ronron)

Less More

- Posts: 490
- Thank you received: 2
-
-

9 years 9 months ago [\#262256](#262256) by [ronron](/forum/user/40399-ronron "View ronron's Profile")  Replied by *[ronron](/forum/user/40399-ronron "View ronron's Profile")* on topic *[Question about vendor listing](/forum/23-market-how-to/888640-question-about-vendor-listing#262256 "-- HikaShop version -- : 2.6.3 -- HikaMarket version -- : 1.7.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  i created a hikamarket vendor listing menu. MY problem is that it displays all users even do they have not posted anything. i think it has something to do with my setting to simplified registration with password and vendor automatic creation.  is there a way not to display vendors who just registered and has not actually posted anything? or maybe not to display vendors who has not completed certain fields?  thanks")*

hi thank you

i tested this but it only displayed one vendor. it shows the main vendor

i tried to change WHERE (vendor_published = 1) to WHERE (vendor_published = 0) just to test it and it displayed the first vendor that is unpublished.

i dont know if it makes sense but it always displays the first vendor in the table

i tried to change hkp.product_type = 'main' to hkp.product_type = 'main categories' because i changed my category from main to main category but it still displays the main vendor which happens to be the first vendor in the table. One difference from setting 'main' to 'main category' is the vendor_products. for 'main' = 28 for 'main category' = 0.

what else could i check?

thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg4NjQwLXF1ZXN0aW9uLWFib3V0LXZlbmRvci1saXN0aW5nP3RtcGw9bWFya2Rvd24=) 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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

9 years 9 months ago [\#262280](#262280) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Question about vendor listing](/forum/23-market-how-to/888640-question-about-vendor-listing#262280 "-- HikaShop version -- : 2.6.3 -- HikaMarket version -- : 1.7.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  i created a hikamarket vendor listing menu. MY problem is that it displays all users even do they have not posted anything. i think it has something to do with my setting to simplified registration with password and vendor automatic creation.  is there a way not to display vendors who just registered and has not actually posted anything? or maybe not to display vendors who has not completed certain fields?  thanks")*

Hi,

I'm sorry but I don't understand what you're trying to do.
In my side, the query is working perfectly and I got the list of published vendor with published products.

Regards,

---

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

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

- **[ronron](/forum/user/40399-ronron "View ronron's Profile")**
- [![ronron's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/bad_baby.jpg)](/forum/user/40399-ronron "View ronron's Profile") Topic Author
- [ Offline](/forum/user/40399-ronron)

Less More

- Posts: 490
- Thank you received: 2
-
-

9 years 9 months ago -  9 years 9 months ago [\#262523](#262523) by [ronron](/forum/user/40399-ronron "View ronron's Profile")  Replied by *[ronron](/forum/user/40399-ronron "View ronron's Profile")* on topic *[Question about vendor listing](/forum/23-market-how-to/888640-question-about-vendor-listing#262523 "-- HikaShop version -- : 2.6.3 -- HikaMarket version -- : 1.7.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  i created a hikamarket vendor listing menu. MY problem is that it displays all users even do they have not posted anything. i think it has something to do with my setting to simplified registration with password and vendor automatic creation.  is there a way not to display vendors who just registered and has not actually posted anything? or maybe not to display vendors who has not completed certain fields?  thanks")*

hi jerome

first of all thank you for your patience.

to make things clear please let me explain.

i changed the file components/com_hikamarket/views/vendormarket/view.html.php and it is attached here.
i created the plugin with the following codes

unfortunately its not working on my end.

it is only displaying one vendor

what i am requesting is to display vendors with products only

thanks

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg4NjQwLXF1ZXN0aW9uLWFib3V0LXZlbmRvci1saXN0aW5nP3RtcGw9bWFya2Rvd24=) 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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

9 years 9 months ago [\#262563](#262563) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Question about vendor listing](/forum/23-market-how-to/888640-question-about-vendor-listing#262563 "-- HikaShop version -- : 2.6.3 -- HikaMarket version -- : 1.7.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  i created a hikamarket vendor listing menu. MY problem is that it displays all users even do they have not posted anything. i think it has something to do with my setting to simplified registration with password and vendor automatic creation.  is there a way not to display vendors who just registered and has not actually posted anything? or maybe not to display vendors who has not completed certain fields?  thanks")*

Hi,

Try to perform a "group by" on the vendor id to avoid another kind of aggregation.
Code:

$order = ''; $having = array();

By Code:

$order = ''; $group_by = array(); $having = array();

Code:

'order_accept' =&gt; &amp;$orderingAccept, 'having' =&gt; &amp;$having

By Code:

'order_accept' =&gt; &amp;$orderingAccept, 'group_by' =&gt; &amp;$group_by, 'having' =&gt; &amp;$having

Code:

if(!empty($having)) $order = ' HAVING ' . implode(' AND ', $having) . $order;

By Code:

if(!empty($having)) $order = ' HAVING ' . implode(' AND ', $having) . $order; if(!empty($group_by)) $order = ' GROUP BY '.implode(', ', $group_by) . $order;

Then you will be able to push "vendor.vendor_id" in the group_by ; to get a query like that Code:

SELECT vendor.*, COUNT(hkp.product_id) AS vendor_products FROM #__hikamarket_vendor AS vendor LEFT JOIN #__hikashop_product AS hkp ON hkp.product_vendor_id = vendor.vendor_id AND hkp.product_published = 1 and hkp.product_type = 'main' WHERE (vendor_published = 1) AND (vendor.vendor_id &gt; 1) GROUP BY vendor.vendor_id HAVING vendor_products &gt; 0 ORDER BY vendor.vendor_id ASC

And it should display you more than one result entry.

Regards,

---

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

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

- **[ronron](/forum/user/40399-ronron "View ronron's Profile")**
- [![ronron's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/bad_baby.jpg)](/forum/user/40399-ronron "View ronron's Profile") Topic Author
- [ Offline](/forum/user/40399-ronron)

Less More

- Posts: 490
- Thank you received: 2
-
-

9 years 9 months ago [\#262862](#262862) by [ronron](/forum/user/40399-ronron "View ronron's Profile")  Replied by *[ronron](/forum/user/40399-ronron "View ronron's Profile")* on topic *[Question about vendor listing](/forum/23-market-how-to/888640-question-about-vendor-listing#262862 "-- HikaShop version -- : 2.6.3 -- HikaMarket version -- : 1.7.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  i created a hikamarket vendor listing menu. MY problem is that it displays all users even do they have not posted anything. i think it has something to do with my setting to simplified registration with password and vendor automatic creation.  is there a way not to display vendors who just registered and has not actually posted anything? or maybe not to display vendors who has not completed certain fields?  thanks")*

hi jerome,

again thank you

its working now but with a little bug. the plugin is now able to display all vendors that are with products. the only problem is when you choose to navigate using pagination.

when you use pagination and select the button to go to the last part of the record. what happens is everything or all records disappears.

please check this link [ link](http://www.mayari.com.ph/suppliers/view-suppliers)

i modified the plugin contents to this
Code:

&lt;?php /** * @package HikaMarket for Joomla! * @version 1.7.2 * @author Obsidev S.A.R.L. * @copyright (C) 2011-2016 OBSIDEV. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?&gt;&lt;?php class plgHikamarketVendor_wproduct_only extends JPlugin { public function onBeforeVendorListingDisplay(&amp;$view, &amp;$sql_params) { $sql_params['join']['vendor_products'] = 'LEFT JOIN #__hikashop_product AS hkp ON hkp.product_vendor_id = vendor.vendor_id AND hkp.product_published =1 AND hkp.product_type = \'main\''; $sql_params['select']['vendor_products'] = 'COUNT(hkp.product_id) AS vendor_products '; $sql_params['having']['vendor_products'] = 'vendor_products &gt; 0 '; $sql_params['group_by']['vendor_products'] = 'vendor.vendor_id'; }}

and the screenshot below

- [ ![Screenshot-click-this.png](/forum/attachment/36455) ](/forum/attachment/36455 "...click-this.png") [ ](/forum/attachment/36455?download=1 "...click-this.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg4NjQwLXF1ZXN0aW9uLWFib3V0LXZlbmRvci1saXN0aW5nP3RtcGw9bWFya2Rvd24=) 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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

9 years 9 months ago [\#262902](#262902) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Question about vendor listing](/forum/23-market-how-to/888640-question-about-vendor-listing#262902 "-- HikaShop version -- : 2.6.3 -- HikaMarket version -- : 1.7.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  i created a hikamarket vendor listing menu. MY problem is that it displays all users even do they have not posted anything. i think it has something to do with my setting to simplified registration with password and vendor automatic creation.  is there a way not to display vendors who just registered and has not actually posted anything? or maybe not to display vendors who has not completed certain fields?  thanks")*

Hi,

Sure the pagination cannot work properly because of : Code:

$db-&gt;setQuery('SELECT COUNT(vendor.vendor_id) FROM '.hikamarket::table('vendor').' AS vendor ' . $sql_joins . $filters);

Regards,

---

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

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

- **[ronron](/forum/user/40399-ronron "View ronron's Profile")**
- [![ronron's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/bad_baby.jpg)](/forum/user/40399-ronron "View ronron's Profile") Topic Author
- [ Offline](/forum/user/40399-ronron)

Less More

- Posts: 490
- Thank you received: 2
-
-

9 years 8 months ago [\#263485](#263485) by [ronron](/forum/user/40399-ronron "View ronron's Profile")  Replied by *[ronron](/forum/user/40399-ronron "View ronron's Profile")* on topic *[Question about vendor listing](/forum/23-market-how-to/888640-question-about-vendor-listing#263485 "-- HikaShop version -- : 2.6.3 -- HikaMarket version -- : 1.7.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  i created a hikamarket vendor listing menu. MY problem is that it displays all users even do they have not posted anything. i think it has something to do with my setting to simplified registration with password and vendor automatic creation.  is there a way not to display vendors who just registered and has not actually posted anything? or maybe not to display vendors who has not completed certain fields?  thanks")*

thank you jerome

i still cant get this to work.

can you tell me what the code should be?

i already tried to add $order but still dosnt work.
Code:

$db-&gt;setQuery('SELECT COUNT(vendor.vendor_id) FROM '.hikamarket::table('vendor').' AS vendor ' . $sql_joins . $filters . $order);

thank you for your patience.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg4NjQwLXF1ZXN0aW9uLWFib3V0LXZlbmRvci1saXN0aW5nP3RtcGw9bWFya2Rvd24=) 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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

9 years 8 months ago [\#263505](#263505) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Question about vendor listing](/forum/23-market-how-to/888640-question-about-vendor-listing#263505 "-- HikaShop version -- : 2.6.3 -- HikaMarket version -- : 1.7.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  i created a hikamarket vendor listing menu. MY problem is that it displays all users even do they have not posted anything. i think it has something to do with my setting to simplified registration with password and vendor automatic creation.  is there a way not to display vendors who just registered and has not actually posted anything? or maybe not to display vendors who has not completed certain fields?  thanks")*

Hi,

Like I wrote you, the pagination is handle by the query I mentioned.
That query do not include the filtering on the products, it does not have the "HAVING" clause and because the having need a value from the "select" and you can't add all "select" fields to perform the "count" ; we got a situation.

If you find a solution to perform a query without needed the "HAVING" clause but just with a "INNER JOIN" (and maybe a sub queyr), it would do the trick.

By I'm afraid that I can't modify more HikaMarket and I think that I'll remove the "having" support due to the issue with the pagination.

Regards,

---

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODg4NjQwLXF1ZXN0aW9uLWFib3V0LXZlbmRvci1saXN0aW5nP3RtcGw9bWFya2Rvd24=) 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.106 seconds

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