Adding Stock options to products not working -

tim
Founder
Nuo Sweden
Narys nuo geg. 2013
tim

Check your F12 browser console for a javascript error. Paste it here.
You need the console open when the page loads to be able to see tracke back to which line of code that produces the error.

LiteCart Fan
Nuo United States
Narys nuo kov. 2022

send @ jquery-3.6.1.min.js?_=1671186248:2
ajax @ jquery-3.6.1.min.js?_=1671186248:2
S.<computed> @ jquery-3.6.1.min.js?_=1671186248:2
getJSON @ jquery-3.6.1.min.js?_=1671186248:2
input @ app.js:420
dispatch @ jquery-3.6.1.min.js?_=1671186248:2
y.handle @ jquery-3.6.1.min.js?_=1671186248:2
trigger @ jquery-3.6.1.min.js?_=1671186248:2
(anonymous) @ jquery-3.6.1.min.js?_=1671186248:2
each @ jquery-3.6.1.min.js?_=1671186248:2
each @ jquery-3.6.1.min.js?_=1671186248:2
trigger @ jquery-3.6.1.min.js?_=1671186248:2
(anonymous) @ app.js:548
each @ jquery-3.6.1.min.js?_=1671186248:2
each @ jquery-3.6.1.min.js?_=1671186248:2
a.fn.categoryPicker @ app.js:398
(anonymous) @ ?app=catalog&doc=edit_product&category_id=4&product_id=177:2050
jquery-3.6.1.min.js?_=1671186248:2 XHR finished loading: GET "https://.xyz/ext/trumbowyg/ui/icons.svg".
send @ jquery-3.6.1.min.js?_=1671186248:2
ajax @ jquery-3.6.1.min.js?_=1671186248:2
i @ trumbowyg.min.js?_=1671186248:2
(anonymous) @ trumbowyg.min.js?_=1671186248:2
each @ jquery-3.6.1.min.js?_=1671186248:2
each @ jquery-3.6.1.min.js?_=1671186248:2
a.fn.trumbowyg @ trumbowyg.min.js?_=1671186248:2
(anonymous) @ ?app=catalog&doc=edit_product&category_id=4&product_id=177:2066
XHR finished loading: GET "https://.xyz/admin2/?app=catalog&doc=categories.json".```
tim
Founder
Nuo Sweden
Narys nuo geg. 2013
tim

No errors, logged. Just a bunch of verbose stuff. I see that I can reproduce this in the demo so I will produce a fix.

tim
Founder
Nuo Sweden
Narys nuo geg. 2013
tim

Oh I just figured out this is not an error, first set up your options. Then assign your stock options.

vim
LiteCart Fan
Nuo Belgium
Narys nuo spal. 2020
vim

I have the impression that I run into the same or similar problem with a brand new site I starting to set up:
I have set 1 Attribute group (Sizes) with 2 values (S and L).
If I select the group in Attributes of a product, the hourglass keeps turning and no values appear.
If I select the group in Options or Stock of a product, nothing happens and no values to select from appear.
I can only cancel the product window.

Any hints? I'm running PHP 7.0. Tried other versions but the site does not respond any more.

tim
Founder
Nuo Sweden
Narys nuo geg. 2013
tim

If I select the group in Attributes of a product, the hourglass keeps turning and no values appear.
This makes me think it is a javascript error.

LiteCart 2.5.2 is fit for PHP 8.2 so 7.0 is not the recommended version. I recommend PHP 8.1.
It's possible you found a version incompatibility with PHP 7.0 causing this.

You are entitled to create a support ticket. Click here to begin.

vim
LiteCart Fan
Nuo Belgium
Narys nuo spal. 2020
vim

Thanks for your fast reply.

But something is going far over my knowledge: I get a blank screen when surfing to any Webshop on the subdomains if I set PHP different for the new subdomain only.
If I set PHP the same (7.x, 8.1, 8.2,... whatever) for ALL domains on the server all subdomain sites can be reached.

But even when I set PHP on 8.1 for all subdomains, the new site on LiteCart 2.5.2 has no change in behaviour for the Attributes problem. And my webshop on another subdomain on LiteCart 2.3.2 now continuously generates errors.

vim
LiteCart Fan
Nuo Belgium
Narys nuo spal. 2020
vim

And I now get this

tim
Founder
Nuo Sweden
Narys nuo geg. 2013
tim

I should be able to sort out any problems you have if you can create a support ticket.

vim
LiteCart Fan
Nuo Belgium
Narys nuo spal. 2020
vim

Done! Thanks in advance.

tim
Founder
Nuo Sweden
Narys nuo geg. 2013
tim

I won't be able to do this until tomorrow. Loooong day.

vim
LiteCart Fan
Nuo Belgium
Narys nuo spal. 2020
vim

No problemo.

tim
Founder
Nuo Sweden
Narys nuo geg. 2013
tim

It seems that your PHP server is preconfigured to use timezone Europe/Amsterdam but that timezone has been removed from the server.
This produced an error message on every page load, even ajax requests.

[quote]Warning: strtotime(): Invalid date.timezone value '“Europe/Amsterdam”', we selected the timezone 'UTC' for now.[/quote]

I added this to includes/config.inc.php
date_default_timezone_set('Europe/Brussels');

That solved the problem and I seem to be able to add options and assign stock options without error.

There are two more issues you must ask the server manager to resovle:

PHP is compiled with the wrong version of mysql drivers. Giving this error:
[quote]Warning: mysqli_real_connect(): Headers and client libray minor version mismatch. Headers:100337 Library:30120[/quote]

There is also an old set of mysqli drivers called libmysql which are deprecated since php 5.4. Use mysqlnd instead. Some cpanels calls it nd_mysqli.
[quote]Warning: Undefined constant MYSQLI_OPT_INT_AND_FLOAT_NATIVE. Make sure you enabled the PHP extension mysqlnd which is the recommended driver since PHP 5.4 instead of libmysql.[/quote]

vim
LiteCart Fan
Nuo Belgium
Narys nuo spal. 2020
vim

Thanks very much for your professional assistance!!!
Will continue the Webshop setup soon and not hesitate to buy an add-on if appropriate.
I will get in touch with the server manager also.

vim
LiteCart Fan
Nuo Belgium
Narys nuo spal. 2020
vim

I was going to claim that there is no change in behaviour... but then I quickly tried it in my Edge browser instead of Firefox which I used sofar.
There is no problem to select existing Attributes or Options for a product in Edge but the behaviour in Firefox has not changed from my first post.
I attach a screenshot from the Firefox browser.
Sorry that I pushed your inquiry in the wrong direction but you have at least pointed out some problems on the server.

tim
Founder
Nuo Sweden
Narys nuo geg. 2013
tim

Chrome is ok, Fireforx retruns a fatal error:
[quote]Uncaught Error: Syntax error, unrecognized expression: select[name="new_attribute[value_id]"[/quote]

The command that crashes:
$('select[name="new_attribute[value_id]"').html('');

I don't see anything wrong with it. I wonder if this is an internal issue with the jQuery framework and Firefox.
I will do some thinking and get back to you.

When something is an anomaly on the web it's about ALWAYS in Firefox.

vim
LiteCart Fan
Nuo Belgium
Narys nuo spal. 2020
vim

I was about to modify my file accordingly... but found out that you did that for me. Works fine now in FireFox.
Thanks for helping and glad to have assisted in finding this minor issue.

Project Leader
Nuo Slovak Republic
Narys nuo vas. 2023

Hi Tim,

the same problem with missing square bracket is also for variables:

"new_user_input_option", starting at line 1269 (file: edit_product.inc.php)
and "new_predefined_option", starting at line 1240 (file: edit_product.inc.php)

I suggest to check all occurrences.

tim
Founder
Nuo Sweden
Narys nuo geg. 2013
This thread has been closed due to long inactivity. Posting to it is not possible.
This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.