Adding variants causes 500 internal server error

  • Posts: 55
  • Thank you received: 0
11 years 11 months ago #83611

Hi, when adding characteristics to a product I am running into a major problem.

I added my characteristics one by one and saved them after each addition.

After I added each characteristic I went to 'manage variants' and deleted the unnecessary ones.

I checked my front-end after each characteristic was added.

The first four characteristics worked with no problem, but the 5th caused the 500 error.

Numbers of variants are running into hundreds at this stage... could it be a question of php memory allocation?
At one point I was receiving a fatal error saying exactly this, but it stopped after I attempted to delete and start over.
Now I just get the 500 error constantly, but it works agin when I trash the 5th characteristic.
Also thought it could be duplicate database entries, but I manually deleted everything I added for this item, and the problem still persists when I recreate the characteristics & variants. Please help!

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

  • Posts: 55
  • Thank you received: 0
11 years 10 months ago #83680

The last few days have made me want to ditch hikashop entirely. It cannot handle products with multiple variants!! I have just spent the last days manually deleting thousands of database entries, as I made a mistake with my variants in the back end. I guess because I deleted some variants and characteristics, the next time i attempted to recreate them I got ridiculous errors.

For one product, I have 3 characteristics enabled, but on the product page it shows a fourth dropdown, with no label, because something is using the same codes or something!! It is in no way obvious what is occurring here and it's causing me to completely lose patience.

Also, REALLY unacceptable - since I added Options to some products, when I add them to the cart it gives the error message "The combined weight of your order is too big for all the possible shipping methods" - but it ISN'T... I have all weights correctly configured and it's nothing to do with the weights, it's to do with some database problem or SOMETHING.... When I delete all Options and Characteristics, it works again...

Also, products which have absolutely no problem (as far as I can see) with their variants and characteristics are not working correctly either. After I added Options to one single product, it seems to have affected everything.

It SHOULD be possible to select your required characteristics values BEFORE generating the variants so you don't need to spend forever manually deleting extraneous ones.

It SHOULD at least be possible to alter the ordering of the columns on the backend so it's a LITTLE bit easier to delete variants, if I could order them by ID it would be a lot easier to navigate - surely that would be an easy fix!!??

Furthermore, I need these variants. I'm making a bike shop and some of these high-end bikes require a lot of customization. Options don't really cut it - the WHOLE point of characteristics is to make values that can be used by more than one product, so if my (eg) colours are different between two products, I need to make a whole new Option product. This could mean I have to manually create hundreds of new products just to have Options.

Also, if someone orders more than one item, the cart looks messy - the products are at the top, and the options are in a long list at the bottom, and it's not clear to the customer which option goes with which.

So, to recap - when the user makes mistakes with variants, the user gets cast into a hell which will takes days to fix. Even when all variants are configured correctly, there are still problems with Shipping methods and Options, causing unknown conflicts. Just so it's clear - I'm on unlimited hosting which allows me 64M of memory, so it should not be anything to do with that.

So what now? All of the work I've done adding characteristics and options will have to be painstakingly deleted and the database thoroughly checked to make sure none of the unneeded crap is still there.... unless you have a better suggestion? And when I need to create a product with 2*5*3*3*3 variants, how can I do this? By using a different piece of software? I really hope not as I've been a supporter of Hikashop for a long time - but also see that many, many people have requested a fix for these problems, over years, and there doesn't seem to be much effort being made in that direction. Please assist asap!!

OK - found out that the shipping problem is happening because the main product weight is not being applied to all variants, maybe because I attempted to generate variants previously (which I then had to delete) before I added weights to certain products. Again, it looks like the only ways to fix this is to change the variant weights one by one or manually delete the database entries and redo the characteristics all over again... is there a simpler way?

Last edit: 11 years 10 months ago by jen168.

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
11 years 10 months ago #83944

Hi,

Characteristics/Variants are not meant to be used with several hundred of possibilities. It's meant to be used for case when you want specific prices/quantities for each variant of a product. Like when you have a shirt with different quantities for different sizes/colors. So it's not that we don't want to fix that but it's just that it's not meant to be used like that.

In your case, I think that you should rather use custom item fields. You can create them via the menu Display->Custom fields. That will allow you to add dropdowns/checkboxes/radios, etc on your product page so that your user can say exactly what he wants and there won't be any limit to their number.
The drawback from characteristics/variants is that you can't have different prices/quantities for each variant with them. But in that case, it's potentially possible to mix characteristics/custom item fields/options together.

If you have the options on separate lines on the cart instead of having them grouped with their products, it's because you turned off the option "group options with product" in the Checkout tab of the configuration.

Regarding the issue with the weight and variants, that has already been fixed on our end and will be in the next release of HikaShop. If you use the latest version of HikaShop (2.0), you can change the file administrator/components/com_hikashop/classes/cart.php with the one in the archive enclosed and that should solve the problem.

Attachments:

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

  • Posts: 55
  • Thank you received: 0
11 years 10 months ago #84009

Thanks as always for the great support, and I hope you had an excellent Christmas and New Year. I've switched off the group options with products, that makes a great visual difference to the checkout. I've also replaced the cart.php.

