X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   List vendor products from another vendor account (https://forum.x-cart.com/showthread.php?t=76520)

amarquis 09-10-2018 06:19 AM

List vendor products from another vendor account
 
I am on Multivendor 5.3.5.5

If I do the following, in the admin area:

PHP Code:

$products = \XLite\Core\Database::getRepo('XLite\Model\Product')->findAll(); 


when logged in with an Administrator account, all products are listed.

If I do the same, logged in with a vendor account, only the current vendor products are listed.

How would I go about listing ALL products from a vendor account, including other vendors' products?

cflsystems 09-10-2018 06:49 AM

Re: List vendor products from another vendor account
 
Why would you want to do this? It completely defeats the purpose of multivendor

amarquis 09-10-2018 10:36 PM

Re: List vendor products from another vendor account
 
I am not asking whether you like the idea or not. This is my use case. I need a view, somewhere in the admin area, where a specific vendor role, can list (display) products from other vendors. Full stop. Can it be done? And if yes, how?

cflsystems 09-11-2018 05:03 AM

Re: List vendor products from another vendor account
 
Sure it can be done. Look in the vendor module and override where it restricts the return of search results.
It could be in the model it could be in the conditions send by the view you are looking at.
This is not a simple "go here and change this" answer

amarquis 09-11-2018 05:27 AM

Re: List vendor products from another vendor account
 
As I am using QueryBuilder to retrieve the products, the simple "go here and change this" answer in my case was to decorate \XLite\Model\Repo\Product and set $enableVendorCondition to FALSE.


All times are GMT -8. The time now is 08:01 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.