chrometweaks.org

How do I remove a Wix connected site from my iPage domain hosting?

Click Here To View All Answers...


My question is How do I remove a Wix connected site from my iPage domain hosting? Hoping for any answer or 2. Another question on my mind: 1 mistake in instuctions above SECTION.

3.c - Furthur down the page.

The last box in that section shows a referance too.

Case 'MY_NEW_FIELD':.

< thats not meant to be there, so dont copy that part..

Chow!..

Comments (67)

I'm stumped. I'm not so sure what is the answer. I'll do some Googling and get back to you if I bump into an anything. You should email the people at iPage as they probably could assist you..

Comment #1

Thanks Lee, I'm giving it a whirl....

In the mean time, any idea what would cause my product listing to show "buy now" several times, all messed up? It happens both with SEC 1.0b's product_listing.php and the un-modified 5-18 version of the file. I posted the problem in the following thread....

Http://forums.oscommerce.com/viewtopic.php...6568&highlight;=.

And my iPage site is at:.

Http://www.frozenlig...log/default.php.

Thanks!.

-al..

Comment #2

Hi halbert,.

What a mess ay?,.

I havent used SEC at all, so I cant comment there, the error could be in /default.php have you tried replacing that with a standard MS1 2.2 release > just something to try. and also try un-modified 5-18 product_listing.php again with that..

It looks like /default.php is responsible did you mess with any code there when you installed SEC ? .

I've never seen.

Display Add Multiple Columns?.

So I gues it's part of SEC, looks to me it's doing what it's meant too > only all 1 column LOL,.

In your admin/ > configuration > product listing, you have really high values assigned to your sorting, any reason for that..

22, 10, 20, 30, 40 mine range under the < 10's like 1,2,3,4,5 ect.. might be something to look at, also make sure none share the same value like.

Buy It Now Column = 5 and Price Column = 5 as they can and will cancell each other out, thats whats going on with the other fellow at the top of that post you mentioned - he assigned all number 1's to his product listings -> this means all columns are fighting to be displayed at position one, thus conflict...

See how you go...

Cheers Lee..

Comment #3

Hi halbert,.

If you cant fix the buy it now column problem, send me copies of your /default.php and modules/product_listing.php I will have a quick look at them to see if I can find any problems..

Cheers Lee..

Comment #4

Just finished putting in your code for displaying extra columns and it works!.

I haven't tried putting an old version of default.php back in... that's the next step. I might have messed it up but I think it started on it's own it was working fine one minute, and then it started doing that mess. And I hadn't even touched the code!.

The values I use are so that I can easily change the sort order without having to renumber everything. It's so if I want to add or re-arrange something I have some numbers in between the existing ones that will work for the sorting..

When I figure this out, I'll be sure to post it!.

Thanks again for the very thorough instructions for the product listing!.

-al..

Comment #5

Okay, I think I figured out what was happening there....

The code was written (in default.php) to display the number of columns as defined in the array $define_list. When I was playing around I added a few extra items to this array without following through for all the other items... and hence OSC had a little fit and did strange things because it was trying to complete it's loop without having the proper routines. I'm not quite sure why it picks up the last field displayed and shows it over and over, but that's what it does..

Moral of the story: don't add more items to the $define_list array than you intend to use, or you'll get the extra garbage in your product listing..

Everything you didn't want to learn about OSC but were forced to find out! :wink:.

-al..

Comment #6

Good stuff al,.

Looks better then yesterday, I never has a chance to look at the code, Im flatout trying to finish this contibution, all the code is complete but I need the write install instructions.. bugga..

Anyway good to see columns alright..

Cheers Lee..

Comment #7

Hi,.

Its fun to see how to add fields !!!.

But I do not understand how to add the search option,.

Exsample :.

Advanced Search, I want to add the field isbn and want to search on only this field,.

I have add it in products_info and I can see it, only the search option is missing what to do ??.

I can't find a answer to this any where (still newbie).

Hopefully you are able to help !!.

Thanks !!.

Lighthouse..

Comment #8

Hi Lighthouse,.

Its not to hard getting this in the search, but as for making it an option like a tick box I dont really know yet - havent tried...

I will post some code on getting custom fields into the database search tommorow...

Cheers Lee..

Comment #9

Hi maxiDVD,.

Nice to hear it's posible, maybe you din't know it all but I want to start some where, me by if I have start if van find out de rest:).

But can you tel me how to start , say.

But for me it's still imposible so plz can you tel me how to do it? or is it writen some where?.

It would be very helpfull start with..

I am happy with everything that helps me start..

:oops: plz :oops: (still newbie in this stuff).

Thanks anyway!!.

Lighthouse..

Comment #10

Open catalog/advanced/search_result.php.

Aprox Line: 223.

FIND:.

