Custom fields by product in checkout

  • Posts: 202
  • Thank you received: 2
13 years 7 months ago #14527

FYI - the front-end Product-> show view is version 1.4.9

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

  • Posts: 82866
  • Thank you received: 13373
  • MODERATOR
13 years 7 months ago #14528

You custom field is fine. What about the product edition page ?

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

  • Posts: 202
  • Thank you received: 2
13 years 7 months ago #14530

What is the product edition page?

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

  • Posts: 202
  • Thank you received: 2
13 years 7 months ago #14533

It appears to have something to do with the way the field was populated. When I added the field, I used a sql query in phpMyAdmin to populate the field. This appears to be what caused the problem, because if I add another field and populate the value in the back-end product page, the display works as expected.

So, if I am going to populate this when I upload products I just need to ensure the data is written correctly into the #__hikashop_product table.

Sorry for the inconvenience!!!

Rick

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

  • Posts: 202
  • Thank you received: 2
13 years 7 months ago #14536

AHA!!! I think I may have found something!!

Everything works as expected on the products that do not contain Characteristics. Products that display a Characteristic are ALWAYS displaying the extra fields, and the value of the "show_fields" field is always showing Y.

For products that do not have Characteristics, the custom Item fields are suppressed as I would expect.

If you want access to the front or back-end to see this in action, let me know!!

Last edit: 13 years 7 months ago by momentis.

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

  • Posts: 82866
  • Thank you received: 13373
  • MODERATOR
13 years 7 months ago #14537

You said that you set your field via a mysql query. When you use characteristics for a product, hikashop will create automatically a variant per combination of thes values of the characteristics. That allows you to set specific information for some values like for example to change the price.
These variants are also saved in the product table. Also, when you have a product with a variant, if there is data in the variant field, the variant field is used instead of the main product field.
So I suppose that all the variants of your product have the field with Y. Which means that whatever the value of the main product, the value of the variant displayed will be used.
It's the normal behaviour.
The problem is your query. You should only set your field when the value "main" is in the "product_type" field of the product table.

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

  • Posts: 202
  • Thank you received: 2
13 years 7 months ago #14539

I am sorry for my lack of understanding on this, but I am still confused.

In the simplest terms, how can I set up the custom Product field to only display the Item fields based on this Product field? Assuming some of my products have variants, how can I do this?

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

  • Posts: 202
  • Thank you received: 2
13 years 7 months ago #14540

Finally, I see the light!!!

Looking at the table again, I just realized what you were saying - when there are variants the product table is populated with additional products for each variant. My query was setting a value for ALL products, including the variant "products". Once I deleted the values from all of the variant "products", it started working perfectly.

Again, sorry it took me SO long to understand the problem!!!!!! :blush: :blush: :blush:

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

Time to create page: 0.041 seconds
Powered by Kunena Forum