display sub categories if product out of stock

  • Posts: 220
  • Thank you received: 8
10 years 4 months ago #200298

-- HikaShop version -- : 2.3.3
-- Joomla version -- : 2.5.27
-- PHP version -- : 5.4.33

Hi,

I have a problem with the incorrect display of sub categories in the hikashop module if a product has characteristics and the variants are out of stock.
Relevant setting in the configuration: only direct sub categories are shown

If the product without characteristics is out of stock the display is correct: the product page shows the text Out of stock and only direct sub categories show in the module.

However if a product has characteristics and all variants are out of stock, the display of sub categories is incorrect: now ALL sub categories are shown in the module.

The error notice in the Javascript console in Chrome is:
Uncaught TypeError: Cannot read property 'type' of null

This refers to:
function hikashopUpdateVariant(obj){
if(obj.type=='radio')

Apparently the problem is caused by the fact that there's no characteristic to select.

Is there a way to correct this incorrect behaviour?

Thanks,
Udo

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

  • Posts: 84304
  • Thank you received: 13698
  • MODERATOR
10 years 4 months ago #200393

Hi,

Add the line:

if(!obj) return true;
before the line:
if(obj.type==\'radio\'){
in the file administrator/components/com_hikashop/types/characteristic.php and that should fix the problem.

The following user(s) said Thank You: Udo

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

  • Posts: 220
  • Thank you received: 8
10 years 4 months ago #200423

Thanks a lot, Nicolas, problem is fixed!

Will this extra code be part of the next version of Hikashop?

Kind regards,
Udo

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

  • Posts: 84304
  • Thank you received: 13698
  • MODERATOR
10 years 4 months ago #200426

Yes it will.

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

Time to create page: 0.058 seconds
Powered by Kunena Forum