If (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%"addslashes($search_keywords[$i])"%'.

Or p.products_isbn like '%"addslashes($search_keywords[$i])"%'.

Or p.products_newfield_name_1 like '%"addslashes($search_keywords[$i])"%'.

Or p.products_newfield_name_2 like '%"addslashes($search_keywords[$i])"%'";.

Add the new field names you want searched under it..

Cheers Lee..

Comment #11

Thanks maxDVD it real.

Works, it's one think is keeping me busy, you places it in description.

What do I have to do to place it out side the description, it's not necessary to by able to select it. I just want to find it out side the discription. that way it wil by found form the main site.

By the way if I add this in discription he while find it but is not able to go to the products he found, I think that I am need a little more code somewehre !.

Lighthouse..

Comment #12

Gata,.

I also want to get a bookstore up. But I'm more lost than you. Is what you are doing working? Do you have a list of where to make changes? Why don't you put in categories? I want categories: kids, literature, health etc... I guess that means that we need a category field in the database too. I don't remember from your original post, do you use easypoppulate? I want to use it if I can..

I'd love to keep on exchanging progress reports with you about getting up a bookstore. Best, Frank..

Comment #13

Hi,.

If you want to use categories it's easy it's buildin, but if you want to use new fields it's easy to create them with.

Http://www.oscommerc...tributions,1158.

, but if you want to search on only the new feilds it stops you can do it the way show above but it's not the way I want it..

In a bookstore you want to search on a writer or book nummber or publisher, but this is just easy don I can't find it, but I have stop active working for the momment to work on the layout. People are able to find wath they are looking for I think, so I need to change the layout, but I wil keep searching on the search topic. I will change it after I gone live..

If you find somthink out let me know, if you want to know more ask.

(or thake a look on the main shop, I do the testing on a other shop).

Lighthouse..

Comment #14

Light house , the contrib you give the link is from the maxidvd work or another thread ? if yes , can you give me the link ? thanks..

Comment #15

Hi Azer,.

I installt first the cuntribion(its from sandalwood) you can see the link.

Above and then add the search with help of Maxdvd so I will be able to find the new fields..

I wil try the instrutions of Maxdvd later on also sins I saw they are not the same so I wil try to make them work togher..

If it not works or I didn't understand U right ask if posible I anserw.

Lighthouse..

Comment #16

In fact I was asking not the contribution link but the forum thread link ... I was wondering if it was the mouflon contribtution since I renember he said I s gonna make one!..

Comment #17

I am sorry but I have lost you complete, can you give me a quote to understad what you are looking for when I understand it right it's samthink I did say but I do not know what it is plz help so I can help you.

Lighthouse..

Comment #18

When I get around to later on tonight perhaps, I will explain in more detail how to create the advanced custom search, where it searchs just the database column rather then the easy full description approach from above..

Cheers Lee..

Comment #19

Maxidvd ... do you have any news of mouflon ... I said is gonna make a contribution with custom new field that you ca name from the admin .....

Comment #20

Well sound great ....

But I think you really shouldnt drop the non english languages , since a lot of people are are not using english ... and in a zip the text files are not so big !.

I m definately intersted as you can expect , and I can translate your customized os commerce to french.

Maybe you could make one zip with english and make zip for the languages.

People will certainly propose translation ....

Let me know..

Comment #21

Maxdvd,.

Is there a way to create multible check boxs to search the product descriptions?.

I have gotten as far as being able to add the check boxes that will enter the preselected word for the search. However, it will not search on 2 check boxes at the same time..

Ex:.

Disabilities.

__ Braces __ Glasses __ Dentures.

I want to use advanced search to find these words " braces and glasses" or " braces or glasses" in the product descriptions using check boxes, not the tep_draw_input_field..

Any help would be greatly appreciated...

Comment #22

I have problems with the.

$products_id = tep_db_insert_id();.

After I tried to modify my shop with mouflons tutorial. well, I tried to do some enhancements. my aim is to add fields dynamically. this is were I am stucking right now:.

//this is where I push the new fields into the sql_data_array.

 do {.

 $sql_data_array[$row_get_custom_fields['c2pp_fieldname_db']] = tep_db_prepare_input($HTTP_POST_VARS[$row_get_custom_fields['c2pp_fieldname_db']]);.

 } while($row_get_custom_fields = mysql_fetch_assoc($get_custom_fields));.

 .

 .

         if ($HTTP_GET_VARS['action'] == 'insert_product') {.

           $insert_sql_data = array('products_date_added' => 'now()');.

           $sql_data_array = tep_array_merge($sql_data_array, $insert_sql_data);.

           tep_db_perform(TABLE_PRODUCTS, $sql_data_array);.

           $products_id = tep_db_insert_id();.

           tep_db_query("insert into "TABLE_PRODUCTS_TO_CATEGORIES" (products_id, categories_id) values ('"$products_id"', '"$current_category_id"')");.

Its in the categories.php.

This is what I'm getting when I insert a new record:.

0 -.

Insert into products_to_categories (products_id, categories_id) values ('0', '0').

[TEP STOP].

Inserting into the products table works fine. but script wont get the right product_id. if I use a fixed id like $products_id ="55" it will work. anyone have a hint for me?..

Comment #23

Thanks Lee,.

But how can I search new field of products under admin?..

Comment #24

Hello,.

I added a few columns to product listing and also to the search results. My problem is that the new columns are automatically arranged in alphabetical order after the last "original" columns..

I've tried to change their order in the.

/Admin/>Configuration>Product Listing.

Section but it seems to not do anything. I tried to turn them off in the admin (value 0) but it also doesn't do anything to them... they are still there..

Anyone has any clue what am I missing here?.

Anyone knows what are the specific code lines that are in charge of the columns order?.

Thanks in advance..

Comment #25

Okay... fixed it... my fault :oops:.

I forgot to change something in the sql code when inserting these products to the configuation table in the database...

Comment #26

I also added some column including the date of availability to product_listing (MS2)..

It seems that I do have the same error :.

I cannot sort the date of availability column by the most recent first. Even if I click on the column title (sort), it first sorts with the oldest date, then when I click once again, it sort it good ! I tried to make it asc and desc, still the same....

Can you explain what you did in order to make your last problem work?.

I tried almost everything (modifying code, admin parameters...)..

Comment #27

Hi,.

It would be great if you could post your Easy populate file - or tell me how I can add fields. I have added a filed sort_order to the products and I need to be able to use in in easy populate..

Thanks,.

Philip.

DWD.

Dwdonline.com..

Comment #28

Thanks, Lee, for all of your help and suggestions throughout this thread; it's been very helpful. I'm using your code to display my additional fields, and I love the way that you do it on your iPage site (beautiful site, btw!) with the addition of the commas and the links to the search. Do you do this some special way, or just manually? Thanks again!..

Comment #29

Hi lee,.

Do you think could be possible to add just one input text to the product info page, no just one line but a input text block of 8 lines where the customer will write more information for personalized products?.

I'm in need of this, but can't find something similar in the forum..

Thanks.

Far..

Comment #30

1 mistake in instuctions above SECTION.

3.c - Furthur down the page.

The last box in that section shows a referance too.

Case 'MY_NEW_FIELD':.

< thats not meant to be there, so dont copy that part..

Chow!..

Comment #31

Thanks for this tutorial , so precise ! 8).

Before doing any big mistake can you tell me on wich version did you perform your modifications ....

Since I have the MS1 ian load 5 version , I was told that some product variables and the way listing is done is different from the other versions ....

So I prefer checking before ! :roll:..

Comment #32

I know this should be easy, and I knwo how to add the fields to the database, but how do I ad more fields to the product info page? I need stuff like Photographer, location, year, actually about 7 fields for "standard" stock photography search fields. And I need the fields to be searchable, either with Quick Find or Advanched Search..

Possible?.

Debbie..

Comment #33

Everything is possible, but I don't see why do you need more fields on product info page. You could just add that text and there will be no problem with search then too. Maybe I just don't understand what do you mean...

Comment #34

Industry standards have a certain format. Advertising professionals that would be looking for stock photos want to see things layed out a certain way and coding each description to include the information would be a pain, plus look unprofessional...

Comment #35

Sorry, hit submit before I was done....

I tried using categories, but there are too many fields, and too many photos that would be in cross-categories. They also want to be able to sort on the fields, which isn't possible if theya re all lumped together in the description. Like, they want all the photographs by Deborah Carney of coral roses in Rochester, NY. That would be searching on 4 fields. Then the attributes would be file size and type, etc..

Hope this makes it clearer!..

Comment #36

Hi Debbie.

I am working on the same problem...What you said about industry standards is correct. I need to add fields such as author, publisher, isbn# etc.- standards in the book industry. I have a full database that already contains these fields that needs to be added to the store. Search capability within these specific fields is very helpful when wading through thousands of entries..

I am able to add fields easily to the database, but am having trouble with figuring out what other files need to be changed. What I have come up so far is this:.

Admin/categories.php.

Admin/includes/languages/english.php.

Admin/includes/languages/english/categories.php.

Catalog/default.php.

Catalog/product_info.php.

Catalog/includes/modules/product_listing.php.

Also the files from languages.

I have no working version of this yet- just me stumbling around trying to add these fields..

The next beast to tackle is Easy Populate configuration..

I will let you know of any success- and you can post if you come up with an answer!..

Comment #37

I am working on the same problem, but for an autodealership. I will use what you have offered and put up what I find..

Aj..

Comment #38

I have added extra fields, and in my case, these are the files I had to touch. Given more time, I can give you a breakdown off all the changes that need to be made, there are quite a few. Once done, integration into easy populate is relatively simple...

Comment #39

Thanks! A breakdown would be great. And yes, adding the fields to easy populate, since they are all similar type and go to the dame table, will be relatively easy. Just have to be VERY CAREFUL, typos will kill it completely..

Debbie..

Comment #40

Jeff,.

Thanks for the file list! I am so lost here- but what I am doing is opening each file that needs changes and searching for code that contains "product_name" (which I am using for book titles) and adding my new field after that using the same code. Is this what you would recommend doing?.

This is the only way I can think of to locate the right spots to edit. I know that for an end result I want:.

Product_name | product_author | product_publisher | product_isbn | product_description | product_price.

Any tips on your methods for determining where to add the fields would be most appreciated..

Catherine..

Comment #41

OK - here we go. This code is very specific to this particular site. The field added is product_units.

It's a building supply company, and the listings are for contractors, who know what they want, so I have removed the link to product_info.php, but I have supplied code (untested) that should work. Also, I have the added field showing in the product_listing, which you may or may not want..

Please forgive any spelling misteaks :-) in the filenames..

