Error undefined ocstore

Solution for "error undefined" message in V2.2.0.0

Solution for «error undefined» message in V2.2.0.0


The ever so annoying «error undefined» message is really stating that you are attempting to do a cross-domain operation. All this really means is that you must force OpenCart to use either HTTP or HTTPS but not both. The real message should probably be «Cross-Origin Request Blocked»

If your browsers URL is HTTP the add to cart operation is HTTPS you will get this message and the reverse is true also.

This is a job for your .htaccess file and setting all your operations in OpenCart to the same protocol. You will need to do some coding changes to accomplish this task.

This will solve your issue. You will need to make some code changes

Fix: Force Admin to SSL — 20160306 — daniGo — v1.0.0

Fix: Force URL’s in store to be terminated properly with a trailing slash or any store without trailing slash will default to main store. Force HTTPS protocol to HTTPS if SSL is selected in store settings — v1.0.3

These as well as other fixes can be found here

Last edited by Randem on Mon Apr 04, 2016 7:15 am, edited 2 times in total.


NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
«Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?»
DO NOT EVER GIVE SOMEONE YOU DON»T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar


Re: Solution for «error undefined» message in V2.2.0.0


Post

by Randem » Sat Apr 02, 2016 4:13 pm

Sample .htaccess file to redirect to HTTPS

Code: Select all


Options +FollowSymlinks

# Prevent Directoy listing 
Options -Indexes

# Prevent Direct Access to files
<FilesMatch ".(tpl|ini|log)">
 Order deny,allow
 Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On
#RewriteCond %{HTTPS} on
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

#SSL Port
RewriteCond %{SERVER_PORT} !=443

# Remove www. from any domain query
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1%{REQUEST_URI} [R=301,L]

# All broswer request get redirected to HTTPS
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/ 

RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]


NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
«Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?»
DO NOT EVER GIVE SOMEONE YOU DON»T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar


Re: Solution for «error undefined» message in V2.2.0.0


Post

by Randem » Sun Apr 03, 2016 4:29 am

This also means you can’t use a combination of different domain entries such as

https://www.yourdomain.com
https://yourdomain.com
http://www.yourdomain.com
http://yourdomain.com

A mix of these names will cause the error also. Every reference to your OpenCart site must be exactly the same. The names are not interchangeable. You can handle this in your .httaccess file by forcing one or the other but you also need to change the references in your store setting, orders etc… to match.


NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
«Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?»
DO NOT EVER GIVE SOMEONE YOU DON»T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar


Re: Solution for «error undefined» message in V2.2.0.0


Post

by Randem » Mon Apr 04, 2016 7:09 am

BTW: If you have orders from another store URL in the order table because you are transferring the data to a new domain you will need to change the URLs in the orders or you will get this error again if you attempt to edit them (Not a good idea anyway).


NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
«Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?»
DO NOT EVER GIVE SOMEONE YOU DON»T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar


Re: Solution for «error undefined» message in V2.2.0.0


Post

by makdykstra » Fri Apr 22, 2016 11:07 am

Randem … this is the first thread I’ve seen on this issue!! THANK YOU!! For a novice Opencart user like myself, could you explain in more detail what I should do?? If you don’t mind breaking it down as simply as you could. My cart was working perfectly and now all of the sudden the undefined error message is displaying and customers can’t add to their carts.

Thanks so much!! I’m at: www.mindyourmannersmonsters.org

Re: Solution for «error undefined» message in V2.2.0.0


Post

by inertia » Tue Apr 26, 2016 11:25 pm

I am using OC 2.1.0.1 and since I have just started to use SSL (a requirement for Amazon’s payment system) I an getting the Error Undefined and also I cannot edit any orders.

Will your suggestions fix both of my problems?

on a side note, I am not a programmer so excuse any stupid questions.

So, If I change my .htaccess file so that all of my pages are HTTPS will solve my 2 issues?

Re: Solution for «error undefined» message in V2.2.0.0


Post

by Randem » Wed Apr 27, 2016 2:23 am

No… you will need to the instructions and apply the fixes follow. You will need to learn how things work or you will need to get someone to apply them for you.

No Magic bullets…


NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
«Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?»
DO NOT EVER GIVE SOMEONE YOU DON»T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar


