Unavailable characteristics

  • Posts: 212
  • Thank you received: 13
1 day 7 hours ago #368943

-- HikaShop version -- : 6.1.0
-- Joomla version -- : 5.3.4
-- PHP version -- : 8.2

Hi.
i have 5 colors as characteristics for my produt, which stock quantity of 2 of them are 0.
i displaying the characteristic with radio buttons

is there any possibility that i could set the opacity of that 0 sticks to 0.5 and make them disabled ?

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

  • Posts: 84503
  • Thank you received: 13740
  • MODERATOR
15 hours 53 minutes ago #368948

Hi,

There is no option for that. What you can do is to turn off the "Display out of stock products" setting of the HikaShop configuration:
www.hikashop.com/support/documentation/5...ig.html#main_product
This way, variants without stock won't be proposed to the customer.

Note however that for products with several characteristics, it's still possible that radios for out of stock variants are proposed to the user if you have turned off the "Characteristics dynamic display" setting:
www.hikashop.com/support/documentation/5...html#display_product

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

  • Posts: 212
  • Thank you received: 13
12 hours 9 minutes ago #368956

i think you consider adding a class to the unavailble characteristics and display them. in that case the designer can add some css to it. with this options customers will know there were or will be more colors of that product.

in which override file i can do some modifications to characteristic <input> and <label> tags ?

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

  • Posts: 84503
  • Thank you received: 13740
  • MODERATOR
7 hours 10 minutes ago #368957

Hi,

The input and label tags are generated by the Joomla library. Adding a class to them is not easy.
The code is in libraries/src/HTML/Helpers/Select.php but I recommend you to not change it.
Instead, you can add modifications in the product / show_block_characteristic view file via the menu Display>Views of HikaShop.

Also, knowing if a radio needs a class or not is complex. That's because when you have several characteristics for a product, a radio (which is for a value of a characteristic) can be for several variants.
For example, suppose I sell a t-shirt with a characteristic "color" with the values "red", "blue" and "green", and a second characteristic "size" with the values "S", "M" and "L".
For the radio "red", there are 3 variants: red/S, red/M and red/L.
So, you can't effectively set a class based on the stock of a variant since there are several variants for the radio.
The only case would be if all 3 variants for that "red" radio have a stock of 0, but in that case, the radio won't appear at all (see what I wrote in my previous message).
So that's why we can't add a class for the stock on the radios.

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

Time to create page: 0.038 seconds
Powered by Kunena Forum