To see figure the changes I made, look for any references to units, or product_unit.

I am planning to package this up as a tutorial on adding fields, but this should get you going. If you have any question, I'd be glad to help..

Take line numbers with a grain of salt, this is from a pretty old snapshot. (Part of this exercise is for me, so that I can bring this iPage site up to MS1.).

(I really don't suggest copy and pasting this code, just take it as an example).

In /admin/categories.php.

Around line 184.

     case 'insert_product':.

     case 'update_product':.

       if ( ($HTTP_POST_VARS['edit_x']) || ($HTTP_POST_VARS['edit_y']) ) {.

         $HTTP_GET_VARS['action'] = 'new_product';.

       } else {.

         $products_id = tep_db_prepare_input($HTTP_GET_VARS['pID']);.

         $products_date_available = tep_db_prepare_input($HTTP_POST_VARS['products_date_available']);.

         $products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null';.

         $sql_data_array = array('products_quantity' => tep_db_prepare_input($HTTP_POST_VARS['products_quantity']),.

                                 'products_model' => tep_db_prepare_input($HTTP_POST_VARS['products_model']),.

                                 'products_image' => (($HTTP_POST_VARS['products_image'] == 'none') ? '' : tep_db_prepare_input($HTTP_POST_VARS['products_image'])),.

                                 'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']),.

                                 'products_date_available' => $products_date_available,.

                                 'products_weight' => tep_db_prepare_input($HTTP_POST_VARS['products_weight']),.

                                 'products_unit' => tep_db_prepare_input($HTTP_POST_VARS['products_unit']),.

                                 'products_status' => tep_db_prepare_input($HTTP_POST_VARS['products_status']),.

                                 'products_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['products_tax_class_id']),.

                                 'manufacturers_id' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']));.

Around line 279.

         if ($HTTP_POST_VARS['copy_as'] == 'link') {.

           if ($HTTP_POST_VARS['categories_id'] != $current_category_id) {.

             $check_query = tep_db_query("select count(*) as total from "TABLE_PRODUCTS_TO_CATEGORIES" where products_id = '"tep_db_input($products_id)"' and categories_id = '"tep_db_input($categories_id)"'");.

             $check = tep_db_fetch_array($check_query);.

             if ($check['total'] < '1') {.

               tep_db_query("insert into "TABLE_PRODUCTS_TO_CATEGORIES" (products_id, categories_id) values ('"tep_db_input($products_id)"', '"tep_db_input($categories_id)"')");.

             }.

           } else {.

             $messageStack->add_session(ERROR_CANNOT_LINK_TO_SAME_CATEGORY, 'error');.

           }.

         } elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') {.

           $product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_unit, products_tax_class_id, manufacturers_id from "TABLE_PRODUCTS" where products_id = '"tep_db_input($products_id)"'");.

           $product = tep_db_fetch_array($product_query);.

           tep_db_query("insert into "TABLE_PRODUCTS" (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id, products_unit) values ('"$product['products_quantity']"', '"$product['products_model']"', '"$product['products_image']"', '"$product['products_price']"',  now(), '"$product['products_date_available']"', '"$product['products_weight']"', '0', '"$product['products_tax_class_id']"', '"$product['manufacturers_id']"', '" $product['products_units']"')");.

           $dup_products_id = tep_db_insert_id();.

Around line 347.

 if ($HTTP_GET_VARS['action'] == 'new_product') {.

   if ( ($HTTP_GET_VARS['pID']) && (!$HTTP_POST_VARS) ) {.

     $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_unit, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_DESCRIPTION" pd where p.products_id = '"$HTTP_GET_VARS['pID']"' and p.products_id = pd.products_id and pd.language_id = '"$languages_id"'");.

     $product = tep_db_fetch_array($product_query);.

Around line 486.

         <tr>.

           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>.

         </tr>.

         <tr>.

           <td class="main"><?php echo TEXT_PRODUCTS_PRICE; ?></td>.

           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15')'&nbsp;'tep_draw_input_field('products_price', $pInfo->products_price); ?></td>.

         </tr>.

         <tr>.

           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>.

         </tr>.

         <tr>.

           <td class="main"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td>.

           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15')'&nbsp;'tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id); ?></td>.

         </tr>.

         <tr>.

           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>.

         </tr>.

         <tr>.

           <td class="main"><?php echo TEXT_PRODUCTS_WEIGHT; ?></td>.

           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15')'&nbsp;'tep_draw_input_field('products_weight', $pInfo->products_weight); ?></td>.

         </tr>.

         <tr>.

           <td class="main"><?php echo TEXT_PRODUCTS_UNIT; ?></td>.

           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15')'&nbsp;'tep_draw_input_field('products_unit', $pInfo->products_unit); ?></td>.

Around line 570.

// copy image only if modified.

     $products_image = tep_get_uploaded_file('products_image');.

     $image_directory = tep_get_local_path(DIR_FS_CATALOG_IMAGES);.

     if (is_uploaded_file($products_image['tmp_name'])) {.

       tep_copy_uploaded_file($products_image, $image_directory);.

       $products_image_name = $products_image['name'];.

     } else {.

       $products_image_name = $HTTP_POST_VARS['products_previous_image'];.

     }.

   } else {.

     $product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_unit, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id  from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_DESCRIPTION" pd where p.products_id = pd.products_id and p.products_id = '"$HTTP_GET_VARS['pID']"'");.

     $product = tep_db_fetch_array($product_query);.

     $pInfo = new objectInfo($product);.

     $products_image_name = $pInfo->products_image;.

   }.

