Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Support] Category Fields


Guest

Recommended Posts

why am I getting this (Warning: Invalid argument supplied for foreach() in /home/public_html/admin/categories.php on line 722) when I update a product and preveiw

 

 

Change line around line 722:

 

 ? ? ? ? ? ?foreach ($extra_fields_array as $key=>$val) {
? ? ? ? ? ??>
? ? ? ? ? ? ?<b><? echo $extra_field_name[$key];?>:</b> <? echo $val;?><br />
? ? ? ? ? ?<?
? ? ? ? ? ?}

 

to:

 

if (tep_not_null($extra_fields_array)) {
? ? ? ? ? ?foreach ($extra_fields_array as $key=>$val) {
? ? ? ? ? ??>
? ? ? ? ? ? ?<b><? echo $extra_field_name[$key];?>:</b> <? echo $val;?><br />
? ? ? ? ? ?<?
? ? ? ? ? ?}
}

 

Matti

Edited by Johnson
Link to comment
Share on other sites

  • Replies 93
  • Created
  • Last Reply

Top Posters In This Topic

Would Category Fields work to specify a deep link URL for a single sub category, so that when you click on that specific category, you are forwarded out of the osCommerce invironment to a 3rd party link.

 

I am looking for a solution to do this.

 

Please let me know, and thanks.

Link to comment
Share on other sites

Would Category Fields work to specify a deep link URL for a single sub category, so that when you click on that specific category, you are forwarded out of the osCommerce invironment to a 3rd party link.

 

I am looking for a solution to do this.

 

Please let me know, and thanks.

 

 

Short answer - no :rolleyes:

 

Matti

Link to comment
Share on other sites

hey, I'm trying to figure out from the description if this is the correct contrib for me. I need to ad an item attribute field to my item description so the user can input text. In other words I want them to be able to input a message so that when they order a t-shirt we can print it on the t-shirt . . . any idea if I'm barking up the right tree.

 

thanks

Link to comment
Share on other sites

Hi,

 

I would like to add a couple of fields to my categories, one for base product shipping price and one for additional product shipping price (as suggested to me by jsruok).

 

Will this contribution work for that? Thank you.

Link to comment
Share on other sites

I just installed this add-on. Maybe it was the wrong add-on - here is what I was hoping to do:

 

Some of the admins of our site don't know anything about SQL so we use the osC Admin program exclusively for adding data. In one of our sub-category levels, I want to add a field to the categories_descriptions table and have it show up on the osC Admin screen as an input field. The only place I can see where this new field was added was the table products_extra_fields.

 

Is there something else I should be using for what I want to do?

Sheryl

Link to comment
Share on other sites

  • 3 weeks later...

I'm trying to get both Products Extra Fields and Category Fields to work together.

 

Category Fields will be for specific attributes of certain categories, and Products Extra Fields will be for attributes that will be the same for every product.

 

When going to the product_info.php page, I get this error on the page

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/html/products/includes/functions/database.php on line 99

 

Code for Category Fields in product_info.php is:

<!-- Category Fields //-->          
         <table border="0" cellspacing="0" cellpadding="2">
  
<?php
   }
$category_fields_query = tep_db_query("SELECT pef.category_extra_fields_name as name, ptf.category_extra_fields_value as value FROM ". TABLE_CATEGORY_EXTRA_FIELDS ." pef LEFT JOIN  ". TABLE_PRODUCTS_TO_CATEGORY_EXTRA_FIELDS ." ptf ON ptf.category_extra_fields_id=pef.category_extra_fields_id WHERE pef.category_extra_fields_status = 1 and ptf.products_id=". (int)$products_id ." ORDER BY category_extra_fields_order");

while ($cextra_fields = tep_db_fetch_array($cextra_fields_query)) {
 if ($cextra_fields['value'] != '') {
?>
           <tr>
             <td class="main" valign="top"><b><?php echo $cextra_fields['name']; ?>:</b></td>
             <td class="main"><?php echo $cextra_fields['value']; ?><br/></td>
           </tr>  
<?
 }
}
   
?>
         </table>
<!-- Category Fields EOF //-->

 

I'm also having a problem in the admin side as well, when I add a field, it will show the field as being added, but doesn't show the name of the field in the column. It will show the field when I'm adding / modifying a product, but then it won't show it in the preview.

 