Re: Solution for «error undefined» message in V2.2.0.0


Post

by Kudzai » Thu Apr 28, 2016 7:01 am

I keep getting the «error undefined» message when I try to add something to the cart. I am using the default theme on an http server (not https) How can I fix that?

Re: Solution for «error undefined» message in V2.2.0.0


Post

by integris » Fri Jun 24, 2016 12:30 am

This will solve your issue. You will need to make some code changes
Fix: Force URL’s in store to be terminated properly with a trailing slash or any store without trailing slash will default to main store. Force HTTPS protocol to HTTPS if SSL is selected in store settings — v1.0.3

These as well as other fixes can be found here

I wanted my site to be https/www for all pages. Installing the v2.2.changes.zip up above didn’t do it. I compiled all the steps into one answer on this stackexchange question:

http://stackoverflow.com/questions/3627 … 3#37996993

Re: Solution for «error undefined» message in V2.2.0.0


Post

by recseiuq » Tue Jun 28, 2016 4:28 pm

Hi Randem, could I ask a couple of questions?

1. I am running 2.2.0.0 with your 2.2.0.x fixes and I am getting the «Error Unknown» issue when trying to install the Acute Category Manager extension. My site is fully SSL as far as I can tell, so it doesn’t seem like it’s the result of mixing HTTP & HTTPS. I have left a comment on the extension’s homepage but have not had any response from the developer so far. Do you know any way to find out more about what’s causing the error? I’ve checked my webserver (NGINX) and PHP5-fpm logs but there’s no sign of what’s causing this.

2. Do you not recommend people use 2.2.0.0, even with your abovementioned fixes? Is there a discussion of the issues with that version somewhere?

Thanks in advance. And thanks for your excellent work.

Re: Solution for «error undefined» message in V2.2.0.0


Post

by Randem » Tue Jun 28, 2016 5:15 pm

Hi recseiuq,

Thank you and you are welcome!

1. If you only get this error when you attempt to install the Acute Category Manager package, it would seem that the package is attempting to do something strange or at least in a manner not working with version 2.2.0.0. Since the package is using OCMOD; I cannot help you with that part (not Verses in OCMOD Procedures); If it were VQMOD I could help you track it down better with VQMOD Manager. What is in the OCMOD log?

Have you attempted to install it in a clean OpenCart system with no MODS? Without SSL?

2. I would recommend using OpenCart Version 2.1.0.x for it is more stable with the fixes.


NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
«Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?»
DO NOT EVER GIVE SOMEONE YOU DON»T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar


Re: Solution for «error undefined» message in V2.2.0.0


Post

by straightlight » Tue Jun 28, 2016 7:42 pm

Take note that the errors can also be tracked from the admin — > systems — > tools — > error log page despite whether it comes from VQMod or OCMod.


Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester




Joined

Mon Nov 14, 2011 11:38 pm

Location —
Canada, ON

Re: Solution for «error undefined» message in V2.2.0.0


Post

by EvolveWebHosting » Wed Jun 29, 2016 1:38 am

A client of mine had this happen.

They had www included in the URLs within the config files so I added a 301 redirect in the .htaccess file to force every page to load with www in the URL and the issue was resolved.


Image
Opencart hosting w/ DirectAdmin — free transfers
$15.99 .com Domain Renewal (includes Whois privacy protection and Premium Anycast DNS)


User avatar



Joined

Fri Mar 27, 2015 11:13 pm

Who is online