Admin/includes/classes/shopping_cart.php.

Around line 200.

// products price.

       $product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight,products_unit from "TABLE_PRODUCTS" where products_id='"tep_get_prid($products_id)"'");.

       if ($product = tep_db_fetch_array($product_query)) {.

         $prid = $product['products_id'];.

         $products_tax = tep_get_tax_rate($product['products_tax_class_id']);.

         $products_price = $product['products_price'];.

         $products_weight = $product['products_weight'];.

         $products_unit = $product['products_unit'];.

Around line 252:.

   function get_products() {.

     global $languages_id;.

     if (!is_array($this->contents)) return 0;.

     $products_array = array();.

     reset($this->contents);.

     while (list($products_id, ) = each($this->contents)) {.

       $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_price, p.products_weight, p.products_unit, p.products_tax_class_id from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_DESCRIPTION" pd where p.products_id='"tep_get_prid($products_id)"' and pd.products_id = p.products_id and pd.language_id = '"$languages_id"'");.

       if ($products = tep_db_fetch_array($products_query)) {.

         $prid = $products['products_id'];.

         $products_price = $products['products_price'];.

         $specials_query = tep_db_query("select specials_new_products_price from "TABLE_SPECIALS" where products_id = '"$prid"' and status = '1'");.

         if (tep_db_num_rows($specials_query)) {.

           $specials = tep_db_fetch_array($specials_query);.

           $products_price = $specials['specials_new_products_price'];.

         }.

         $products_array[] = array('id' => $products_id,.

                                   'name' => $products['products_name'],.

                                   'model' => $products['products_model'],.

                                   'price' => $products_price,.

                                   'quantity' => $this->contents[$products_id]['qty'],.

                                   'weight' => $products['products_weight'],.

                                   'unit' => $products['products_unit'],.

                                   'final_price' => ($products_price + $this->attributes_price($products_id)),.

                                   'tax_class_id' => $products['products_tax_class_id'],.

                                   'attributes' => $this->contents[$products_id]['attributes']);.

       }.

     }.

     return $products_array;.

   }.

/admin/includes/languages/english.php.

Define('JS_PRODUCTS_NAME', '* The new product needs a namen');.

Define('JS_PRODUCTS_DESCRIPTION', '* The new product needs a descriptionn');.

Define('JS_PRODUCTS_PRICE', '* The new product needs a price valuen');.

Define('JS_PRODUCTS_WEIGHT', '* The new product needs a weight valuen');.

Define('JS_PRODUCTS_UNIT', '* The new product needs a unit valuen');.

Define('JS_PRODUCTS_QUANTITY', '* The new product needs a quantity valuen');.

Define('JS_PRODUCTS_MODEL', '* The new product needs a model valuen');.

Define('JS_PRODUCTS_IMAGE', '* The new product needs an image valuen');.

/admin/includes/languages/english/categories.php.

Define('TEXT_PRODUCTS_STATUS', 'Products Status:');.

Define('TEXT_PRODUCTS_DATE_AVAILABLE', 'Date Available:');.

Define('TEXT_PRODUCT_AVAILABLE', 'In Stock');.

Define('TEXT_PRODUCT_NOT_AVAILABLE', 'Out of Stock');.

Define('TEXT_PRODUCTS_MANUFACTURER', 'Products Manufacturer:');.

Define('TEXT_PRODUCTS_NAME', 'Products Name:');.

Define('TEXT_PRODUCTS_DESCRIPTION', 'Products Description:');.

Define('TEXT_PRODUCTS_QUANTITY', 'Products Quantity:');.

Define('TEXT_PRODUCTS_MODEL', 'Products Model:');.

Define('TEXT_PRODUCTS_IMAGE', 'Products Image:');.

Define('TEXT_PRODUCTS_URL', 'Products URL:');.

Define('TEXT_PRODUCTS_URL_WITHOUT_HTTP', '<small>(without http://)</small>');.

Define('TEXT_PRODUCTS_PRICE', 'Products Price:');.

Define('TEXT_PRODUCTS_WEIGHT', 'Products Weight:');.

Define('TEXT_PRODUCTS_UNIT', 'Products Unit:');.

Catalog/advanced-search-result.php.

Around line 136.

 // create column list.

 $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,.

                      'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,.

                      'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,.

                      'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,.

                      'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,.

                      'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,.

                      'PRODUCT_LIST_UNIT' => PRODUCT_LIST_UNIT,.

                      'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,.

                      'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);.

 asort($define_list);.

