Cart not working when logged in

  • Posts: 9
  • Thank you received: 0
8 years 6 months ago #1791

I'm sure I'm missing something simple. My shopping cart works fine when you add something to the cart, then register and continue on [it transfers to PayPal].

But when a returning customer is logged in, clicking on the "Add to Cart" button leads to an Error 500 - Internal server error instead of going to the cart.

Thoughts?

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

  • Posts: 65706
  • Thank you received: 9590
  • MODERATOR
8 years 6 months ago #1792

What is the URL of the page ?
If you activate the debug mode of Joomla and try again, do you get some kind of error ?
Otherwise, could you try again after activating the errors display of your server via your php.ini like explained there : www.hikashop.com/en/support/documentation/59.html#errors

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

  • Posts: 9
  • Thank you received: 0
8 years 6 months ago #1798

The site is larrysjugs.com (a collector's pottery site).

I turned on the debug option and the error I get is: 500 - JDatabaseMySQL::query: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '5,6,3) AND file_type = 'product'' at line 1 SQL=SELECT * FROM jos_hikashop_file WHERE file_ref_id IN (,5,6,3) AND file_type = 'product'

?

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

  • Posts: 65706
  • Thank you received: 9590
  • MODERATOR
8 years 6 months ago #1803

Could you replace the code

$ids = array_keys($cart->products);
by the code
$ids = array_keys($cart->products);
			JArrayHelper::toInteger($ids);
near line 270 of the file administrator/components/com_hikashop/classes/cart.php and try again ?

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

  • Posts: 9
  • Thank you received: 0
8 years 6 months ago #1806

Nope, didn't work.

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

  • Posts: 65706
  • Thank you received: 9590
  • MODERATOR
8 years 6 months ago #1807

What do you mean ? Do you have the same SQL query error ?

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

  • Posts: 9
  • Thank you received: 0
8 years 6 months ago #1808

Sorry, had to turn off Debug so client could look at it. But with it back on, now it's not showing a specific error. Just a Error 500 - Internal server error.

I also put a link on the Store to access the customer's cart, and that shows the same thing.

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

  • Posts: 65706
  • Thank you received: 9590
  • MODERATOR
8 years 6 months ago #1809

I just tried on your website to register. Then, I got logged in. I removed the items from my cart. Then, I added other items.
I couldn't reproduce that 500 error.

I see that you use an old version of HikaShop. You should try to update. It might help.

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

  • Posts: 9
  • Thank you received: 0
8 years 6 months ago #1810

I've downloaded the new version. It's still giving me errors when I click on "Your Cart" when logged in and when I cancel my order in PayPal & attempt to go add a new item to the cart.

This doesn't happen with a new user. Is there any way to set it up so a user doesn't have to register? Could they just provide all of their information for shipping without having to login the next time they want to purchase something?

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

  • Posts: 65706
  • Thank you received: 9590
  • MODERATOR
8 years 6 months ago #1811

Could you try to logout/login and try again ?

Could you try again after activating the errors display of your server via your php.ini like explained there : www.hikashop.com/en/support/documentation/59.html#errors

If you want us to help you fix that 500 error we need to see why that error happens. Without that, we don't know from where the error comes and why it comes and how we could fix it.

With the commercial version of HikaShop, you can activate a simplified registration option. The user will be registered automatically by just entering his email. He will always be able to order without logging in by entering another email, but there is no way yet in HikaShop to have orders without a user linked to it.

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

  • Posts: 9
  • Thank you received: 0
8 years 6 months ago #1812

OK, this is the full error I get when both trying to add a new item to the cart after I've logged in and canceled a PayPal purchase AND clicking on "Your Cart":

JDatabaseMySQL::query: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '5,3,8) AND file_type = 'product'' at line 1 SQL=SELECT * FROM jos_hikashop_file WHERE file_ref_id IN (,5,3,8) AND file_type = 'product'

Call stack
# Function Location
1 jsite->dispatch() /homepages/22/d224844873/htdocs/joomla/index.php:68
2 jcomponenthelper::rendercomponent() /homepages/22/d224844873/htdocs/joomla/includes/application.php:124
3 require_once() /homepages/22/d224844873/htdocs/joomla/libraries/joomla/application/component/helper.php:162
4 checkoutcontroller->execute() /homepages/22/d224844873/htdocs/joomla/components/com_hikashop/hikashop.php:36
5 checkoutcontroller->step() /homepages/22/d224844873/htdocs/joomla/libraries/joomla/application/component/controller.php:236
6 checkoutcontroller->before_shipping() /homepages/22/d224844873/htdocs/joomla/components/com_hikashop/controllers/checkout.php:158
7 hikashopcartclass->loadfullcart() /homepages/22/d224844873/htdocs/joomla/components/com_hikashop/controllers/checkout.php:526
8 jdatabasemysql->loadobjectlist() /homepages/22/d224844873/htdocs/joomla/administrator/components/com_hikashop/classes/cart.php:275
9 jdatabasemysql->query() /homepages/22/d224844873/htdocs/joomla/libraries/joomla/database/database/mysql.php:458
10 jerror::raiseerror() /homepages/22/d224844873/htdocs/joomla/libraries/joomla/database/database/mysql.php:231
11 jerror::raise() /homepages/22/d224844873/htdocs/joomla/libraries/joomla/error/error.php:171
12 jexception->jobject() /homepages/22/d224844873/htdocs/joomla/libraries/joomla/error/error.php:136
13 call_user_func_array() /homepages/22/d224844873/htdocs/joomla/libraries/joomla/base/object.php:48
14 jexception->__construct()

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

  • Posts: 65706
  • Thank you received: 9590
  • MODERATOR
8 years 6 months ago #1813

Of course, after your update of HikaShop, you had to reapply the change of code I talked about on the post www.hikashop.com/support/forum/3-bug-rep...in.html?lang=en#1803 to avoid that error. Please reapply that fix and try again.

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

  • Posts: 9
  • Thank you received: 0
8 years 6 months ago #1814

Right, sorry. Well, I've turned display errors on, am in Debug & still all I see when clicking on add to cart is Error 500 - Internal server error
An internal server error has occured!
Please try again later.

Before I log in, I also see this notice: Notice: Only variables should be assigned by reference in [further filepath deleted]components/com_hikashop/controllers/checkout.php on line 633

Sorry if this is a server error. The client's hosting is on 1&1, which I know has had issues using Joomla. However I have used it before & it's worked out. First time using Hikashop though.

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

  • Posts: 65706
  • Thank you received: 9590
  • MODERATOR
8 years 6 months ago #1816

This notice is not related to the problem.

I would be happy to debug the issue on your website. However, I can't reproduce on your website the problem you have and it's not possible to fix a problem you can't reproduce. You said it worked with another user account, right ? Then, could you give me your user access so that I can try to reproduce the problem ? (you can send me the details to This email address is being protected from spambots. You need JavaScript enabled to view it.). There must be a problem with your user account since it always works with other users...

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

  • Posts: 65706
  • Thank you received: 9590
  • MODERATOR
8 years 6 months ago #1835

Hi,

I was indeed able to reproduce the problem on your website. Now we would need the apache log of the error. Since 1and1 doesn't provide the logs for shared hosting they propose another solution:

Could you try to add that code at the beginning of the index.php ( after the php start tag ) which is in the root directory of your joomla website and try again to get the error:
faq.1and1.com/miscellaneous/15.html

That should write a file called errors.csv in the root directory of your joomla website. Could you download that file with FTP and upload it with your next post ?

You can then remove that modification.

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

  • Posts: 9
  • Thank you received: 0
8 years 6 months ago #1858

Attached is the csv file. Thanks so much for your help!

File Attachment:

File Name: errors.csv
File Size:29 KB

Attachments:

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

  • Posts: 65706
  • Thank you received: 9590
  • MODERATOR
8 years 6 months ago #1860

Hi,

Thanks to the access you provided as well as the errors.csv file, we were able to trace the problem and correct it.
It's a strange case which doesn't happen normally. Anyway, the problem is fixed on your website and will be included in next releases of HikaShop.

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

  • Posts: 9
  • Thank you received: 0
8 years 6 months ago #1861

Awesome! Thanks for the great support!

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

Time to create page: 0.084 seconds
Powered by Kunena Forum