Characteristics display

  • Posts: 1119
  • Thank you received: 114
8 years 1 month ago #249697

Hi,

You can try it here: kyra.lt/demoadmin/megztiniai/golfas-dragon-melyna

I also have tried with default protostar template and there is same error...
You can see that facebook doesn't work on the right side...There is also missing back to top button which should be on the right bottom.

Thank you

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

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
8 years 1 month ago #249728

Hi,

The issue with the javascript comes from the characteristics HTML missing on the page. There is no radio inputs on the page and that's what creates the problem.
This is not possible with the default code of HikaShop so it means that you must have modified it some way to create that problem.
Display again the radio buttons like it is by default and it will work again.

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

  • Posts: 1119
  • Thank you received: 114
8 years 1 month ago #249757

Hi,

I have not changed any html relating to radio buttons. Only some css display:none;....
I think I have found the problem. It definitely comes from your code provided in this topic. I have found one of my backups which has old characteristic.php file and there is no js error with it.

So I have downloaded hikashop 2.6.4 and I see that this modification has been applied.
This is why I had no changes when tried with "old one". After I found issue I downloaded hikashop 2.6.4 and I thought it still use old characteristics.php file....my bad I didn't look into code....

Could you please check on your end Nicolas. You will find same js error.

Thank you

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

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
8 years 1 month ago #249826

Hi,

No, I do not get the same js error.
And so do you.
Look here for example:
kyra.lt/demoadmin/tampres/leginsai-pinky-pilka
You don't get the error on that page, even though it is the same website and you also have characteristics with radios and you have that modification in place.
As I said, the problem is that there are no radio buttons for the characteristics on that page and that should not happen normally:
take.ms/L1u6T
Instead of just Nerastra, you should have the radios of the characteristics.
Since there are no radios, the javascript we added creates a javascript error because it doesn't expect to not find any.

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

  • Posts: 1119
  • Thank you received: 114
8 years 1 month ago #249832

Hi,

So after some digging it looks like i found from where this issue is coming.

If in System->display->Default parameters for products->Display out of stock products set to "YES" there is no js error and radio button is displayed as per you advise. If set to "NO" i see "No values found" which i had renamed for my language to "Nerasta" and JS error occurs.

If set to "YES" another issue arrives...Default variant which is sold out now shows on product page and is selected by default and ofcourse with sold out message. Same issue as before your code given.
If default product is unpublished all fine.....


I have attached some screenshots.



Thanks

Attachments:
Last edit: 8 years 1 month ago by kyratn.

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

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
8 years 1 month ago #249833

Hi,

Ohh, so the product is sold out ? Now I begin to understand the problematic and why you have no characteristic selection on that page.
Indeed, in that case, it should not trigger an error.
You'll ahve to change the line:

$js = "var el = document.querySelector('[name=\"".$id."\"]'); el.checked = true; hikashopUpdateVariant(el);";
to:
$js = "var el = document.querySelector('[name=\"".$id."\"]'); if(el) el.checked = true; hikashopUpdateVariant(el);";
And that will remove the error for products without any stock.

The following user(s) said Thank You: kyratn

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

  • Posts: 1119
  • Thank you received: 114
8 years 1 month ago #249921

Hi,

Yep, all works fine now!
Product with all variants sold out shouldn't have any values to select....Sorry maybe I was not clear enough at first.

Thank you Nicolas for looking into this.
I hope this little fix will be added by default?

Kind Regards

Last edit: 8 years 1 month ago by kyratn.

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

  • Posts: 26150
  • Thank you received: 4026
  • MODERATOR
8 years 1 month ago #249923

Hi,

Yes, the patch will be integrated into HikaShop.

Regards,

PS : I also wish to release HikaShop 3 asap :)


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: kyratn

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

Time to create page: 0.059 seconds
Powered by Kunena Forum