Custom Field, Back-end; Imported field data; bug?

  • Posts: 28
  • Thank you received: 0
10 years 2 months ago #170081

-- HikaShop version -- : latest
-- Joomla version -- : latest
-- PHP version -- : latest

Hey guys,

I created some custom fields, set them to display on 'backend list' and 'backend form' and added a specific category to them (ie. Category 1). I then imported a csv with those fields' columns name.

The problem is... when you have a category that is outside the defined (ie. Category 2) and try to edit an imported product. On the backend list, the product shows the custom field even if the product is in a category outside the defined above. If you edit that product, the fields won't show because this is the only 'check' for when to show those fields, thus you cannot change them.

Ie.
You create Custom field 1, text, restricted to Category 1
You import "Product 1, Category 2, ABC as the custom field 1"
You view the backend product list, it shows the column header "Custom Field 1" and at the row with Product 1, you see "ABC" shown under the custom field 1
You click Product 1 to edit it, but Custom field 1 is hidden / not shown because Product 1 is in category "Category 2", even though it has a value for the custom field.
Thus you either add Category 2 to the category list for the custom field. Or remove the field restriction on the custom field.

1) This isn't so much of a problem when importing. I rather not have the import process check active custom field rules as this could create undesired data truncation.
2) However what I would desire to see in future versions is an option like "If custom field value exist but category is restricted, then allow editing of the field on the backend anyways."
3) AKA the category restriction should only restrict on product creation the normal way via the backend, but if a product has the custom field filled, it should be editable in the backend when editng a pre-existing product with the custom field filled.
4) I haven't tested but what happens to the value if you change the category from an allowed category to a restricted category - does the script delete the value from the db or does it just ignore displaying it?

You could add an option to the custom field screen "Allow editing of field outside of restricted categories".

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 2 months ago #170133

Hi,

We won't do that.
If you want to be able to use the custom field for categories outside the ones you restricted it to, then why have category restrictions added to it in the first place ?
Just don't add any category restriction to your custom field, or make sure that the category of the products you want to edit are in the category restriction of the custom field.
Also, products can have several categories, so one method often used is to have one unpublished category per custom field and add that category to each custom field. Then, in each product where you want the field, simply add that category as a second category.
So you could for example import this:
"Product 1, Category 2;unpublished category of field 1, ABC as the custom field 1"
And have the "unpublished category of field 1" unpublished category in your custom field 1 and it would work.

Please Log in or Create an account to join the conversation.

  • Posts: 28
  • Thank you received: 0
10 years 2 months ago #170224

Ah, good idea!

Please Log in or Create an account to join the conversation.

Time to create page: 0.057 seconds
Powered by Kunena Forum