Skip to main content

display sub categories if product out of stock

More
11 years 5 months ago #200298 by Udo
-- 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.

More
11 years 5 months ago #200393 by nicolas
Hi,

Add the line:
Code:
if(!obj) return true;
before the line:
Code:
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.

More
11 years 5 months ago #200423 by Udo
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.

More
11 years 5 months ago #200426 by nicolas
Yes it will.

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

Time to create page: 0.188 seconds
Powered by Kunena Forum