Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: Unknown AJAX Error  (Read 15463 times)

Offline Ollie

  • Sr. Member
  • ****
  • Posts: 253
  • Karma: +28/-1
    • View Profile
    • Assistech
Unknown AJAX Error
« on: September 16, 2014, 11:50:03 PM »
I'm getting an "Unknown Ajax Error" when adding to cart from this category page in French: http://fr.assistech.com/store/magnifiers (Fr. "ajouter au panier" for adding to cart)

I tried the workaround provided by Abolabo at http://forum.abantecart.com/index.php/topic,2473.0.html , but it did not work for me.

I noticed this problem only happens when I'm in a language subdomain such as "fr" for French or "es" for Español. If I switch to English --> http://assistech.com/store/magnifiers , the error is gone. However, if I select English from the language dropdown menu, it adds an "en" prefix to the URL, therefore causing the same error.

Please note: I'm not using the built-in translator that comes with Abantecart. I use a third-party solution that requires adding a language prefix to the URL.

I appreciate if anybody could tell me what needs to be done to fix this error. Thank you!
« Last Edit: September 16, 2014, 11:55:04 PM by Ollie »
Assistive technologies for people with special needs:
https://assistech.com/store/

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2171
  • Karma: +345/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Unknown AJAX Error
« Reply #1 on: September 17, 2014, 05:37:49 AM »
did you tried to fill missing descriptions for product options (global attributes) for other languages? i mean subform on language edit page. If yuo created some attribute and fill some description for it in english and then added new language you should to set descriptions for new language.
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline Ollie

  • Sr. Member
  • ****
  • Posts: 253
  • Karma: +28/-1
    • View Profile
    • Assistech
Re: Unknown AJAX Error
« Reply #2 on: September 17, 2014, 06:32:49 AM »
did you tried to fill missing descriptions for product options (global attributes) for other languages?
No, I haven't tried that. How do I get to global attributes for other languages? Please tell me step by step. Thank you.
Assistive technologies for people with special needs:
https://assistech.com/store/

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2171
  • Karma: +345/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Unknown AJAX Error
« Reply #3 on: September 17, 2014, 07:39:22 AM »
admin menu system->localization->languages. Choose new language -> edit. Look at second form "Load missing language data".
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline Ollie

  • Sr. Member
  • ****
  • Posts: 253
  • Karma: +28/-1
    • View Profile
    • Assistech
Re: Unknown AJAX Error
« Reply #4 on: September 17, 2014, 10:04:36 AM »
I went to localization and selected Turkish. Under "Load missing language data" I typed in "English" as the source language, then clicked "Load". Then I cleared my cache files both in Abantecart and my browser. I tested a page in Turkish, but I keep getting the same error.
Assistive technologies for people with special needs:
https://assistech.com/store/

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2171
  • Karma: +345/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Unknown AJAX Error
« Reply #5 on: September 17, 2014, 01:39:01 PM »
give me url of product that you tried
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline Ollie

  • Sr. Member
  • ****
  • Posts: 253
  • Karma: +28/-1
    • View Profile
    • Assistech
Re: Unknown AJAX Error
« Reply #6 on: September 17, 2014, 01:58:21 PM »
Assistive technologies for people with special needs:
https://assistech.com/store/

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2171
  • Karma: +345/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Unknown AJAX Error
« Reply #7 on: September 17, 2014, 03:33:55 PM »
you have issue with cookies. Abantecart set cookie for your domain, but you created a lot of subdomain such as ru. fr. es. etc that have it's own cookie scope
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline Ollie

  • Sr. Member
  • ****
  • Posts: 253
  • Karma: +28/-1
    • View Profile
    • Assistech
Re: Unknown AJAX Error
« Reply #8 on: September 17, 2014, 05:57:10 PM »
you have issue with cookies. Abantecart set cookie for your domain, but you created a lot of subdomain such as ru. fr. es. etc that have it's own cookie scope
How can I get his resolved?
Assistive technologies for people with special needs:
https://assistech.com/store/

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2171
  • Karma: +345/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Unknown AJAX Error
« Reply #9 on: September 18, 2014, 08:11:02 AM »
i see 2 solutions:
 - turn off subdomains for localization version of site
 - add "hardcoded" domain into cookie set
(open file public_html/core/lib/session.php and replace $path =  dirname($_SERVER[ 'PHP_SELF' ]); to  $path = "assistech.com"; at line 60)
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline Ollie

  • Sr. Member
  • ****
  • Posts: 253
  • Karma: +28/-1
    • View Profile
    • Assistech
Re: Unknown AJAX Error
« Reply #10 on: September 18, 2014, 09:34:30 AM »
i see 2 solutions:
 - turn off subdomains for localization version of site
 - add "hardcoded" domain into cookie set
(open file public_html/core/lib/session.php and replace $path =  dirname($_SERVER[ 'PHP_SELF' ]); to  $path = "assistech.com"; at line 60)
Are these solutions mutually exclusive or part of the same solution? I need the subdomains in order for the 3rd party translation to work properly, which means turning off subdomains is not an option. What do you suggest?
« Last Edit: September 18, 2014, 09:46:14 AM by Ollie »
Assistive technologies for people with special needs:
https://assistech.com/store/

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2171
  • Karma: +345/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Unknown AJAX Error
« Reply #11 on: September 18, 2014, 09:46:54 AM »
yes. cookie for domain cover all subdomains
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline Ollie

  • Sr. Member
  • ****
  • Posts: 253
  • Karma: +28/-1
    • View Profile
    • Assistech
Re: Unknown AJAX Error
« Reply #12 on: September 18, 2014, 10:29:45 AM »
yes. cookie for domain cover all subdomains

Sorry, your answer is not clear. I asked if the proposed solutions are mutually exclusive or two steps for the same solution. You gave me a yes answer. Yes to what? Please clarify. How can I keep the subdomains and get rid of the Ajax error? What happens if I add "hardcoded" domain into cookie set? Will it get rid of all subdomains? That's not clear to me. I appreciate an answer all my questions. I don't want to implement anything unless I know for sure what I'm doing. Thank you.
« Last Edit: September 18, 2014, 12:35:32 PM by Ollie »
Assistive technologies for people with special needs:
https://assistech.com/store/

Offline Ollie

  • Sr. Member
  • ****
  • Posts: 253
  • Karma: +28/-1
    • View Profile
    • Assistech
Re: Unknown AJAX Error
« Reply #13 on: September 18, 2014, 12:59:58 PM »
I found a workaround to get rid of the Ajax error. Under System > Settings > Checkout, I disabled "Same Page Add To Cart". Product is now being added to cart and I'm directed to the Shopping Cart page without any Ajax error.
Assistive technologies for people with special needs:
https://assistech.com/store/

 

Powered by SMFPacks Social Login Mod