Users browsing this forum: No registered users and 5 guests

  1. Здравствуйте! Такая беда:
    При редактировании или просмотре заказа выскакивает окно «error undefined’: (скрин прилагаю).
    Русская сборка OpenCart Version 2.1.0.2 (rs.1)
    Системные файлы не изменялись.
    В логе ошибок в админке хостинга обнаружилось следующее:

    [Fri Mar 03 16:11:17 2017] [error] [client x.x.x.46] PHP Fatal error:  Cannot redeclare class ModelSettingSetting in /var/www/............/admin/model/setting/setting.php on line 0, referer: https://site.ru/admin/index.php?route=extension/module&token=mP4G1y43Q6mIct1F9ZvJXr4GahkhLkZa
    [Fri Mar 03 16:11:39 2017] [error] [client x.x.x.46] PHP Fatal error:  Cannot redeclare class ModelSettingSetting in /var/www/............/admin/model/setting/setting.php on line 0, referer: https://site.ru/admin/index.php?route=extension/modification&token=mP4G1y43Q6mIct1F9ZvJXr4GahkhLkZa
    [Fri Mar 03 16:13:04 2017] [error] [client x.x.x.46] PHP Fatal error:  Cannot redeclare class ModelSettingSetting in /var/www/............/admin/model/setting/setting.php on line 0, referer: https://site.ru/admin/index.php?route=extension/modification&token=mP4G1y43Q6mIct1F9ZvJXr4GahkhLkZa&page=2
    [Fri Mar 03 16:14:02 2017] [error] [client x.x.x.46] PHP Fatal error:  Cannot redeclare class ModelSettingSetting in /var/www/............/admin/model/setting/setting.php on line 0, referer: https://site.ru/admin/index.php?route=extension/modification&token=mP4G1y43Q6mIct1F9ZvJXr4GahkhLkZa
    [Fri Mar 03 16:21:53 2017] [error] [client x.x.x.46] PHP Fatal error:  Cannot redeclare class ModelSettingSetting in /var/www/............/admin/model/setting/setting.php on line 0, referer: https://site.ru/admin/index.php?route=extension/modification&token=mP4G1y43Q6mIct1F9ZvJXr4GahkhLkZa&page=2
    [Fri Mar 03 16:29:43 2017] [error] [client x.x.x.46] PHP Fatal error:  Cannot redeclare class ModelSettingSetting in /var/www/............/admin/model/setting/setting.php on line 0, referer: https://site.ru/admin/index.php?route=sale/order/edit&token=mP4G1y43Q6mIct1F9ZvJXr4GahkhLkZa&order_id=62
    [Fri Mar 03 16:44:58 2017] [error] [client x.x.x.46] PHP Fatal error:  Cannot redeclare class ModelSettingSetting in /var/www/............/admin/model/setting/setting.php on line 0, referer: https://site.ru/admin/index.php?route=extension/modification&token=mP4G1y43Q6mIct1F9ZvJXr4GahkhLkZa
    [Fri Mar 03 16:50:47 2017] [error] [client x.x.x.46] PHP Fatal error:  Cannot redeclare class ModelSettingSetting in /var/www/............/admin/model/setting/setting.php on line 0, referer: https://site.ru/admin/index.php?route=extension/modification&token=mP4G1y43Q6mIct1F9ZvJXr4GahkhLkZa
    [Fri Mar 03 16:55:00 2017] [error] [client x.x.x.46] PHP Fatal error:  Call to a member function getTotalCustomerRewardsByOrderId() on a non-object in /var/www/............/system/storage/modification/admin/controller/sale/order.php on line 1516, referer: https://site.ru/admin/index.php?route=sale/order/info&token=mP4G1y43Q6mIct1F9ZvJXr4GahkhLkZa&order_id=59&filter_order_status=3,5
    [Fri Mar 03 16:56:27 2017] [error] [client x.x.x.46] PHP Fatal error:  Call to a member function getTotalCustomerRewardsByOrderId() on a non-object in /var/www/............/system/storage/modification/admin/controller/sale/order.php on line 1516, referer: https://site.ru/admin/index.php?route=sale/order/info&token=mP4G1y43Q6mIct1F9ZvJXr4GahkhLkZa&order_id=62&filter_order_status=2,1,12

    Возможно, именно эти ошибки напрямую не связаны с данной проблемой, но кто знает… Также, хоть и не уверена, но я подозреваю, что проблема возникла после перехода на https, хотя и не факт.

    Нда… а в консоли написано это:
    Заблокирована загрузка смешанного активного содержимого «http://site.ru/index.php?route=api/login»

    Кто-то из знатоков сможет помочь мне в решении проблемы? Буду признательна! Помогите, пожалуйста.

    Вложения:

    • 2017-03-03-(1).png


  2. Bkmz

    Bkmz
    Продвинутый пользователь

    Сообщения:
    440
    Симпатии:
    106

    эта беда разбиралась множество раз — и на форуме есть ответы... воспользуйтесь поиском..

  3. Конечно же, я делала запрос через поиск. Не найдя ответа, написала сюда. Помогите, пожалуйста. Или, если можно, дайте ссылку.

  4. Проблема решилась следующими манипуляциями:

    admin/controller/sale/order.php

    $data['store_url'] = $order_info['store_url'];

    заменила на

    $data['store_url'] = substr($order_info['store_url'], 1 + strpos($order_info['store_url'], ":"));

    Удалось зайти в «просмотр» заказа, но редактировать опять не получилось.
    Теперь появилась ошибка, указывающая на некий конфликт, связанный с модулем «Оповещение по SMS © opencart-russia.ru»

    SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
    OK
    <b>Warning</b>: in_array() expects parameter 2 to be array, null given in <b>/var/www/.........../catalog/controller/module/sms_alert.php</b> on line <b>10</b>{"success":"u0417u0430u043au0430u0437 u043eu0431u043du043eu0432u043bu0435u043d"}

    Отключила модуль. Все равно не использую.
    И редактирование заказа стало возможным.
    Единственное, осталось непонятно, почему ругалось на этот модуль. Вдруг он мне в будущем понадобится, а лезет эта ошибка…

    Последнее редактирование: 4 мар 2017

  5. значит все же не до конца перевели на ssl. Ищите где не до конца перешли, не настроили, не поменяли в конфиге.
    Почитайте тему по настройке ssl

    И если заказы старые смотрите, т.е те которые до перехода на ssl, то это возможно.
    Нужно править или файл или в базе…


