| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Pro: Global "Extra Fields" that all Providers see. | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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:
3. Third, you must simply add some code towards the end of that line to look like this: Code:
**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 |
|||||||
#2
|
|||||||
|
|||||||
Nice one! Quite a few people have asked for this. Thanks for taking the time to work it out!
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||
|
|||||||
Thanks but no thanks...
Actually that's an elegant hack. I liked it and used it but ran into problem #2 so hopefully through our teamwork we can provide a full solution.
Yes your solution makes extras global and visible, but try including any of these global extra fields in an imported csv and it fails. The import function will not find the global and will simply recreate the provider specific extra field to correspond to the data it is trying to push. It is necessary to modify the following: file: /cart/provider/import.php Search for #set extra_fields and it takes to around line 1049 (4.0.16) make the following adjustment to the query that pulls valid extra_fields based on the label: replace $tmp_provider_condition... normally it represents " AND provider='$login'" it should be " AND (provider='$login' OR provider='root')" assuming you have a root login provider creating global extra fields... [/code]
__________________
Jacob Gorny E-commerce Lead, Applications Developer Greek Orthodox Archdiocese Running X-Cart Pro 4.1.10 RHEL5 | Apache 2.2.8 | PHP 5.2.6 |
|||||||
#4
|
|||||||
|
|||||||
Thanks but no thanks...
Actually that's an elegant hack. I liked it and used it but ran into problem #2 so hopefully through our teamwork we can provide a full solution.
Yes your solution makes extras global and visible, but try including any of these global extra fields in an imported csv and it fails. The import function will not find the global and will simply recreate the provider specific extra field to correspond to the data it is trying to push. It is necessary to modify the following: file: /cart/provider/import.php Search for #set extra_fields and it takes to around line 1049 (4.0.16) make the following adjustment to the query that pulls valid extra_fields based on the label: replace $tmp_provider_condition... normally it represents " AND provider='$login'" it should be " AND (provider='$login' OR provider='root')" assuming you have a root login provider creating global extra fields...
__________________
Jacob Gorny E-commerce Lead, Applications Developer Greek Orthodox Archdiocese Running X-Cart Pro 4.1.10 RHEL5 | Apache 2.2.8 | PHP 5.2.6 |
|||||||
#5
|
|||||||
|
|||||||
Re: Pro: Global "Extra Fields" that all Providers see.
Jacob,
When you tried this, did it show up in other providers other than root? For me, it won't show up in providers other than root. Code:
__________________
X-Cart - 4.1.7 PRO PHP - 4.4.4 MySQL 5.0.27 Apache 1.3.37 Linux |
|||||||
|
|||
X-Cart forums © 2001-2020
|