Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Display Links By Vendor Plan Rate Topic   - - - - -

 
  • pepo1
  • Advanced Member
  • Members
  • Join Date: 23-Jun 17
  • 85 posts

Posted 22 August 2017 - 07:44 AM #1

Is there a simple way to display content according to the vendor plan?

 

Something like:

{if $auth.user_type == 'V' && vendor_plan == 'Gold'}
   display content
{/if}



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21914 posts

Posted 22 August 2017 - 10:23 AM #2

Do you want to display it in the vendor store or all pages?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • pepo1
  • Advanced Member
  • Members
  • Join Date: 23-Jun 17
  • 85 posts

Posted 27 August 2017 - 10:21 AM #3

Do you want to display it in the vendor store or all pages?

The content should be viewable for logged-in vendors according to their plan, so I guess anywhere. If it's only possible in their store, then I'll accept that.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21914 posts

Posted 28 August 2017 - 07:24 AM #4

You can use the following code on the vendor store page

{if $auth.user_type == 'V'}
    {$company_data = $smarty.request.company_id|fn_get_company_data}
    {if $company_data.plan_id == 123}
        display content
    {/if}
{/if}

where 123 - is the ID of the required plan


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • shanower
  • Advanced Member
  • Members
  • Join Date: 27-Jul 19
  • 67 posts

Posted 26 May 2021 - 03:47 AM #5

Do you know how to get the current plan id of the vendor inside a tpl file or using smarty?

 

I tried your code to create a condition based on vendor plan inside the product creation page (update.tpl) but couldnt make it work.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21914 posts

Posted 26 May 2021 - 06:31 AM #6

The code should work. Have you cleared cache after the changes were applied?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • shanower
  • Advanced Member
  • Members
  • Join Date: 27-Jul 19
  • 67 posts

Posted 26 May 2021 - 12:54 PM #7

Yes, I cleared the cache, but seems not to be working.

 

I am trying to modify the following file:

 

design/backend/templates/addons/my_changes/overrides/views/products/update.tpl

 

All my others changes in this file are working, except the code to check vendor plan. I tried to print the variable to check what information is being generated and for all vendors the value returned is 1, independently of their vendor plan.



 
  • shanower
  • Advanced Member
  • Members
  • Join Date: 27-Jul 19
  • 67 posts

Posted 26 May 2021 - 01:16 PM #8

I tried to check the variable with {$company_data.plan_id|@print_r} and result is always 1 even with vendor from different plans.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21914 posts

Posted 26 May 2021 - 01:20 PM #9

For the update product page please try

{$company_data = $product_data.company_id|fn_get_company_data}

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)