OpenCart Russia Форум

Рекомендованные сообщения

danonik

Newbie

Нажимаю на редактирование заказа выдает сообщение error
undefined, так же если попытаться сохранить изменения в заказе и статус.

если изменять статус не заходя в заказ то меняет.

  • Цитата

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

danonik

Newbie

Ошибка PHP Notice:  Uninitialized string offset: 1 in …/admin/view/template/extension/module/neoseo_order_manager.tpl on line 285

  • Цитата

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

NeoSeo Team

Enthusiast

1 час назад, danonik сказал:

Нажимаю на редактирование заказа выдает сообщение error
undefined, так же если попытаться сохранить изменения в заказе и статус.

если изменять статус не заходя в заказ то меняет.

Добрый день.

Уточните, пожалуйста, какая у Вас версия опенкарт?

  • Цитата

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

danonik

Newbie

ocStore © 2009-2020 Все права защищены.
Версия ocStore 2.3.0.2.3

  • Цитата

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

NeoSeo Team

Enthusiast

2 часа назад, danonik сказал:

ocStore © 2009-2020 Все права защищены.
Версия ocStore 2.3.0.2.3

Проверили работу модуля на версии OpenCart 2.3, таких ошибок не обнаружили: http://joxi.ru/52aLzNJtkqN0Qm

Пришлите нам в личные сообщения доступы к админ. панели, посмотрим на Вашем сайте, в чем проблема.

  • Цитата

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

danonik

Newbie

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

NeoSeo Team

Enthusiast

12 минут назад, danonik сказал:

отправил

Доступы получили.

  • Цитата

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

danonik

Newbie

Прошло 18 часов, тишина..

  • Цитата

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

NeoSeo Team

Enthusiast

1 час назад, danonik сказал:

Прошло 18 часов, тишина..

Добрый день.

Отписали Вам в личные сообщения.

  • Цитата

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

danonik

Newbie

