How To Create Conditions Based On Vendor Plan

I read the CS Cart documentation and couldnt find any information about how to create a PHP condition that check if a vendor belong to a vendor plan.

I am building a marketplace where vendors will have some products fields available based in their vendor plan. I know to hide these fields if the user is a vendor (as in this topic: https://forum.cs-cart.com/topic/52886-hide-some-fields-from-vendors/)but how if they user is a vendor and belong to a specific vendor plan?

Try something like

if ($company_data['plan_id'] == '123') {
    ....
}

where 123 - is the ID of the plan

Hover over the Edit link on the Vendor plans page to find plan ID

https://prnt.sc/1329nrz

I tried the code, but I am receiving a error of

Undefined variable: company_data

I trying to hide a tab from product management based on vendor plan, using a my_change under /home/devdungeonist/public_html/app/addons/my_changes/controllers/backend/products.post.php but couldnt figure out yet how can I get the company_data variable?

The code is simple:

use Tygh\Addons\VendorPlans\ServiceProvider;
use Tygh\Enum\ProfileTypes;
use Tygh\Enum\SiteArea;
use Tygh\Enum\VendorPayoutTypes;
use Tygh\Enum\VendorStatuses;
use Tygh\Languages\Languages;
use Tygh\Models\Company;
use Tygh\Models\VendorPlan;
use Tygh\Registry;
use Tygh\Tygh;
use Tygh\VendorPayouts;
use Tygh\Enum\YesNo;
use Tygh\Settings;

if ( $company_data[‘plan_id’] == ‘2’) {

}

After some attempts I found a solution. Here is the final solution:

use Tygh\Addons\VendorPlans\ServiceProvider;
use Tygh\Enum\ProfileTypes;
use Tygh\Enum\SiteArea;
use Tygh\Enum\VendorPayoutTypes;
use Tygh\Enum\VendorStatuses;
use Tygh\Languages\Languages;
use Tygh\Models\Company;
use Tygh\Models\VendorPlan;
use Tygh\Registry;
use Tygh\Tygh;
use Tygh\VendorPayouts;
use Tygh\Enum\YesNo;
use Tygh\Settings;

/* For Vendor with Sales Plan Equal 1 */

$current_vendor_id = Registry::get(‘runtime.company_id’);

$current_vendor_plan = fn_vendor_plans_get_vendor_plan_by_company_id ($current_vendor_id);

if ($mode == ‘add’ && $current_vendor_plan[‘plan_id’] == ‘1’) {

/* Add what will happens if Vendor Plan match */

} elseif ($mode == ‘update’ && $current_vendor_plan[‘plan_id’] == ‘1’) {

 /* Add what will happens if Vendor Plan match */

}