Jump to content

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

Vendor Administration: Customized Menu Rate Topic   - - - - -

 
  • hipe
  • Member
  • Members
  • Join Date: 17-Apr 14
  • 28 posts

Posted 24 June 2014 - 07:39 PM #1

Dear all,

I would like hide some of the menu items for vendors. Anybody an idea how & where to do that?

I found a hint in here...

http://forum.cs-cart...add-categories/

But I want to hide additional items like features, filters, options below the products menu item

products.jpg

I want to hide the Website menu

website.jpg

Additionally I want to remove some of the admin stuff for vendors

admin.jpg

design.jpg

Regards

Jan

 
  • ilib
  • Advanced Member
  • Members
  • Join Date: 22-Mar 12
  • 85 posts

Posted 24 June 2014 - 08:27 PM #2

(on v4.x.x) you can just modify app/schemas/menu/menu_multivendor.php this way:

on the bottom before return $schema; add these lines:

if (Registry::get('runtime.company_id')) {
	$schema['central']['website'] = array();
	$schema['central']['products']['categories'] = array();
	$schema['central']['products']['features'] = array();
	$schema['central']['products']['filters'] = array();
	$schema['central']['products']['options'] = array();
	$schema['top']['administration']['items']['shippings_taxes'] = array();
	$schema['top']['administration']['items']['currencies'] = array();
}

But if you want to make it right you need to activate my_changes addon and add a path schema/menu then create new file menu.post.php there and add these lines and return $schema; into it

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10667 posts

Posted 25 June 2014 - 05:52 AM #3

Unfortunately I believe the schema is cached. So having it inside a condition requiring the company_id to be set could make it never show up (or always be present depending on when the cache was built and what user was active when the cache was built). Many of these things are controlled via permissions in admin groups....

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


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

Posted 25 June 2014 - 07:52 AM #4

Unfortunately I believe the schema is cached. So having it inside a condition requiring the company_id to be set could make it never show up (or always be present depending on when the cache was built and what user was active when the cache was built). Many of these things are controlled via permissions in admin groups....


Similiar checking is used in default menu_multivendor.php file. So I beleive that the solution proposed by ilib will work.

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    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10667 posts

Posted 25 June 2014 - 05:07 PM #5

Quite possible. Not sure of what's changed in the caching in V4. In prior versions, $schema was cached and the schema files were not read at runtime. But maybe they're now caching the php versus the resulting data array?

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • hipe
  • Member
  • Members
  • Join Date: 17-Apr 14
  • 28 posts

Posted 30 June 2014 - 10:39 AM #6

Dear ilib,

sorry for the delay & thank you very much for your directions. It almost works perfectly :grin:

I ammended the code a little (w/o using my changes):

$schema['central']['website']['items']['content']= array();
  $schema['central']['website']['items']['news']= array();
		$schema['central']['products']['items']['categories'] = array();
		$schema['central']['products']['items']['features'] = array();
		$schema['central']['products']['items']['filters'] = array();
		$schema['central']['products']['items']['options'] = array();
		$schema['top']['administration']['items']['shippings_taxes'] = array();
		$schema['top']['administration']['items']['currencies'] = array();
  $schema['top']['design']['items']['file_editor'] = array();

...works nearly perfect...just the bloody "Website --> News" menu item still appears. I figured out that this is an add on using a menu.post.php file.

Next idea:
Usage my changes add-on - might be the case that the menu.post.php within the my changes add-on is processed after the menu.post.php of the "News" add-on. In that case the "Website --> News" should not appear anymore.

Unfortunately it is not working when I use the my changes add on (it is active)...

I added added the following folder & file:

app\addons\my_changes\schemas\menu\menu.post.php

including the following coding and the menu does not change at all.....anybody an idea?

<?php
/***************************************************************************
*																		  *
*   (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev	*
*																		  *
* This  is  commercial  software,  only  users  who have purchased a valid *
* license  and  accept  to the terms of the  License Agreement can install *
* and use this program.													*
*																		  *
****************************************************************************
* PLEASE READ THE FULL TEXT  OF THE SOFTWARE  LICENSE   AGREEMENT  IN  THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.			*
****************************************************************************/
use Tygh\Registry;
if (Registry::get('runtime.company_id')) {
		$schema['central']['website']['items']['content']= array();
  $schema['central']['website']['items']['news']= array();
		$schema['central']['products']['items']['categories'] = array();
		$schema['central']['products']['items']['features'] = array();
		$schema['central']['products']['items']['filters'] = array();
		$schema['central']['products']['items']['options'] = array();
		$schema['top']['administration']['items']['shippings_taxes'] = array();
		$schema['top']['administration']['items']['currencies'] = array();
  $schema['top']['design']['items']['file_editor'] = array();
}
return $schema;


 
  • hipe
  • Member
  • Members
  • Join Date: 17-Apr 14
  • 28 posts