I can attach a zip file of the store if anyone is willing to help. Contributions installed are: Ultimate SEO, Super Friendly Admin Menu, SuperTracker, Purchase without Account, and a mod of the shopping cart.

Link to comment
Share on other sites

I am not sure if this is the right contribution but I cant find anything else:

 

when I look at the list of products, I dont just need manufacturer, price, etc, I also need other categories, let's say %. I need to have all my products sorted by % so that I have those with the highest % show on top and those with the least show at the bottom. Is it possible to use the contribution in such a way or do the fields only show in the product info?

Link to comment
Share on other sites

Hello Matti, I can only agree with everybody else. Great contribution. Thanks

 

As it is now, and extra field can be assigned to one category and one category only. Would it be possible to let subcategories inherit 'parent's attributes'

 

Example

 

Top

Paintings

Painter 1

Painting 1

Painting 2

Painter 2

Painting 1

Painting 2

 

Sculptures

Sculptor 1

Sculpture 1

Sculpture 2

 

Say, I'd like to create an extra field for all paintings, e.g. area and for all sculptures, e.g volume. As it is now I'd have to create the field for each individual painter/sculptor .... there could be hundeds of them. I would like to assign the field to Paintings/Sculptures once and then let all subcategories inherit it. Is it possible?

 

Eva

/e

Link to comment
Share on other sites

I've just installed this package, but have run into a problem.

I can't add any fields.

 

I did set up the 2 new tables in the database.

 

When I go into the admin:

catalog/admin/product_extra_fields.php

 

there is no way to add fields. There is an "add new field" image,

but it does nothing. Also, while there is a heading for "field name",

there is no input box for a field name.

 

Under the top part ("category fields") there is only

a pull down menu of categories, 2 radio buttons for type,

then the image for add new text. That image is actually missing.

 

I followed the "manual" installation.

 

 

In looking at the page source, here is the table cell that contains the

code that should (but is not) producing the field name.

 

<td class="dataTableContent">

<? echo tep_draw_input_field('field[name]', $field['name'], 'size=30', false, 'text', true);?>      

</td>

 

The fact that this is from the page source, and contains the php commands

such as <? echo.... etc. It seems that there is a bug in the original PHP code.

 

 

Can anyone give me a hint on what the problem may be?

