hide custom item fields on cart/checkout process

  • Posts: 7
  • Thank you received: 0
11 years 7 months ago #128251

-- HikaShop version -- : 2.2.0

Hi,
I have some products that I add to cart by code (using code described here ).
I have an internal custom item text field that I don't want to be displayed in front-end product page but I need to be visible in back-end order details (Product List) so I have added a little code in administrator/com_hikashop/views/order/tmpl/show_products.php

My problem is that when I disable the "Front end" option in custom field configuration the field is not displayed in front-end as expected but it is not populated in the order (field column in hikashop_order_prodauct is empty).

When I enable the "Front end" option, all works fine.

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

  • Posts: 12953
  • Thank you received: 1778
11 years 7 months ago #128304

Hi,
One solution would be to use some CSS code to "hide" your custom item field through your cart/checkout process, you can for example use this CSS property :

display: none!important;

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

  • Posts: 7
  • Thank you received: 0
11 years 7 months ago #128307

Thank you Mohamed,
it is a good idea but the custom field content would be output in html.
My Custom field is related to internal data that should be "internal"

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

  • Posts: 13201
  • Thank you received: 2322
11 years 7 months ago #128390

Hi,

In your case you should use the custom fields in the table "product" instead of "item", and disable the "front-end" option.
If the item custom fields are not displayed in frontend so there is no html, and it's not sent to the order.

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

Time to create page: 0.078 seconds
Powered by Kunena Forum