Show Vendor Store Link Only If They Have A Plan That Allows It?

How can one show a link to a vendor store only if that vendor has a plan that allows vendors to have a store..? thanks

for example:

{if !$vendor store = 'Y'}

vendor name

{/if}

Hello

First, you need to check what the vendor's plan is
$plan_id = db_get_field("SELECT plan_id FROM ?:companies WHERE company_id = ?i", $company_id);
Next, you need to check whether the checkbox vendor_store is checked in the plan.
$vendor_store = db_get_field("SELECT vendor_store FROM ?:vendor_plans WHERE plan_id = ?i", $plan_id);

And then you can use your condition.

Best regards

Robert

Thanks for the quick response i will implement this and let you know, do you know if this kind of approach will work if a user add product in wishlist to hide the wishlist button and cart too..

How can one show a link to a vendor store only if that vendor has a plan that allows vendors to have a store..? thanks

I use an add-on to show all vendor groups along with the customer and administrator groups, allowing to create specific blocks for each group.

Hello

First, you need to check what the vendor's plan is
$plan_id = db_get_field("SELECT plan_id FROM ?:companies WHERE company_id = ?i", $company_id);
Next, you need to check whether the checkbox vendor_store is checked in the plan.
$vendor_store = db_get_field("SELECT vendor_store FROM ?:vendor_plans WHERE plan_id = ?i", $plan_id);

And then you can use your condition.

Best regards

Robert

I did this but it didn't work, can you explain how i should add the code and the condition?

Thanks

I use an add-on to show all vendor groups along with the customer and administrator groups, allowing to create specific blocks for each group.

Thanks for the response, but what i want to achieve i to hide the store link on the product page if the vendor doesn't have a store.

Thanks for the response, but what i want to achieve i to hide the store link on the product page if the vendor doesn't have a store.

This is precisely the action of this addon. It shows the block with the link to vendor.php only to registered members who happen to be Gold Vendor, Silver Vendor, etc. - see what is checked/ticked.

Hello

I did this but it didn't work, can you explain how i should add the code and the condition?

Thanks

You must prepare function e.g. in my_changes and reference it in the template.

Best regards

Robert

I tried to assign with smarty function still didn't work for individual vendors
function smarty_function_seller_store($params, &$smarty) {
$vendor_store = db_get_field("SELECT vendor_store FROM ?:vendor_plans WHERE plan_id = ?i", $plan_id);
if( empty($vendor_store) ) {
$smarty->assign('is_store', false);
} else {
$smarty->assign('is_store', true);
}
}

Hello

How do I understand you want to do this on the home page?
You must have access to the company_id, i.e. to the vendor id.
next:
{assign var = "vendor_store" value = $company_id|smarty_function_seller_store}
(Above you must substitute the appropriate variable that contains the company_id)
function smarty_function_seller_store ($company_id) {
$plan_id = db_get_field ("SELECT plan_id FROM ?:companies WHERE company_id = ?i", $company_id);
$vendor_store = db_get_field ("SELECT vendor_store FROM?: vendor_plans WHERE plan_id = ?i", $plan_id);
return $ vendor_store;
}
In template
{if! $vendor store}
{/if}