Around line 165.

   switch ($column_list[$col]) {.

     case 'PRODUCT_LIST_MODEL':        $select_column_list .= 'p.products_model';.

                                       break;.

     case 'PRODUCT_LIST_MANUFACTURER': $select_column_list .= 'm.manufacturers_name';.

                                       break;.

     case 'PRODUCT_LIST_QUANTITY':     $select_column_list .= 'p.products_quantity';.

                                       break;.

     case 'PRODUCT_LIST_IMAGE':        $select_column_list .= 'p.products_image';.

                                       break;.

     case 'PRODUCT_LIST_WEIGHT':.

       $select_column_list .= 'p.products_weight';.

       break;.

     case 'PRODUCT_LIST_UNIT':.

       $select_column_list .= 'p.products_unit';.

       break;.

Around line 261.

     case 'PRODUCT_LIST_MODEL':        $order_str .= "p.products_model "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

                                       break;.

     case 'PRODUCT_LIST_NAME':         $order_str .= "pd.products_name "($sort_order == 'd' ? "desc" : "");.

                                       break;.

     case 'PRODUCT_LIST_MANUFACTURER': $order_str .= "m.manufacturers_name "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

                                       break;.

     case 'PRODUCT_LIST_QUANTITY':     $order_str .= "p.products_quantity "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

                                       break;.

     case 'PRODUCT_LIST_IMAGE':        $order_str .= "pd.products_name";.

                                       break;.

     case 'PRODUCT_LIST_WEIGHT':       $order_str .= "p.products_weight "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

                                       break;.

     case 'PRODUCT_LIST_UNIT':       $order_str .= "p.products_unit "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

                                       break;.

     case 'PRODUCT_LIST_PRICE':        $order_str .= "final_price "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

                                       break;.

Catalog/default.php.

Around line 119.

// create column list.

   $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,.

                        'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,.

                        'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,.

                        'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,.

                        'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,.

                        'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,.

                        'PRODUCT_LIST_UNIT' => PRODUCT_LIST_UNIT,.

                        'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,.

                        'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);.

   asort($define_list);.

Around line 148.

      switch ($column_list[$col]) {.

       case 'PRODUCT_LIST_MODEL':        $select_column_list .= 'p.products_model';.

                                         break;.

       case 'PRODUCT_LIST_NAME':         $select_column_list .= 'pd.products_name';.

                                         break;.

       case 'PRODUCT_LIST_MANUFACTURER': $select_column_list .= 'm.manufacturers_name';.

                                         break;.

       case 'PRODUCT_LIST_QUANTITY':     $select_column_list .= 'p.products_quantity';.

                                         break;.

       case 'PRODUCT_LIST_IMAGE':        $select_column_list .= 'p.products_image';.

                                         break;.

       case 'PRODUCT_LIST_WEIGHT':       $select_column_list .= 'p.products_weight';.

                                         break;.

       case 'PRODUCT_LIST_UNIT':       $select_column_list .= 'p.products_unit';.

                                         break;.

Around line 206.

     switch ($column_list[$sort_col-1]) {.

       case 'PRODUCT_LIST_MODEL':        $listing_sql .= "p.products_model "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

                                         break;.

       case 'PRODUCT_LIST_NAME':         $listing_sql .= "pd.products_name "($sort_order == 'd' ? "desc" : "");.

                                         break;.

       case 'PRODUCT_LIST_MANUFACTURER': $listing_sql .= "m.manufacturers_name "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

                                         break;.

       case 'PRODUCT_LIST_QUANTITY':     $listing_sql .= "p.products_quantity "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

                                         break;.

       case 'PRODUCT_LIST_IMAGE':        $listing_sql .= "pd.products_name";.

                                         break;.

       case 'PRODUCT_LIST_WEIGHT':       $listing_sql .= "p.products_weight "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

                                         break;.

       case 'PRODUCT_LIST_UNIT':       $listing_sql .= "p.products_unit "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

                                         break;.

       case 'PRODUCT_LIST_PRICE':        $listing_sql .= "final_price "($sort_order == 'd' ? "desc" : "")", pd.products_name";.

                                         break;.

Catalog/includes/classes/shopping_cart.php.

Around line 205.

// products price.

       $product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight, products_unit from "TABLE_PRODUCTS" where products_id='"tep_get_prid($products_id)"'");.

       if ($product = tep_db_fetch_array($product_query)) {.

         $prid = $product['products_id'];.

         $products_tax = tep_get_tax_rate($product['products_tax_class_id']);.

         $products_price = $product['products_price'];.

         $products_weight = $product['products_weight'];.

         $products_unit = $product['products_unit'];.

Around line 263.

   function get_products() {.

     global $languages_id;.

     if (!is_array($this->contents)) return 0;.

     $products_array = array();.

     reset($this->contents);.

     while (list($products_id, ) = each($this->contents)) {.

       $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_price, p.products_weight, p.products_unit, p.products_tax_class_id from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_DESCRIPTION" pd where p.products_id='"tep_get_prid($products_id)"' and pd.products_id = p.products_id and pd.language_id = '"$languages_id"'");.

       if ($products = tep_db_fetch_array($products_query)) {.

         $prid = $products['products_id'];.

         $products_price = $products['products_price'];.

Around line 288.

         $products_array[] = array('id' => $products_id,.

                                   'name' => $products['products_name'],.

                                   'model' => $products['products_model'],.

                                   'price' => $products_price,.

                                   'quantity' => $this->contents[$products_id]['qty'],.

                                   'weight' => $products['products_weight'],.

                                   'unit' => $products['products_unit'],.

                                   'final_price' => ($products_price + $this->attributes_price($products_id)),.

                                   'tax_class_id' => $products['products_tax_class_id'],.

                                   'attributes' => $this->contents[$products_id]['attributes']);.

Catalog/includes/languages/english/checkout_confirmation.php.

Around line 29.

Define('TEXT_STOCK_WARNING', 'Stock Warning');.

Define('TEXT_MULTIPLE_SHIPMENT', 'Multiple Shipments');.

Define('TEXT_UNIQUE_SHIPMENT', 'Single Shipment');.

Define('TEXT_UNITS', 'Units of');.

Define('TEXT_IMEDIATE_DELIVER', 'We have for immediate delivery:');.

Define('TEXT_STOCK_WARNING_DESC', 'The products marked with <span class="markProductOutOfStock">'STOCK_MARK_PRODUCT_OUT_OF_STOCK'</span> are not available in the quantity you requested. Choose Multiple Shipments if you want the available quantity in stock to be delivered right away and the rest later or Single Shipment to wait until the quantity you requested is available in our stock.');.

Catalog/includes/languages/english/default.php.

Around line 30.

 define('TABLE_HEADING_PRICE', 'Price');.

 define('TABLE_HEADING_WEIGHT', 'Weight');.

 define('TABLE_HEADING_UNIT', 'Units');.

 define('TABLE_HEADING_BUY_NOW', ' ');.

Catalog/includes/languages/english/shopping_cart.php.

Around line 15.

Define('TABLE_HEADING_REMOVE', 'Remove');.

Define('TABLE_HEADING_QUANTITY', 'Qty./Units');.

Define('TABLE_HEADING_MODEL', 'Model');.

Catalog/includes/modules/order_details.php.

Around line 46.

// Quantity box or information as an input box or text.

 if (strstr($PHP_SELF, FILENAME_SHOPPING_CART)) {.

   echo '    <td align="left" valign="top" class ="main"><input type="text" name="cart_quantity[]" value="'$products[$i]['quantity']'" size="4"><input type="hidden" name="products_id[]" value="'$products[$i]['id']'"> '$products[$i]['unit']. '</td>'"n";.

 } else {.

   echo '    <td align="center" valign="top" class ="main">'$products[$i]['quantity']$products[$i]['unit']'</td>'"n";.

 }.

Catalog/includes/modules/product_listing.php.

Around line 81.

     case 'PRODUCT_LIST_UNIT':.

       $lc_text = TABLE_HEADING_UNIT;.

       $lc_align = 'left';.

       break;.

     case 'PRODUCT_LIST_IMAGE':.

       $lc_text = TABLE_HEADING_IMAGE;.

       $lc_align = 'center';.

       break;.

     case 'PRODUCT_LIST_BUY_NOW':.

       $lc_text = TABLE_HEADING_BUY_NOW;.

       $lc_align = 'center';.

       break;.

Around line 157.

         case 'PRODUCT_LIST_WEIGHT':.

           $lc_align = 'right';.

           $lc_text = '&nbsp;'$listing_values['products_weight']'&nbsp;';.

           break;.

         case 'PRODUCT_LIST_UNIT':.

           $lc_align = 'left';.

           $lc_text = '&nbsp;'$listing_values['products_unit']'&nbsp;';.

           break;.

Catalog/product_info.php.

OK - here I'm flying without testing, because on this site, this page is never referenced..

Around line 43.

<?php.

 $product_info = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_unit, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_DESCRIPTION" pd where p.products_id = '"$HTTP_GET_VARS['products_id']"' and pd.products_id = '"$HTTP_GET_VARS['products_id']"' and pd.language_id = '"$languages_id"'");.

 if (!tep_db_num_rows($product_info)) { // product not found in database.

?>.

Now, it's up to you where you want to put it, but it would be something like this:.

<?php.

   if (PRODUCT_LIST_MODEL) {.

     echo '          <tr>'"n" ..

          '            <td colspan="2" class="pageHeading">'$product_info_values['products_model']'</td>'"n" ..

          '          </tr>'"n";.

   }.

     echo '          <tr>'"n" ..

          '            <td class="pageHeading">'. TEXT_PRODUCTS_UNIT .'</td><td class="pageHeading">'$product_info_values['products_unit']'</td>'"n" ..

          '          </tr>'"n";.

?>.

Again remember, I've not tried the code for product_info.php, but's a place to start...

Comment #42

Thanks for the info mouflon, I followed your guide to add some more Movie categories like Director, Language, Subtitles, Audio, Video ect.. It works fine after some fine tweaking, (errors created by-myself not paying attention - it's my DEV shop anyway), I just want to ask is it possible to have these "NEW FIELDS" included in the search.. I cant seem to find any info about this, like I want to be able to search for (Steven Speilberg) in (Directors)..What I am hoping to achieve in the end is the abilty to show my "NEW FIELDS" in the description page "product_info.php" with dynamically generated links on say "Director" or "Actor" that can be clicked and will take the user the the products listing page and will show them all the Films that contain the specific "Director" or "Actor" depending on the link that was clicked..

This sort of rule above will applie to all my new fields, YEAR, DVD-REGION ... lala,.

Thanks for the CODE you supplied above ( It really helped ) BTW I'm making the changes on (MS1 2.2) all the coding is the same,.

Cheers Lee..

Comment #43

Searching these fields is indeed possiple. It will involve some tweaking of advanced_search.php and advanced_search_results.php..

You will have to add new definitions to the array $option_box in advanced_search.php, make the appropriate entries and changes in the language file, then look at the code around line 255 in advanced_search_results.php and you should get an idea of what needs to be added there...

Comment #44

This coding is suited to a DVD or VHS Video shop, but could be altered to suit any store needing heaps of new database fields to display..

This is a sample of the fields that are being generated dynamically from the database for each dvd displayed, please note this info is comming from it's own fields in a table and not the standard osCommerce "Desciption" field, such as:.

(b)star_title:(/.

Star_1, star_2, star_3, star_4 ect....

(b)director_title:(/.

Director_name ect....

Working version can be seen on my store,.

Http://www.maxidvd.com.au/product_info.php...products_id/101.

At the moment it looks like any othre product desription page but it's not, there are about 50 new fields added into my page but only the fields which contain data are being shown....

For example if a director does not exist for a particular DVD, niether of the fields will be displayed (.

Director_title: director_name eg:.

Director:.

Richard Friedman.

).

Eg: will look more like this.

The Directors field is not displayed..

Notice there is not a empty space where the director field was? this is because I am using Collasable tables, and the Word (Director:) is also being generated on the fly from the Database and is not harcoded into the product_info.php page, this is good if you want to sell other products in the page like.

DVD Players.

Fields like, director, actor, ect are not displayed and you can use the standard (description field) and it's still the same page only it looks different.

If you hardcoded it would look ugly more like this:.

Director:.

Title is showing but no info - because this DVD has no Director, but if you sold a product other then a DVD Movie, it would show! so hardcoding html into product_info.php into the page was out of the question for me, I sell 90% dvd movies, but still need the ability to sell anything and everything else..

Below is my altered "working live version" of /product_info.php (v 1.92 2003/02/14 05:51:21).

Be advised, the new fileds below do not get searched, OsCommerce will only search, Title and Description. so these need to be included in the search some how later down the road..

You can copy this code as below into a php editor program, I use Winsyntax 2.0, it's free and can be downloaded from.

Http://www.download.com.

It will show you the line numbers of code (I will tell you the lines I altered later on -below), Please try on a development iPage site first, make sure you make back-ups of original files *incase..

Any new/altered fields you create on this page also need to be created/altered in your MySQL database in the table named.

Products.

,.

This easy method that I have created does not included any changes in the admin/new_products, which means I have created 50 new fields in my products_info.php and MySQL Database - but There is no way to change the information via /Admin online, any changes (info updates) I may need to make online can be done through phpMyAdmin, this works for me, OR I have altered the contribution.

(Easy Populate).

To include the added 50 database fields, so if I need to make any changes - I do it offline via Microsoft Access or Excel, then bulk Upload, it's so much faster. if you like I can send you My altered version of Easy Populate, Suited to my Store only!, but could be modified to suit yours, (easy populate, product_info.php, MySQL Alterations).

Modifications to my products_info_php page are highlighted in (bold writting) below, On or around line 47 (assuming no other mods or contributions have been installed) find this >.

]<table border="0" width="100%" cellspacing="0" cellpadding="0"><?php$product_info_query = tep_db_query("select.

< this is the line where you need to add/change the new fields for the page query to pull the records from the database..

On or around line 106 find this >.

<?php echo stripslashes($product_info['products_description']); ?>.

And below this I have added in all my new fields to be displayed on the page, some are above the products description but most are below down to about line 162, mine have been hardcoded and all new fields are displayed in collasable tables..

(This is the SQL Script to create the additional fields in MySQL *fast).

I would personally only use this on a empty database if you already have products in you shop [b].

YOU WILL LOOSE THEM!.

If you have nothing to loose I recommend running this database empty script first.

Empty database.

All my fields have been named according to my needs...

Hope this gets you started, I will post this info also on the forum a you are the 5th person to PM asking for my modified code..

Cheers Lee..

Comment #45

Wow , cool , this psot arrives at the moment I need to add fields for a computer shop ! I m gonna work on thoses tweakings ... if anyone work on a computer componant shop, he could message me , will share the experience ...

Thanks to you that posted your codes !..

Comment #46

This was a great little tutorial on how to add fields, but now I have a slightly more complicated problem:.

I want to display a couple of those fields in the products listing that you get when you click on the Category. So I need to figure out how OSC is displaying the list and so on..

Anyone have any suggestions on how this might be accomplished, or if someone has already done it??.

Thanks!.

-al..

Comment #47

Hi halbert,.

I have just added fields there now, so It can be done..

Do you intend on going with the same column style ( the way osCommerce is now) or do/have you already changed the file structure?.

Files Involved:.

/catalog/includes/modules/prouduct_listing.php.

/catalog/includes/modules/languages/(your Lang)/default.php.

And you also need to add the new columns into MySQL database via PhpMyAdmin (easy) this will allow you admin control over the columns like you have now in:.

/Admin/ >Configuration>Product Listing.

(options on/off & sort).

If this is what your after let me know an I can post some code snippets, the way I did it.. I can now enable diasble the new column "DVD movie Ratings" Like R18 or PG-13 ect.. in the new column..

Cheers Lee..

Comment #48

Yeah maxi dvd , let us see what you managed to do it , thanks for the effort ! 8)..

Comment #49

Hi - thanks for the reply. I'm sticking to the standard OSC column listing..

I was *trying* to change the product_listing.php file but it boggles my head. I am having a massive flashback to the time when I swore I'd never program again!.

Code snippets would be welcome! As well, what did you change in the database? I haven't looked there yet..

-al..

Comment #50

Ok,.

:idea:.

[u].

:arrow: How to Add New Column to Product Listing + Custom Database Field.

The new field we are adding "for tutorial purpose" is -Manufacturers ID- (m.manufacturers_id) This is a default database field, I will explain how to add a custom database field furthur down as there are a couple more steps involved..

Lets start by making a back up of all the files involved first, this should go with-out saying. :twisted: I also recommend backing up you database by doing a PhpMyAdmin database Export, tick file Structure, data, and drop table, Save as (osCommerce_backup.sql). this allows you do a total restore if something does goes wrong..

:!: Files Involved:.

1. - First of > :arrow: Import My SQL Database Field into PhpMyAdmin:.

(This creates the new column named "Display My New Field" for us in /Admin/ >Configuration>Product Listing).

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Display My New Field', 'PRODUCT_LIST_MY_NEW_FIELD', '3', '<br><br><b>0 = Off and 1, 2, 3, sorts its<br>placement Left or Right', 8, 5, now(), now(), NULL, NULL);.

Lets begin file modifications:.

:wink:.

================================================================================.

===.

2.a - Open /catalog/default.php, aprox line 118 look for this part:.

// create column list.

   $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,.

                        'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,.

                        'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,.

                        'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,.

                        'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,.

                        'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,.

                        'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,.

                        'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);.

   asort($define_list);.

2.a -.

Paste this new "code" into the middle of the above array list:.

'PRODUCT_LIST_MY_NEW_FIELD' => PRODUCT_LIST_MY_NEW_FIELD, // New Column.

It Should now look like:.

// create column list.

   $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,.

                        'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,.

                        'PRODUCT_LIST_MY_NEW_FIELD' => PRODUCT_LIST_MY_NEW_FIELD, // New Column.

                        'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,.

                        'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,.

                        'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,.

                        'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,.

                        'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,.

                        'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);.

   asort($define_list);.

2.b - Furthur down the page aprox line 151 look for this part:.

Case 'PRODUCT_LIST_NAME':.

         $select_column_list .= 'pd.products_name';.

         break;.

Paste this new "code" directly underneath.

Break;.

(Im using >.

M.manufacturers_id.

< for example purpose).

Case 'PRODUCT_LIST_MY_NEW_FIELD': // New Column.

         $select_column_list .= 'm.manufacturers_id'; // We add our "database value".

         break;.

It Should now look like:.

Case 'PRODUCT_LIST_NAME':.

         $select_column_list .= 'pd.products_name';.

         break;.

       case 'PRODUCT_LIST_MY_NEW_FIELD': // New Column.

         $select_column_list .= 'm.manufacturers_id'; // We add our "database value".

         break;.

2.c - Furthur down the page aprox line 216 look for this part:.

Case 'PRODUCT_LIST_NAME':.

         $listing_sql .= "pd.products_name "($sort_order == 'd' ? 'desc' : '');.

         break;.

Paste this new "code" directly underneath.

Break;.

Case 'PRODUCT_LIST_MY_NEW_FIELD': // We add SORTING to Table.

         $listing_sql .= "m.manufacturers_id "($sort_order == 'd' ? 'desc' : ''); // field to SORT.

         break;.

It Should now look like:.

Case 'PRODUCT_LIST_NAME':.

         $listing_sql .= "pd.products_name "($sort_order == 'd' ? 'desc' : '');.

         break;.

       case 'PRODUCT_LIST_MY_NEW_FIELD': // We add SORTING to Table.

         $listing_sql .= "m.manufacturers_id "($sort_order == 'd' ? 'desc' : ''); // field to SORT.

         break;.

Ok > Save file and close..

================================================================================.

=.

3.a - Open /catalog/includes/modules/prouduct_listing.php.

Around line 50 look for this part.

Case 'PRODUCT_LIST_NAME':.

       $lc_text = TABLE_HEADING_PRODUCTS;.

       $lc_align = '';.

       break;.

Paste this new "code" directly underneath.

Break;.

Case 'PRODUCT_LIST_MY_NEW_FIELD': // Create our New Column.

       $lc_text = TABLE_HEADING_MY_NEW_FIELD; // Set Column Name /language/default.php.

       $lc_align = 'center'; // align column center.

       break;.

It Should now look like:.

Case 'PRODUCT_LIST_NAME':.

       $lc_text = TABLE_HEADING_PRODUCTS;.

       $lc_align = '';.

       break;.

       case 'PRODUCT_LIST_MY_NEW_FIELD': // Create our New Column.

       $lc_text = TABLE_HEADING_MY_NEW_FIELD;  // Set Column Name /language/default.php.

       $lc_align = 'center'; // align column center.

       break;.

3.c - Furthur down the page (this part looks a litter different).

Around line 115 you will see another referance to:.

Case 'PRODUCT_LIST_NAME':.

           $lc_align = '';.

           if (isset($HTTP_GET_VARS['manufacturers_id'])) {.

             $lc_text = '<a href="'tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id='$HTTP_GET_VARS['manufacturers_id']'&products_id='$listing['products_id'])'">'$listing['products_name']'</a>';.

           } else {.

             $lc_text = '&nbsp;<a href="'tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath='$cPath'&' : '')'products_id='$listing['products_id'])'">'$listing['products_name']'</a>&nbsp;';.

           }.

           break;.

Paste this new "code" directly underneath.

Break;.

Case 'PRODUCT_LIST_MY_NEW_FIELD':.

           $lc_align = 'center'; // Center our Field.

           $lc_text = '<b>'$listing['manufacturers_id']'</b>'; // Display our Field.

           break;/.

It Should now look like:.

Switch ($column_list[$col]) {.

         case 'PRODUCT_LIST_NAME':.

           $lc_align = '';.

           if (isset($HTTP_GET_VARS['manufacturers_id'])) {.

             $lc_text = '<a href="'tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id='$HTTP_GET_VARS['manufacturers_id']'&products_id='$listing['products_id'])'">'$listing['products_name']'</a>';.

           } else {.

             $lc_text = '&nbsp;<a href="'tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath='$cPath'&' : '')'products_id='$listing['products_id'])'">'$listing['products_name']'</a>&nbsp;';.

           }.

           break;.

          case 'MY_NEW_FIELD':.

         case 'PRODUCT_LIST_MY_NEW_FIELD':.

           $lc_align = 'center'; // Center our Field.

           $lc_text = '<b>'$listing['manufacturers_id']'</b>'; // Display our Field.

           break;/.

Ok > Save file and close..

================================================================================.

=.

4. - Define the New Field name in you Languages:.

/catalog/includes/languages/(your Lang)/default.php.

Open /catalog/(your-language)/default.php.

Find around line 23:.

Define('TABLE_HEADING_PRODUCTS', 'Product Name');.

And under it paste our new field Table Name..

Define('TABLE_HEADING_MY_NEW_FIELD', 'New MaxiDVD');.

Ok > Save file and close..

:oha:.

================================================================================.

=.

CONGATS!! :-).

:whaasup:.

Thats it your done... our new column should be turned-on by default in the SQL.

Script from above, if the new column is not in the right place, ie: Left - Middle - Right, just go into:.

/Admin/ >Configuration>Product Listing and changes as required 1 = left, 5 = middle, 10 = right, 0 = OFF.

================================================================================.

=================.

NEED TO DISPLAY CUSTOM DATABASE FIELDS?:.

If you have added "Custom fields" to your database in Tables:.

Products_description.

OR.

Products.

And.

Want to display for example:.

"products_movie_rating".

Instead of.

"manufacturers_id".

Simply replace all instances of.

Manufacturers_id.

With.

Products_movie_rating.

And all instances of.

M.manufacturers_id.

With.

P.products_movie_rating.

And all instances of.

$listing['manufacturers_id'].

With.

$listing['products_movie_rating'].

Its Too easy.. Have FUN! :bigups:.

BTW: The.

P..

In.

"p.products_movie_rating".

Indicates TABLE.

Products.

And.

Pd..

In.

"pd.products_url".

Indicates TABLE.

Products_description.

================================================================================.

=.

ADD MORE THAN 1 COLUMN?:.

You can easily add a 2nd or 3rd new column by following this guide again, but you need to change:.

The Defines to something else.

Example:.

PRODUCT_LIST_MY_NEW_FIELD.

Make new.

PRODUCT_LIST_MY_OTHER_NEW_FIELD.

TABLE_HEADING_MY_NEW_FIELD.

Make new.

TABLE_HEADING_MY_OTHER_NEW_FIELD.

$listing['manufacturers_id'].

Make new.

$listing['products_movie_rating'].

And the SQL script referances to PRODUCT_LIST_MY_NEW_FIELD will also need to be changed to suit..

I have tested this code in theory - and it works for me > osCommerce MS1 2.2..

I just confirmed these instuctions work and followed them step by step on a clean DEV iPage site to success..

Any probs just post them here..

Cheers Lee, hope this helps you...

Comment #51


This question was taken from a support group/message board and re-posted here so others can learn from it.