обновленный модуль не помог((

  • Цитата

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

danonik

Newbie

вообщем забейте, ничего не решили, удаляю модуль и покупаю другой

  • Цитата

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

NeoSeo Team

Enthusiast

1 час назад, danonik сказал:

обновленный модуль не помог((

Напишите актуальные доступы к админ. панели сайта, посмотрим в чем дело.

  • Цитата

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Присоединяйтесь к обсуждению

Вы можете опубликовать сообщение сейчас, а зарегистрироваться позже.

Если у вас есть аккаунт, войдите в него для написания от своего имени.

Содержание

  1. error undefined
  2. error undefined
  3. Re: error undefined
  4. Re: error undefined
  5. Re: error undefined
  6. Re: error undefined
  7. Re: error undefined
  8. Re: error undefined
  9. Re: error undefined
  10. Re: error undefined
  11. Re: error undefined
  12. Re: error undefined
  13. Re: error undefined
  14. Re: error undefined
  15. error undefined
  16. error undefined
  17. Re: error undefined
  18. Re: error undefined
  19. Re: error undefined
  20. Re: error undefined
  21. Re: error undefined
  22. Re: error undefined
  23. Re: error undefined
  24. Re: error undefined
  25. Re: error undefined
  26. Re: error undefined
  27. Re: error undefined
  28. Undefined variable error in OpenCart 3.x
  29. Undefined variable error in OpenCart 3.x
  30. Re: Undefined variable error in OpenCart 3.x
  31. Re: Undefined variable error in OpenCart 3.x
  32. Re: Undefined variable error in OpenCart 3.x
  33. API Login Error — OpenCart 3.0.2.0
  34. API Login Error — OpenCart 3.0.2.0
  35. Common OpenCart Errors issues and How to Solve Them
  36. Cannot delete the admin folder in Opencart 4
  37. 2. Blank White Pages or 500 Internal Server Error
  38. 2. Undefined Index / Variable
  39. 3. Undefined Function / Method
  40. 4. Headers Already Sent
  41. 5. Session Issue
  42. 6. Allowed Memory Size Exhausted
  43. Installed bad extension, pressed refresh in the modification, and both admin panel and site are down
  44. Fatal error uncaught exception

error undefined

error undefined

Post by evilfx » Tue Mar 15, 2016 8:42 pm

If i access my stores admin url, or click on add to cart on the frontpage i get a popup with:

This happens ONLY if i access my websites without the www.

My websites are:

Do you know how i can fix this?

Best regards,
evilfx

Re: error undefined

Post by OSWorX » Tue Mar 15, 2016 10:19 pm

To be serious, you should avoid the calling with AND without www
The error you have is based on this:

Quellübergreifende (Cross-Origin) Anfrage blockiert: Die Gleiche-Quelle-Regel verbietet das Lesen der externen Ressource auf http://www.beleza21.com/catalog/view/ja . f2?v=4.4.0. (Grund: CORS-Kopfzeile ‘Access-Control-Allow-Origin’ fehlt).

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.

Re: error undefined

Post by evilfx » Wed Mar 16, 2016 1:33 am

Hi Osworx, thanks for your reply.
Sometimes my browser auto-completes without the «www.». And then i get that error. I’m afraid my customers might see this error as well.

From your reply i didn’t quite get it how i can fix it? Could you be more accurate as to what the fix is?

Is this something that happens to everybody?

Re: error undefined

Post by MariOiraM » Wed Mar 16, 2016 3:46 am

Re: error undefined

Post by OSWorX » Wed Mar 16, 2016 3:55 am

evilfx wrote: Hi Osworx, thanks for your reply.
Sometimes my browser auto-completes without the «www.». And then i get that error. I’m afraid my customers might see this error as well.

From your reply i didn’t quite get it how i can fix it? Could you be more accurate as to what the fix is?

Is this something that happens to everybody?

Fixing that can be done via 2 methods:

1. if you are using Plesk, simply define that there that you want URLs with / or without www (do not know if that can be done with other server panels like cPanel etc.)
2. simply add 2 lines to your .htaccess (either with or without www)

With both methods you are fine.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.

Re: error undefined

Post by evilfx » Wed Mar 16, 2016 7:12 pm

2. simply add 2 lines to your .htaccess (either with or without www)

how do i do this Osworx?

Sorry for all the trouble but i’m new at this.

Re: error undefined

Post by OSWorX » Wed Mar 16, 2016 7:24 pm

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.

Re: error undefined

Post by evilfx » Wed Mar 16, 2016 8:50 pm

if i do that, i get the error all the time because it is without www. that i get the error.

i changed it to:

and now it is always www.beleza21.com and it works.

Re: error undefined

Post by OSWorX » Wed Mar 16, 2016 10:35 pm

Important that it works.

While a ‘www’ is not really needed, it is just a subdomain technically.
So there is something else wrong.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.

Re: error undefined

Post by princerocky » Fri Apr 29, 2016 1:11 pm

I m also getting same error for my new developed site ..
If i access my store and click on add to cart on the front page i get a pop up with:

This happens ONLY if i access my websites without the www. on mobile

My websites are:

Do you know how i can fix this?
Pls help

Re: error undefined

Post by zezjulin » Mon May 09, 2016 7:00 pm

Re: error undefined

Post by dragonfly-ie » Mon May 30, 2016 7:50 am

That’s it in a nutshell. Cheers.

Re: error undefined

Post by himanshug.com » Wed Jul 13, 2016 10:23 pm

Hello,
Thanks for your conversation and observations but seriously I got solution from here, as I read that this is going because of www and someone said that www. is a sub-domain and that strikes in mind that yes, a sub-domain can be a issue as in some CMS the file paths are used according to the installation directory and its URL and thus, creates an issue with most common sub-domain i.e. www.

Well, making a permanents re-direct without using www helps a lot in case site is installed on without www directory and vice-versa in case of if site is installed in with www directory.

Источник

error undefined

error undefined

Post by Rubenboks » Wed Feb 26, 2020 4:20 pm

I want to change orders but always get
errorundefined

Re: error undefined

Post by thekrotek » Wed Feb 26, 2020 4:32 pm

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com

Re: error undefined

Post by Rubenboks » Wed Feb 26, 2020 4:39 pm

there is no error. note of this problem in the log

only a other problem.

Re: error undefined

Post by paulfeakins » Wed Feb 26, 2020 6:46 pm

Re: error undefined

Post by thekrotek » Wed Feb 26, 2020 7:21 pm

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com

Re: error undefined

Post by Rubenboks » Wed Feb 26, 2020 9:43 pm

system error log
there is only one log

the problem is when I want to change status of an order

Re: error undefined

Post by straightlight » Wed Feb 26, 2020 11:32 pm

system error log
there is only one log

the problem is when I want to change status of an order

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester

Re: error undefined

Post by paulfeakins » Thu Feb 27, 2020 12:35 am

Re: error undefined

Post by Rubenboks » Thu Feb 27, 2020 12:52 am

Re: error undefined

Post by thekrotek » Thu Feb 27, 2020 2:34 am

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com

Re: error undefined

Post by Rubenboks » Thu Feb 27, 2020 5:49 am

Re: error undefined

Post by letxobnav » Thu Feb 27, 2020 10:06 am

“Data security is paramount at [. ], and we are committed to protecting the privacy of anyone who is associated with our [. ]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.

Источник

Undefined variable error in OpenCart 3.x

Undefined variable error in OpenCart 3.x

Post by berdia » Tue Mar 23, 2021 8:58 pm

Hi,
I am getting:
Notice: Undefined variable: result in /var/www/storage/modification/catalog/controller/product/product.php on line 279;
Notice: Undefined variable: image in /var/www/storage/modification/catalog/controller/product/product.php on line 283
errors when I open individual products in OpenCart 3.x

Line 279 corresponds to this code: $images = $this->model_catalog_product->getProductImages($result[‘product_id’]);
Line 283 corresponds to this code: $images = $image;

This is a code in whole:

Could you please help to find out what the problem is?

Re: Undefined variable error in OpenCart 3.x

Post by JNeuhoff » Tue Mar 23, 2021 11:14 pm

Re: Undefined variable error in OpenCart 3.x

Post by berdia » Tue Mar 23, 2021 11:57 pm

Thanks for your reply.

OC version is 3.0.3.2
Most of the extensions are under Modules:
Account
Banner
Carousel
Category
Featured
HTML content
Information
Latest
Newsletters
Slideshow
Specials
Theme category type
onWebChat
PayPal Standard

We use a Theme which we bought from Templatemonster called Wined. http://www.templatemonsterpreview.com/demo/75072.html

P.S. I installed onWebChat last night and the problem was there before that so I presume onWebChat is not causing the issue.

Re: Undefined variable error in OpenCart 3.x

Post by OSWorX » Wed Mar 24, 2021 1:57 am

Above there seems to be a query (result): $result[‘product_id’]
But maybe it is not $result and the variable has another name.
Check the whole code.
Second message is a result of the missing first: $result[‘product_id’]

p.s.: Template Monster Templates are mostly full of bugs!
Therefore you should also contact them first before asking here for help, because the use a lot of own modules (most of them are a lousy copy of others) — and the whole thing is a commercial thing.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.

Источник

API Login Error — OpenCart 3.0.2.0

API Login Error — OpenCart 3.0.2.0

Post by dinpsnl » Mon Jul 24, 2017 11:26 am

function do_curl_request($url, $params=array()) <
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, ‘/tmp/apicookie.txt’);
curl_setopt($ch, CURLOPT_COOKIEFILE, ‘/tmp/apicookie.txt’);

curl_setopt($ch,CURLOPT_POST, count($params));
curl_setopt($ch,CURLOPT_POSTFIELDS, $params_string);
>

//execute post
$result = curl_exec($ch);

//close connection
curl_close($ch);

$url = ‘http://localhost/opencart/index.php?route=api/login’;
$fields = array(
‘username’ => ‘newton’,
‘key’ => ‘GWHdoHsQ4I1jxQ2SUv6FYu626OZrtivQ8nN1tycm5ld4x6CLoFsk5wpRKv60Y5vTk1gbqg8howhYlcKW5fkBOcF12spVvKR0fVP0PIoOM6GUnFJLwsqEWxAo37mShU0lPfQU53EWDFfRoKibOqq5KFaFSCILPm7x4UsFBLUp0gMhgRT6Rc4IS3kiHMParqIEETmriMIF7xg5uJ1F2UK4PViKAzqiH8gNFCAWdnn8botZGjRUxsAEdUxLTttlmWXf’,
);

$response = do_curl_request($url, $fields);
var_dump($response);

string(653) «Notice: Undefined index: api_token in /Applications/MAMP/htdocs/opencart/catalog/controller/startup/session.php on line 8Warning: Cannot modify header information — headers already sent by (output started at /Applications/MAMP/htdocs/opencart/system/framework.php:42) in /Applications/MAMP/htdocs/opencart/catalog/controller/startup/startup.php on line 99Warning: Cannot modify header information — headers already sent by (output started at /Applications/MAMP/htdocs/opencart/system/framework.php:42) in /Applications/MAMP/htdocs/opencart/catalog/controller/startup/startup.php on line 157»

What is the issue ? I tried adding ‘api_token=1234’ to my url then the error goes but still not logging in

Источник

Common OpenCart Errors issues and How to Solve Them

This Opencart tutorial collects the most common errors that we face while developing and provides solutions for errors, try them and hope you could solve the issues

Cannot delete the admin folder in Opencart 4

https://forum.opencart.com/viewtopic.php?t=228495&p=843586 This solution looks working, for now, change the following lines of code at admin/controller/common/security.php

2. Blank White Pages or 500 Internal Server Error

Blank white pages are a PHP error that for some reason the error messages don’t show because your server is not set up to display the errors.

  1. Go to the admin>> System >> Setting >> Edit store >> Server tab and at the end where you see the Error handling choose Yes to “Display Errors “.
  2. If you still don’t see the error, open php.ini and add code below: display_errors = 1; error_reporting = E_ALL; log_errors = 1;
  3. If you still don’t see the error then open index.php and add code below at the top (line 2): ini_set(‘display_errors’, 1); ini_set(‘log_errors’, 1); error_reporting(E_ALL);
  4. Still seeing the error then, set your “Output Compression Level” to 0 in the System > Settings > Server tab.
  5. If you still see the error, solve the issues but if you did not see the errors then most probably it will be a Server error.
  6. You can see error logs in the file also if you had enabled it.

Above mostly it gets solved and the 500 Internal Server Error can be solved with a similar approach.

2. Undefined Index / Variable

An undefined variable in the source code of a computer program is a variable that is accessed in the code but has not been previously declared by that code. So for that using “isset()” to check if the variable has been set will solve the issue.

Error variant:

Notice: Undefined index: filter in /Applications/XAMPP/xamppfiles/htdocs/opencart303/catalog/controller/product/category.php on lin

Solution
  • Commenting $filter = $this->request->get[‘filter’]; and checking with isset is one way to solve it.
  • If you get the issue while installing the modules or extensions then you need to check the code or solve the issues or contacting the developer can be also another solution.

3. Undefined Function / Method

Undefined function/method errors are seen when you call those functions or methods that are not defined and not found. IE_ERROR: A fatal error that causes script termination “Fatal error: Call to undefined function” or “Fatal error: Call to undefined method”. It happens if files are not found or the extensions are not compatible with your OpenCart version. Solutions can be below:

Error variant:

Related to OpenCart core files

  • Fatal error: Uncaught Error: Call to undefined method DBMySQLi::query()
  • Fatal error: Uncaught Error: Call to undefined method CartCart::getProducts()
  • Fatal error: Uncaught Error: Call to undefined method ControllerAccountLogin::validate() in …/catalog/controller/account/login.php:54

Go to the file and check whether the function or methods are defined there.

Error variant:
  • Warning: Cannot modify header information – headers already sent by (output started at /public_html/config.php:31) in /path/public_html/index.php online.
Solution:

Remove spaces at the beginning and end of the file mentioned. Like in the above error check with the config.php

5. Session Issue

  1. The product on the cart is self-cleared.
  2. The product on the cart is cleared after the user logged in.
  3. No items stored at product compares.
  4. OpenCart admin always asking to login and get message “Invalid token session. Please log in again”.
Error variant:
  • Warning: session_start () [function.session-start]: open (/tmp/…, O_RDWR) failed: No such file or directory (2) in /path/public_html/system /library /session.php on line
Solution:

No such file or directory issue

  1. Open php.ini and add code below:session.save_path = /tmp;
  2. If the solution above does not work, contact your host and ask them how to set session.save_path.

6. Allowed Memory Size Exhausted

This error happens because your memory is not enough to execute the PHP code (uploading large images, deleting a lot of products, sending mass emails, etc). Increasing the memory allocated for PHP will solve the issue.

Error variant:
  • Fatal error: the Allowed memory size of 1111 bytes exhausted (tried to allocate 1111 bytes) in /path/public_html/system/library/image.php on line
Solution:
  1. Edit php.ini and set memory_limit = 128M;
  2. Or put code below to .htaccess php_value memory_limit 128M
  3. If the above does not works then contacting the hosting providers is only the solution where they can increase the number.

Warning: Use of undefined constant DIR_STORAGE – assumed ‘DIR_STORAGE’ (this will throw an Error in a future version of PHP) in …/config.php on line

Some other errors that you can face are below:

Error: Calls to magic methods are not allowed!

Error: Could not call product/category

Error: Could not load model

Error: Could not load library

Error: Could not load helper

Error: Could not load cache adaptor Memcache/Redis/APC cache!

Error: Could not load database adaptor mpdo/mssql/mysql/mysqli/postgre !

Error: Could not make a database connection using this username and password

Error: Could not connect to database opencart

Error: PHP GD is not installed!

Error: Could not load image filename!

Error: Invalid session ID!

Warning: Install folder still exists and should be deleted for security reasons!

Installed bad extension, pressed refresh in the modification, and both admin panel and site are down

Remove it from the database, then open config.php and find what is the value defined for storage. Go to that storage/ folder, then go to modification and remove folders, similarly go to upload/ folder and see if there are folders if you have, remove it also. With this, it will remove the cached files and folder. Then, you can access your admin again.

Fatal error uncaught exception

Fatal error: Uncaught Exception: Error: Table ‘….oc_session’ doesn’t exist in engine
Error No: 1932
SELECT `data` FROM `oc_session` WHERE session_id = ‘….’ AND expire > 1548638620 in …/system/library/db/mysqli.php:40 Stack trace: #0 …/system/library/db.php(45): DBMySQLi->query(‘SELECT `data` F…’) #1

For these errors to solve creating a database table will solve most of the issues

Fatal error: Uncaught Exception: Error: Could not load database adaptor DB_DRIVER!

Check in the system/library/DB folder whether the required driver file is there.

Источник

Понравилась статья? Поделить с друзьями:
  • Error undefined is not a function
  • Error unable to parse перевод
  • Error undefined feed rate grbl что делать
  • Error unable to open rom file
  • Error unable to open log file