Custom fields errors

  • Posts: 134
  • Thank you received: 6
10 years 1 month ago #195695

-- HikaShop version -- : 2.4.0
-- HikaMarket version -- : 1.6.1
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.4.16

HI,

I've noticed the following errors concerning product custom fields:

1. If a custom field (in my case order field) is assigned to a single product and is marked as required, an required field error is displayed for all the products no matter that this custom field is assigned to a single product. And no matter that the custom field itself is not displayed in other products order form.

2. In HS->Config->display->customFields->someCustomField the assigned categories for that custom field are not visible although they exist in DB

Regards!

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

  • Posts: 12953
  • Thank you received: 1778
10 years 1 month ago #195696

Hello,
1. 2. Can you give me more information about the error and the issue that you are having and also about how you configured your custom field through some screenshots ?
Thanks.

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

  • Posts: 134
  • Thank you received: 6
10 years 1 month ago #195737

Hi,

1. New required order custom field "Начален час" is created for the product 'Детско парти'
2. Another product 'План сергия' in totaly different category is being ordered buth the process can't be completed because the required field error is displayed for the custom field "Начален час". This field is not even present in the form itself.

Custom field creation



The product and it's category that the field is created for



On ordering another totaly different product an required error is displayed for the custom field "Начален час". This custom field is not present in the form



And the ordered product is not even in the same category as the product that the custom field is for




Regards!

Attachments:
Last edit: 10 years 1 month ago by filiar.

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

  • Posts: 134
  • Thank you received: 6
10 years 1 month ago #195738

About the second bug.

I will use the same custom field to describe it.




So I would like to assign the field to category and not to the single product. I delete the product(s) that the field has been assigned to and choose the category.




After the save has successfuly been done no category is present in the edit form (although it exists in DB) and the products are not deleted.

Attachments:
Last edit: 10 years 1 month ago by filiar.

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

  • Posts: 26233
  • Thank you received: 4036
  • MODERATOR
10 years 1 month ago #195784

Hi,

I'm not able to reproduce your first issue but I could reproduce the second.
I have already propose some modifications in the namebox system (that I use in HikaMarket) but HikaShop does not have them ; So I will force the inclusion of my modifications so the custom fields will avoid this issue.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 26233
  • Thank you received: 4036
  • MODERATOR
10 years 1 month ago #195935

Hi,

About the category issue ; I know that we got a problem with the category namebox which provided the "category_namekey" instead of the "category_id" but you shouldn't have the issue in the latest package.