Now, my products that I have added options to are throwing up an error message when I try to add to cart: "the Product xxx is not available". The 'products' are my 3 options, ie Bar Size, Stem Size, Crank Length, and they are all avilable in unlimited quantities. Any ideas? I've tried deleting and re-adding to no avail.

Another thing - for my complex products, if the user selects the first option/characteristic of a product, I need the remaining options to be limited depending on that first choice. If the Frame Size is 45, the Bar Size can only be 90/43 or 90/45. But Bar Size has 5 values and I'm not sure how to prevent the user from selecting whichever they want. I've seen threads where the proposed solution seems to be that out of stock variants do not show on the front end - if I can't use variants as I have too many, what are my options?

Also, when I was using variants, even when I selected the 'hide out of stock products' option it still shows every single possible combo, many of which are in fact not available. Is there a solutio for this? Thanks in advance :)

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

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
11 years 10 months ago #84195

Hi,

Would it be possible to have a link to your store ?

Regards,


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.

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

  • Posts: 55
  • Thank you received: 0
11 years 10 months ago #84479

Here is the link www.commuter-hub.com . Right now I've switched off the problematic variants, but I will switch them back on today so you can look. One other thing - I have some CSS-related problem with my carousel slider, I wonder if you could take a look and point me in the right direction? The two 'slides' (i think) are doubled over each other... Thanks in advance :)

Last edit: 11 years 10 months ago by jen168.

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

  • Posts: 55
  • Thank you received: 0
11 years 10 months ago #84481

OK... I played around with some more and now it just seems as though the javascript isn't working... I'm not really too knowledgeable with javascript so I have no idea what's going wrong here :(

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

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #84536

Hi,

It seems that jQuery is missing, or you have maybe a conflict between jQuery and Mootools, try to install jQuery easy, you can find it on extensions.joomla.org

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

  • Posts: 55
  • Thank you received: 0
11 years 10 months ago #84552

OK, I've switched off the JCH optimize plugin, that's fixed it. I presume there's some kind of problem with my template so I'll look into it further. Also, I'll let you know when the problematic variants have been re-enabled.

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

  • Posts: 55
  • Thank you received: 0
11 years 10 months ago #84600

One last thing - I have just moved to a VPS from my previous hosting and I am now experiencing a problem with the VAT number check, it's giving the error message "The online VAT number check needs the SOAP extension for PHP. If you don't have it, please install it and then activate it. Otherwise, deactivate the online VAT number check." When I check my php settings I see "--enable-soap=shared". What do my php settings need to be, and if you have any advice on installing/upgrading php-soap I'd be most grateful as everything I've done so far has drawn a blank....

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

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
11 years 10 months ago #84686

Hi,

"php_soap" is a php extension (module) like "php_mysql" or "php_gd2".
php.net/manual/en/book.soap.php

You should check your php.ini file and enable the "soap" extension by uncomment the line

extension=soap.so

Regards,


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.

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

  • Posts: 55
  • Thank you received: 0
11 years 10 months ago #84746

OK, that line wasn't in my php.ini file... I added it, I hope that is the right thing to do. There are some lines about soap:
[soap]
soap.wsdl_cache_ttl = 86400
soap.wsdl_cache_enabled = 1
soap.wsdl_cache_dir = "/tmp"

What does this mean? Does it mean I need a different version of soap? Your help is much appreciated! :)

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

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
11 years 10 months ago #84751

Hi,

The way to activate soap could be different depending the system.
In some PHP version, soap is included and enabled by default. In other (like in Windows version or some custom build) it could be configured as an external module.

In linux, you can use this command in the command line (ssh):

php -i | grep "Soap"
And you should see
Soap Client => enabled
Soap Server => enabled
(the "S" in capslock is important).

You can call
php -m
And check if "soap" is listed in the modules.

Regards,


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.

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

  • Posts: 55
  • Thank you received: 0
11 years 10 months ago #84754

This is what it tells me when I run the first command: Unable to load dynamic library '/usr/lib64/php/modules/soap.so
As I expected, Soap is not listed when I run the second command.
So I need to configure it... I have been attempting to follow various tutorials but my php is not strong enough to get my head around what I'm doing wrong. If you can aid in any way that'd be great... I'm running Centos 6.3. Thanks :)

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

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
11 years 10 months ago #84756

Hi

Thanks to

yum search soap | grep php
You should see which are available soap modules for PHP.
And the generic package should works fine
yum install php-soap
(validate the install with "Y") and after that, restarting your web-server to reload PHP and its modules.

Regards,


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.

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

  • Posts: 55
  • Thank you received: 0
11 years 10 months ago #84760

OK, I managed to install a version of soap and now it lists it with the second command, and this is what I get from the first command:

PHP Warning: Module 'soap' already loaded in Unknown on line 0
PHP Warning: Unknown: It is not safe to rely on the system's timezone settings. You are
*required* to use the date.timezone setting or the date_default_timezone_set() function.
In case you used any of those methods and you are still getting this warning, you most li
kely misspelled the timezone identifier. We selected 'UTC' for 'GMT/0.0/no DST' instead i
n Unknown on line 0
Soap Client => enabled
Soap Server => enabled