Posted 30 June 2014 - 12:42 PM #7

I have got a solution.....at least one without my changes....I included

if (Registry::get('runtime.company_id')) {
	    $schema['central']['website']['items']['news']= array();
[size=4]};
[/size]

into the menu.post.php of the news add-on.

In case anbody knows, why my my changes add on is not working, I would be glad hearing from you.

Kind regards

Jan

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

Posted 30 June 2014 - 02:45 PM #8

In case anbody knows, why my my changes add on is not working, I would be glad hearing from you.


1. Make sure that the add-on is installed
2. Make sure that the add-on status is active
3. Make sure that the path to menu.post.php is correct
4. Clear the cache

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    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • hipe
  • Member
  • Members
  • Join Date: 17-Apr 14
  • 28 posts

Posted 30 June 2014 - 06:12 PM #9

Thanks...cleared the cache & it worked with the my changes add-on...for the other newbies here....cache is cleared in

Administration --> Storage --> Clear cache

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10667 posts

Posted 30 June 2014 - 08:20 PM #10

So as I stated originally, that the addon schema files are cached and using conditional code is only going to be good for the context that is active when the cache is rebuilt. I misunderstood originally that you were modifying the files in app/schema versus the addon directories.

Hence you may not always have consistent results.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • hipe
  • Member
  • Members
  • Join Date: 17-Apr 14
  • 28 posts

Posted 01 July 2014 - 06:19 AM #11

Hi tbirnseth,

I have no idea about that cache stuff....if I now keep it as ist is (within the my changes add-on), the cache should always consider it? Or not?

Kind regards

Jan

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

Posted 01 July 2014 - 07:42 AM #12

I have no idea about that cache stuff....[size=4]if I now keep it as ist is (within the my changes add-on), the cache should always consider it? Or not?


I am not sure, but it looks like the system uses different menu cache for admins and vendor admins. You cleared the cahce and store generated two versions of the menu.

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    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10667 posts

Posted 01 July 2014 - 06:14 PM #13

I'm not sure on the MVE front either.... But if a customer comes in to a storefront and the cache was cleared. It will be rebuilt in the context of the customer, not a vendor nor an admin. So if the info is cached, it will be cached in the context in which it was built.

YOu'll just have to try it and watch results.... Like most customers, if it's wrong, it won't take long for you to hear about it... :-)

tony

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • almondjjoy
  • Member
  • Members
  • Join Date: 27-Feb 10
  • 170 posts

Posted 08 July 2014 - 05:45 AM #14

Wish there were just an easy disable button to remove the listings suggested above for those of us who don't really understand the coding stuff.

 
  • csca
  • Junior Member
  • Trial users
  • Join Date: 28-Jan 11
  • 28 posts

Posted 18 September 2014 - 04:19 PM #15

how can we disable the following items from user menu?
Events
Downloads
Order Tracking

thanks

 
  • screenimages
  • Senior Member
  • Members
  • Join Date: 17-Jul 14
  • 154 posts

Posted 20 September 2014 - 03:59 PM #16

We hid most of these items using css rules. It's certainly less destructive, and easier to put back after the fact.

 
  • csca
  • Junior Member
  • Trial users
  • Join Date: 28-Jan 11
  • 28 posts

Posted 20 September 2014 - 05:20 PM #17

how to do it? what happens when the direct link to those menu items is accessed by those who know cs-cart?

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

Posted 22 September 2014 - 07:27 AM #18

how can we disable the following items from user menu?
Events
Downloads
Order Tracking


Not use that CS-Cart version you use. For the first point, disable the Gift Registry add-on, for the rest ones correct the following template:

design/themes/THEME_NAME/templates/blocks/my_account.tpl

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    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10667 posts

Posted 22 September 2014 - 08:28 PM #19

Suggest you do it via css versus editing the templates so you do not end up with future upgrade conflicts.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • csca
  • Junior Member
  • Trial users
  • Join Date: 28-Jan 11
  • 28 posts

Posted 23 September 2014 - 10:25 PM #20

how to do in css?

what would happen is someone tries to access the downloads by entering the url? by others familiar with cs-cart who know the link to downloads?