(This is in my admin area, so I can't give out the link and password.)

 

Cheers,

bob

Link to comment
Share on other sites

<td class="dataTableContent">

        <? echo tep_draw_input_field('field[name]', $field['name'], 'size=30', false, 'text', true);?>      

</td>

 

Well, that problem seems to be thatmy server does not recognize <?

as a start of php code , so I have replaced them with <?php, so

that now works.

Link to comment
Share on other sites

I have read all the treads but couldn?t find anything that solves my problem

 

i get this message:

 

1146 - Table 'discusimport_dk.TABLE_PRODUCTS_EXTRA_FIELDS' doesn't exist

 

SELECT products_extra_fields_id, products_extra_fields_name, products_extra_fields_category, products_extra_fields_type, products_extra_fields_order, products_extra_fields_status from TABLE_PRODUCTS_EXTRA_FIELDS ORDER BY products_extra_fields_category

 

[TEP STOP]

 

Please help

 

And the table is created in my database

 

Regards,

Link to comment
Share on other sites

Please help

 

And the table is created in my database

 

Regards,

 

 

You must define the table in /includes/database_tables.php :D

 

Do this in both the admin and catalog files.

 

Matti

 

I'm trying to get both Products Extra Fields and Category Fields to work together.

 

When going to the product_info.php page, I get this error on the page

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/html/products/includes/functions/database.php on line 99

 

Your problem is that you have used:

 

 

while ($cextra_fields = tep_db_fetch_array($cextra_fields_query)) {
if ($cextra_fields['value'] != '') {

 

Your query is not named $cextra_fields_query but the original $category_fields_query - just change this :D

 

Matti

 

I am not sure if this is the right contribution but I cant find anything else:

 

when I look at the list of products, I dont just need manufacturer, price, etc, I also need other categories, let's say %. I need to have all my products sorted by % so that I have those with the highest % show on top and those with the least show at the bottom. Is it possible to use the contribution in such a way or do the fields only show in the product info?

 

 

The fields only show in product_info.php :D

 

Matti

Link to comment
Share on other sites

Hello,

 

First and foremost I would like to thank you for making Category Fields. I am making a second hand computer online store and this is really an answer to my prayers. I just have a problem though. I know most of the OS Commerce site uses 100% of the width of the browser, my problem is that my template has a border on the left and right side and when I used your contribution, somehow every time I click on a particular product to view it's information it forces it to use the 100% making my site look a bit funny.

 

please check my website so you could see what I mean..

my store formating should look like this --> store.yeheyjp.com

but if you go to view the product information it looks like this --> http://store.yeheyjp.com/product_info.php?...&products_id=20

 

I hope you can help me!

 

Cheers!

Joey

Link to comment
Share on other sites

  • 2 weeks later...
I think I already resolved the problem! Thanks anyway!

 

Cheers!

 

 

Hi,

I,am having the same problem on my product_info page. Please help me with the fix. I notice if I put in a product without images my product_info page aligns to the right and the buttons ends up on the buttom of the page also the boxes on the right goes pass the header. when product has a image every thing is fine.

 

 

I installed the bundle contribute and Ultimate Images Pack and affiliate build a link.

 

Thank you.

Link to comment
Share on other sites

Great contribution.

 

This might turn out to be one extremely helpful contribution if I can get it to do what I want.

 

I need to add a new field for the color.

 

Is there anyway, that I will be able to include this new field in a search, in other words, when I set all my colors for each item. will I be able to select the color from a pull down menu - like on the advanced_search page?

 

If there is anyway to figure this out, i would greatly appreciate it. customers searching time would be cut in half.

 

Thanks

 

Mark

Link to comment
Share on other sites

So to back step a bit - has anyone answered on how to apply the category fields to multiple categories? As it stands you have to create multiple entires - kinda the LONG way no?

 

 

Not at all - you simply use the Products Extra Fields contribution :P

 

The whole purpose of the Category Fields contribution is the ability to have *different* extra fields per category :-"

 

Matti

Link to comment
Share on other sites

My exact inquiry... anyone get this working?

 

 

 

Hello Matti, I can only agree with everybody else. Great contribution. Thanks

 

As it is now, and extra field can be assigned to one category and one category only. Would it be possible to let subcategories inherit 'parent's attributes'

 

Example

 

Top

Paintings

Painter 1

Painting 1

Painting 2

Painter 2

Painting 1

Painting 2

 

Sculptures

Sculptor 1

Sculpture 1

Sculpture 2

 

Say, I'd like to create an extra field for all paintings, e.g. area and for all sculptures, e.g volume. As it is now I'd have to create the field for each individual painter/sculptor .... there could be hundeds of them. I would like to assign the field to Paintings/Sculptures once and then let all subcategories inherit it. Is it possible?

 

Eva

 

 

lemme know if you find a way :) please

 

So to back step a bit - has anyone answered on how to apply the category fields to multiple categories? As it stands you have to create multiple entires - kinda the LONG way no?

 

 

What I guess I want to know... like in your situation... If you assigned an extra category to say PAINTER 1 then PAINTER 1, Painting 1 and Painting 2 would be also able to be able to add. maybe like a click box option.

 

or if you added a category to SCULPTURES then Sculptures

Sculptor 1

Sculpture 1

Sculpture 2 would all have the extra category... and if I understand it doesn't show unless it is filled in, which is cool.

 

My thing is that I have so many categories... like say I was doing dvds. I'd want a field for Actors, Directors, UPC, (description is default), etc... I'd have to add an extra field to each category... like say Drama, Comedy, Music, etc

 

so just for those 3 I'd have to add 9 new fields... the trick is there are a lot more categories and a lot more fields. I guess it's do-able but I wanted to see if anyone was able to remix this thing one more time :)

Link to comment
Share on other sites

Hello,

 

First of al great contribut.

I am setting op a store for plants and use the extra fields for:

Height

Color

Season

 

But i want to change the text with a image like:

height -> image of the height of the plant

Color -> image of the color

..

 

Can any one help me with that? or is there a other contribution?

 

Thanks anyway,

 

Rogier

Holland

Link to comment
Share on other sites

I got this going on on the user side...

 

:(

 

 

 

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by pd.products_name' at line 1

 

select count(p.products_id) as total order by pd.products_name

 

[TEP STOP]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...