Product Custom field not recording post checkout

  • Posts: 38
  • Thank you received: 1
8 years 6 months ago #240828

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.3.3
-- PHP version -- : 5.4.35
-- Browser(s) name and version -- : Chrome 50.0.2661.102 m

My "Item" custom fields:
I have added a custom field to many of my products, they are "Item" custom fields.
These are a "single dropdown" type.

What works:
These fields show on the product detail on the front end.
The value selected when adding to cart shows on the checkout cart.

What goes wrong after checkout and payment:
The emails to the customer with the order do not show a value for the custom field.
The customer's "my orders" page shows the order with the custom field set to the default option "Select an option"
MOST IMPORTANT - The order in the back end has no trace of the selected value for this field, this means we can not process the order without calling to confirm until this has been fixed.

This is a new shop.
I am not sure if it matters but the first option in the dropdown list is "Select an option" (value = "select")
To force the customer to not choose the default option I have used the "Regular expression check" feature with this:
^((?!select).)*$
This matches the default value and rejects it. If they select any other option it lets them continue and shows on the checkout cart etc.

Suspicion:
The data is not being recorded in the database for the order.
In the table "hikashop_order_product" I found the order I was testing with and the field for this custom field is named "dhcs066_colour" and has "NULL" as the value.
What is stopping this value from being recorded in the DB after order creation? (again, pre checkout completion it is fine and shows nicely on the checkout cart).

Please reply ASAP, we will be taking down this new shop until this can be resolved. I thank you in advance for your time.

P.S. Do not recommend against using custom fields in my situation, I can assure you that I need them in my situation and cannot use options or variants due to SKU requirements for my CSV importing system.

Thank you,
Michael A.
DO IT Solutions.

Last edit: 8 years 6 months ago by doitsolutions.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
8 years 6 months ago #240857

Hi,

Could you provide a screenshot of the settings of your custom field so that we can see how you configured it since it works on our end ?

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

  • Posts: 38
  • Thank you received: 1
8 years 6 months ago #240873

Screenshot attached.

Also, I noticed that on the new version of hikashop on this site there are no ticks in places that there used to be. The second file attached shows many "item" custom fields I have created for my products.
Perhaps it is happening because I have so many?

Attachments:

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

  • Posts: 38
  • Thank you received: 1
8 years 6 months ago #240954

I just upgraded to the latest Joomla with no change in the problem.

I found an other problem noticed on the BIAS-IQ site, this might be related or give a clue to the first problem:
There are 23 items that have a custom field applied to them from the back end of Hikashop. These custom fields are of the "ITEM" table type and allow the user to select a value for "colour" or "size" usually. They are all the "single dropdown" type and have multiple values to select from. The default value always starts as "Select" "Please select an option". I have entered a "Regular expression check" of "^((?!select).)*$" on each custom field so that it does not let them leave it on the "select an option" option, it forces them to change it before adding to cart.

Of these 23 items:
On 14 of them the regular expression check works and the validation message shows, stopping them from adding to cart without selecting another option.
On 9 of them the regular expression check fails and lets them add the item to card with "select and option" as the selected option.
Perhaps the bug in the code causing the main problem above is causing this also, a break in the code?

Here is a list of the 23 items, separated into 2 groups. 9 items with failing regular expression check validation and 14 with regular expression check validation working well:

(I have decided against including the list here as it links to adult related content for sale, PM me for the list if you need it, and are not going to explode if you see sex related products on your screen. NSFW!!!)

However, as per the original issue in the forum post, NONE of these 23 items will have the selected option showing in the database after checkout on the order. It only shows while in cart then does not record after that point.
These are currently two separate issues in my opinion, but perhaps related / caused by the same bug.

Please help me! :) I need to let this launch go live as soon as possible for my client.

Last edit: 8 years 6 months ago by doitsolutions. Reason: Typing error

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

  • Posts: 38
  • Thank you received: 1
8 years 6 months ago #241076

We are using a work-around now, this will keep us going for a while. We cannot trust custom fields until this is working. Perhaps it is a conflict with other extensions installed / environmental.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
8 years 6 months ago #241104

Hi,

Thank you for the details.
Thanks to them, I was able to reproduce the problem on our end.
Change the line:
$itemFields = $fieldsClass->getFields('frontcomp', $element, 'item');
to:
$itemFields = $fieldsClass->getFields('', $element, 'item');
in the file administrator/components/com_hikashop/classes/order_product.php and that will fix the problem with the new custom field display options system.

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

Time to create page: 0.066 seconds
Powered by Kunena Forum