Also in my frontend I now see:

"SoapFault exception: [soap:Server] MS_UNAVAILABLE in /var/www/vhosts/commuter-hub.com/httpdocs/administrator/components/com_hikashop/helpers/vat.php:168 Stack trace: #0 /var/www/vhosts/commuter-hub.com/httpdocs/administrator/components/com_hikashop/helpers/vat.php(168): SoapClient->__call('checkVat', Array) #1 /var/www/vhosts/commuter-hub.com/httpdocs/administrator/components/com_hikashop/helpers/vat.php(168): SoapClient->checkVat(Array) #2 /var/www/vhosts/commuter-hub.com/httpdocs/administrator/components/com_hikashop/helpers/vat.php(68): hikashopVatHelper->onlineCheck('GB144394408') #3 /var/www/vhosts/commuter-hub.com/httpdocs/administrator/components/com_hikashop/classes/currency.php(69): hikashopVatHelper->isValid(Object(stdClass)) #4 /var/www/vhosts/commuter-hub.com/httpdocs/administrator/components/com_hikashop/classes/currency.php(91): hikashopCurrencyClass->getTaxType() #5 /var/www/vhosts/commuter-hub.com/httpdocs/administrator/components/com_hikashop/classes/currency.php(27): hikashopCurrencyClass->getTax(4062, '11') #6 /var/www/vhosts/commuter-hub.com/httpdocs/administrator/components/com_hikashop/classes/currency.php(1828): hikashopCurrencyClass->getTaxedPrice('1416.66000', 4062, '11', 2) #7 /var/www/vhosts/commuter-hub.com/httpdocs/administrator/components/com_hikashop/classes/currency.php(1180): hikashopCurrencyClass->addTax(Array, Object(stdClass), Array, 4062, '11') #8 /var/www/vhosts/commuter-hub.com/httpdocs/administrator/components/com_hikashop/classes/currency.php(1121): hikashopCurrencyClass->removeAndAddPrices(Object(stdClass), Array, Array, 4, 4, 4062) #9 /var/www/vhosts/commuter-hub.com/httpdocs/administrator/components/com_hikashop/classes/cart.php(1085): hikashopCurrencyClass->getPrices(Array, Array, 4, 4, 4062, 1) #10 /var/www/vhosts/commuter-hub.com/httpdocs/components/com_hikashop/controllers/checkout.php(875): hikashopCartClass->loadFullCart(true) #11 /var/www/vhosts/commuter-hub.com/httpdocs/components/com_hikashop/controllers/checkout.php(908): checkoutController->initCart() #12 /var/www/vhosts/commuter-hub.com/httpdocs/components/com_hikashop/controllers/checkout.php(342): checkoutController->before_payment() #13 /var/www/vhosts/commuter-hub.com/httpdocs/libraries/joomla/application/component/controller.php(761): checkoutController->step() #14 /var/www/vhosts/commuter-hub.com/httpdocs/components/com_hikashop/hikashop.php(69): JController->execute('') #15 /var/www/vhosts/commuter-hub.com/httpdocs/libraries/joomla/application/component/helper.php(383): require_once('/var/www/vhosts...') #16 /var/www/vhosts/commuter-hub.com/httpdocs/libraries/joomla/application/component/helper.php(351): JComponentHelper::executeComponent('/var/www/vhosts...') #17 /var/www/vhosts/commuter-hub.com/httpdocs/includes/application.php(197): JComponentHelper::renderComponent('com_hikashop') #18 /var/www/vhosts/commuter-hub.com/httpdocs/index.php(42): JSite->dispatch() #19 {main}"

Any ideas? Thanks in advance

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

  • Posts: 55
  • Thank you received: 0
11 years 10 months ago #84763

Fixed - I had previously attempted to add the line extension=soap.so to my php.ini file, now that I've removed it I no longer get the error message. Thanks for the support.

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

  • Posts: 55
  • Thank you received: 0
11 years 10 months ago #84772

Looks like I spoke too soon - I started getting the same error as above again. Could it be something to do with me changing the path to my tmp folder? It was incorrectly configured after the server move... looks like the wsdl.cache_dir may now have the wrong path in the settings? not sure but will look into it and update...

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

  • Posts: 55
  • Thank you received: 0
11 years 10 months ago #84775

Yup... looks like the missing trailing slash fixed it... sorry for the stream-of-consciousness posts, hopefully it'll be useful to someone else :)

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

  • Posts: 55
  • Thank you received: 0
11 years 10 months ago #84777

NO, that wasn't it! It's started happening again! Is it to do with the checking service being down, as I saw in another thread? I get the feeling it's to do with a misconfiguration... argh! it's not the most crucial aspect of the site as it's only a feature for business customers obviously and I don't expect that many of them, at least at first, but I need to have it working anyway... If you can shed any further light on the matter i'd be most grateful...

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

Time to create page: 0.104 seconds
Powered by Kunena Forum