Product edition form in order

  • Posts: 52
  • Thank you received: 6
  • Hikashop Business
2 years 10 months ago #333521

-- HikaShop version -- : 4.4.3
-- Joomla version -- : 3.9.27
-- PHP version -- : 7.3.28
-- Browser(s) name and version -- : Edge

Custom field Item 'Proposed Dates'. Set to display in Front End as an option for the user to complete on buying an item. Details displays in front end listing and backend listing. Field is not set to display in 'Product edition form in order'
Custom field Item 'Confirmed Start Date'. Set to only display in Front and Back end product listing, plus in 'Product edition form in order'.

When data is updated in 'Product edition form in order', any fields that are not displayed are cleared. So information added by the customer in 'Proposed Dates' is lost.

If the field is not shown to the backend user to complete, shouldn't the data added by the frontend user be retained?

David

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
2 years 10 months ago #333525

Hi,

Thanks for the feedback.
This can be fixed by changing the code:

$item_fields = $fieldClass->getData('backend', 'item');
to:
if(!empty($data['order']['product']['product_id'])) {
					$oldData = $orderProductClass->get($data['order']['product']['product_id']);
				}
				$item_fields = $fieldClass->getFields('display:order_edit=1', $oldData, 'item', 'user&task=state');
in the file administrator/components/com_hikashop/classes/order.php
That change should even help if you have required fields for some products as otherwise, it might not let you save the fields of other products in the order edition.
Please confirm how that patch goes on your end so that we can include the modification on our end.

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

  • Posts: 52
  • Thank you received: 6
  • Hikashop Business
2 years 10 months ago #333532

Great that has resolved disappearing data.

However, there is a field of checkboxes. If you update this in the backend, it no longer stores the changes.

Thank you
David

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

  • Posts: 52
  • Thank you received: 6
  • Hikashop Business
2 years 10 months ago #333534

I have not yet applied the fix to the live environment and realised the checkboxes are not updating. So this not due to the fix, but a different bug.

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
2 years 10 months ago #333539

Hi,

Could you describe the issue with the checkboxes and provide some screenshots, like a screenshot of the settings of the custom field ?

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

  • Posts: 52
  • Thank you received: 6
  • Hikashop Business
2 years 10 months ago #333580

Afternoon
If you set the checkboxes in the frontend, they save.
If you set the checkboxes in the backend, they do not save. If checkboxes are set and remove all of them, they do get saved. You cannot reset them and the reverse idea of ticking all checkboxes does not save.
Screenshot of the field set up attached.

Attachments:

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
2 years 10 months ago #333584

Hi,

Thank you for the details. I've actually dug a bit deeper and properly tested different cases and thus I came up with a bigger patch.
I've added the patch on our end.
To get it, download the install package of the latest HikaShop on our website and install it on yours and it will add it.

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

  • Posts: 52
  • Thank you received: 6
  • Hikashop Business
2 years 10 months ago #333599

Great, that has worked.

Thank you
David

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

Time to create page: 0.071 seconds
Powered by Kunena Forum