- Posts: 220
- Thank you received: 8
display sub categories if product out of stock
11 years 5 months ago #200298
by Udo
display sub categories if product out of stock was created 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
-- 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.
11 years 5 months ago #200393
by nicolas
Replied by nicolas on topic display sub categories if product out of stock
Hi,
Add the line:
before the line:
in the file administrator/components/com_hikashop/types/characteristic.php and that should fix the problem.
Add the line:
Code:
if(!obj) return true;
Code:
if(obj.type==\'radio\'){
The following user(s) said Thank You: Udo
Please Log in or Create an account to join the conversation.
11 years 5 months ago #200423
by Udo
Replied by Udo on topic display sub categories if product out of stock
Thanks a lot, Nicolas, problem is fixed!
Will this extra code be part of the next version of Hikashop?
Kind regards,
Udo
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.
11 years 5 months ago #200426
by nicolas
Replied by nicolas on topic display sub categories if product out of stock
Yes it will.
Please Log in or Create an account to join the conversation.
Time to create page: 0.188 seconds