View Single Post
  #1  
Old 05-18-2005, 12:51 AM
 
IndieDepot IndieDepot is offline
 

Advanced Member
  
Join Date: May 2005
Posts: 30
 

Default Pro: Global "Extra Fields" that all Providers see.

I asked around and got no help, so I looked into doing this myself. I am no PHP programmer, but I know enough to get a few things like I need by looking at other stuff and seeing how it works.

I needed to make my stores Root Provider be able to add Extra Fields so that ALL my regular Providers will be able to see them in their add/modify product form.

This simple mod does not affect the functionality of each regular providers Extra Fields capabilities, and they can add their own set of extra fields ON TOP of the Global Extra Fields created by the Root Provider...

1. First you must make a Root Provider account. let's call it 'root'.

2. Second you must open the ./x-cart/Extra_Fields/extra_fields.php file and go to line 39:

Code:
$provider_condition = ($single_mode?"":" AND $sql_tbl[extra_fields].provider='$extra_fields_provider'");

3. Third, you must simply add some code towards the end of that line to look like this:

Code:
$provider_condition = ($single_mode?"":" AND $sql_tbl[extra_fields].provider='$extra_fields_provider' OR $sql_tbl[extra_fields].provider='root'");

**notice I had to put the account username 'root' in the code towards the end. You can substitute this name for whatever the username of your Root Provider is.

That's it.

Now all your Providers will see the Extra fields created by your Root Provider, and they will display on the product profile in the store.

enjoy...

- Shannon
__________________
- www.TheShotList.com
X-Cart version 4.0.13
PHP 4.3.10
MySQL 4.0.23
Web server Apache
Operation system Linux
Perl 5.008004
XML parser (expat) 1.95.6
Reply With Quote