For the product issue, here a little patch which will help you to fix it before the next release.
Edit the file "administrator/components/com_hikashop/classes/field.php" and replace

	function saveForm() {
		$field = new stdClass();
		$field->field_id = hikashop_getCID('field_id');
Into
	function saveForm() {
		$field = new stdClass();
		$field->field_id = hikashop_getCID('field_id');
		$field->field_products = '';
So you will be able to remove the "products" from a custom field.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: JoseAlvarez

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

  • Posts: 7
  • Thank you received: 0
10 years 1 month ago #196036

Hi,

I have similar problem and I added the line

$field->field_products = '';

after line 1084 in file '/administrator/components/com_hikashop/classes/field.php'. It seems the only difference between both pieces of code but there is no change when I access custom field section:



Maybe I am wrong?

Regards

Attachments:

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

  • Posts: 83806
  • Thank you received: 13571
  • MODERATOR
10 years 1 month ago #196040

Hi,

What do you mean ?
The issue reported on this thread was about the deletion of categories/products selected in custom fields. Not about selecting categories/products in custom fields.

When you click on that field, you should be able to select the category you want. Isn't that what you get ?

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

  • Posts: 134
  • Thank you received: 6
10 years 1 month ago #196090

Hi,

the patch affects deletion of products. Thank you for that, Jerome. This is one of the issues.

The second one is that in JoseAlvarez, post. And it is that selected categories are not visible after submission. This issue is not affected by that patch and still no selected categories are visible (after submission).

But the one that is most impotrant to me is the first issue - the issue with required custom fields validation. As far as for some orders there are required fields that must not be left empty, this prevents all other prodicts from being ordered.

This is of huge importance. If required custom field is added the shop becomes unusable.

Jerome, You already have my admin credentials (in P.M.) but I may resend them again if needed. Could you debug the problem please.

Last edit: 10 years 1 month ago by filiar.

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

  • Posts: 134
  • Thank you received: 6
10 years 1 month ago #196092

Or if this issue is not of the Jeromes responcibilities I may send them to someone else from the support team of course.

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

  • Posts: 134
  • Thank you received: 6
10 years 1 month ago #196108

There is some debug scenario info:

- custom item column name order_start_hour ( madein-bg.com/administrator/index.php?op...=field&task=edit&cid []=63)
- item that doesn't have this custom item assigned but an required field error is shown - madein-bg.com/%D0%B7%D0%B0%D0%BD%D0%B0%D...%D1%83%D0%BD%D0%B0-2

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

  • Posts: 7
  • Thank you received: 0
10 years 1 month ago #196114

nicolas wrote: Hi,

What do you mean ?
The issue reported on this thread was about the deletion of categories/products selected in custom fields. Not about selecting categories/products in custom fields.

When you click on that field, you should be able to select the category you want. Isn't that what you get ?


Hi,
I see the matter is different. I am sorry. My problem is, also, about custom field restrictions. When I create a custom field for products table, I can select which categories will include that custom field (ex. Colors for a car, size for clothes, but not both custom fields for both products, just one for each one). Then I save the new custom field. If I access to modify that custom field, restrictions category field is empty (as you can see at above picture). So, when I change anything I must re-enter the restrinctions category again.

Regards

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

  • Posts: 134
  • Thank you received: 6
10 years 1 month ago #196119

Yes. That's it - the same to me. But in fact the category is actualy saved in DB. It is just not visible.

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

  • Posts: 26233
  • Thank you received: 4036
  • MODERATOR
10 years 1 month ago #196199

Hi,

Please check you right have the code

if(@$this->field->field_categories == 'all') $this->field->field_categories = '';
echo  $this->nameboxType->display(
	'category',
	explode(',',trim(@$this->field->field_categories,',')),
	hikashopNameboxType::NAMEBOX_MULTIPLE,
	'category',
	array(
		'delete' => true,
		'default_text' => '<em>'.JText::_('HIKA_NONE').'</em>',
	)
);
In the file "administrator/components/com_hikashop/views/field/tmpl/form.php".
I think that you do not have the line
explode(',',trim(@$this->field->field_categories,',')),
We already have that modification in HikaShop for the next release ; I think that's why I wasn't able to reproduce your issue.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: JoseAlvarez

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

  • Posts: 134
  • Thank you received: 6
10 years 1 month ago #196234

Thank you.

That patch fixed the category issue.

Could you tell me where I could find the validation code for the required custom fields, so that I may debug it in my project.

Thank you!

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

  • Posts: 83806
  • Thank you received: 13571
  • MODERATOR
10 years 1 month ago #196310

Hi,

The required option for custom order fields doesn't support yet the restrictions on products and categories as this was only added recently.
If that's something you need, the simplest would be to use instead custom fields of the table "item" which will display on the product page and will have their required option work properly.
If you want to debug, you can look at the getInput function of the file administrator/components/com_hikashop/classes/field.php
But it won't be just one or two lines to add there as there is no code yet there to handle the required value based on the product/category restrictions of the custom order fields.

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

  • Posts: 134
  • Thank you received: 6
10 years 1 month ago #196323

Thank You, Nicolas!

I am not sure if item custom fields would be appropriate, because it's user information that has to be added (for example the date and time of an ordered birthday party).

But I hope this functionality is in your TODO list and may soon be available.

Regards!

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

  • Posts: 26233
  • Thank you received: 4036
  • MODERATOR
10 years 1 month ago #196389

Hi,

Yes, the feature is in the HikaShop TODO list :)

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 6
  • Thank you received: 0
10 years 4 weeks ago #199338

filiar wrote: -- HikaShop version -- : 2.4.0
-- HikaMarket version -- : 1.6.1
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.4.16

1. If a custom field (in my case order field) is assigned to a single product and is marked as required, an required field error is displayed for all the products no matter that this custom field is assigned to a single product. And no matter that the custom field itself is not displayed in other products order form.


Hi,

I have exactly the same problem.
I just updated at the last version of HikaShop Business: 2.4.0 but nothing has changed and shop is still not usable...

Should I open a new topic?

Regards

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

  • Posts: 83806
  • Thank you received: 13571
  • MODERATOR
10 years 4 weeks ago #199344

Hi,

No need to open a new thread.
I already replied to that issue in a previous message of this thread:

Hi,

The required option for custom order fields doesn't support yet the restrictions on products and categories as this was only added recently.
If that's something you need, the simplest would be to use instead custom fields of the table "item" which will display on the product page and will have their required option work properly.
If you want to debug, you can look at the getInput function of the file administrator/components/com_hikashop/classes/field.php
But it won't be just one or two lines to add there as there is no code yet there to handle the required value based on the product/category restrictions of the custom order fields.

So the only solution I can recommend for now is to use a custom field of the table "item" in such case. It will work properly for your needs but will display on the product page instead of the checkout.

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

Time to create page: 0.122 seconds
Powered by Kunena Forum