Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 04-30-2012 17:52:35

Jamesg
Member
Registered: 08-15-2011
Posts: 21

Custom Field

Hi,
I have added a column to the ecom.prod table and managed to get the field to show in the 'Relationships' section of the products admin panel.
My description is there along with a text box but it will only let me input one digit.
Any idea how to fix this?

Also the related categories box has a list of categories with checkboxes next to them. Is it possible for me to do this and get the list with checkboxes from a column in another table?

Kind Regards
James

Offline

 

#2 05-01-2012 09:51:54

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Custom Field

First question is what is your goal for this new field of information?

What other table are you wanting to show up in the categories area?
Where would you be using this informaion?
This would require a modification to core scripts.

If you want to change the behavior of the new field at this point you will have to go to the core_columndefs database table, browse that table and find your new entry for the ecom_prod database, it will look like ecom_prod.new_table_name, find the cnumeric field and insert the number of characters you want that field to handle ( this is because when you created the new column you didn't give the correct character number or text count you want for the field). If you want to change the type of field this is (example from a text box to check box) then you will need to edit two columns, these are cinsdisplaytype and cupddisplaytype (checkbox entry would look like CHECKBOX-TABLE). One field controls the Raw Database Admin view (known as the core side of admin) and the other controls the view from the ecom side of admin like when you view the product thru the System Dashboard > Store > Catalog > Products page(s). A wrong entry into either of these field will cause that display to crash or not be produced, there is a specific list of except able entries that these fields can hold, the ones you can see if you browse thru the table at the other entries for these fields. A field type of SELECT-CUSTOM will require entries in the core_selectcustom database table for that field name or it will also cause an error and not generate a display. So in short if you make an edit to either of these fields and then you can not see the product edit screen in either Raw Database Admin or thru System Dashboard > Store > Catalog > Products then you need to check what you have entered into one of these fields.

Now comes the really bad news which connects back to the first question. Any new database table or column added to a table will not be acted upon by ccp with out minor or major modification to the some core scripts or the creation of a new class or script(s) that look for and work with that information, so where back to question one what are you wanting to do.?

John

Offline

 

#3 05-01-2012 10:27:13

Jamesg
Member
Registered: 08-15-2011
Posts: 21

Re: Custom Field

Hi Many thanks for your detailed reply.
I am trying to learn the software to add modifications myself to see if i can get the store running. I have a quote from custom shop to do some work but until my online store is running i cannot invest the amount of money that has been quoted. i will need to have custom coding done but once the 'basics' if i can call it that are done.
I am happy to write php code and sql but the hard thing i am finding is reversing the code to find out which files i need to modify.
For example what file creates the database connections for various tables. I am happy to spend time on working things out but any help i can get about the file structure here would speed things up for me.

Initially i have  created a new table and added a column to the product table which associates a product with a row from my new table. I can then write php scripts to display the products depending on info from my new table. ideally but not 100% necessary i would like to add checkboxes to the new admin input on the product add /edit page which would i could then select from a column name from the new table. I need to find out which files i need to edit to tell ccp i have added a new table. once i understand this i would be in a better position to write more code.


Cheers
James

Offline

 

#4 05-01-2012 12:18:55

Jimjay
Member
Registered: 04-28-2012
Posts: 11

Re: Custom Field

Been thinking about this a bit more.
My initial requirement is to have two sets of categories. So I can display one or the other oR both on the splash and category pages.
I think it might be easier to do the following, what are your views on the complexity of this.
Ie
Category set 1 & category set 2

If I create a new column in the category table say called 'set' and then allocate a set name 1 or 2 for each category

Clone a category display but change the code to display

Heading: Category 1
Show categories where 'set' = category 1

Heading: category 2
Show categories where 'set ' = category 2

Your thoughts here are appreciated. Would I need to change core code?
Thanks
James

Last edited by Jimjay (05-01-2012 12:19:25)

Offline

 

#5 05-24-2012 14:40:14

Jamesg
Member
Registered: 08-15-2011
Posts: 21

Re: Custom Field

Hi there,
I have added a custom field and changed the input type to SELECT-TABLE this has worked fine.
I am currently using the data - - SELECT {COLS} FROM ecom_cat WHERE cattype='1'

Now when i go to the custom field on the add/edit product page i have a drop down box which is great.
It has the first two columns from the database ecom_cat
i would like it to just show the 'id' column of ecom_cat but am baffled by how i can get it to do this.
i have tried numerous ways like -- SELECT id from ecom_cat
but doing this just throws an error and won't load the screen.
Any help greatly appreciated.
Thanks

Offline

 

#6 05-29-2012 07:55:44

Jamesg
Member
Registered: 08-15-2011
Posts: 21

Re: Custom Field

bump

Offline

 

#7 07-05-2012 09:40:06

jj1987
Member
From: Orlando, FL
Registered: 07-14-2008
Posts: 502
Website

Re: Custom Field

Jamesg wrote:

bump

CORE_Form.php is where these are generated, look at this function for an idea on how it works-

Code:

function build_values_table ($id = '', $param = '') {

Since "tdisplay" is set to     id, name for ecom_cat, the system is returning the id and name.  You could edit this, but it would obviously mess up what's shown elsewhere in the system when you pull up categories.

Last edited by jj1987 (07-05-2012 09:40:35)



-James Garrett

Offline

 

Board footer