s08e02 - Per Product FAQs SUPPORT / QUESTIONS / CHAT

Open to all! Ask other shopowners for help.
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: s08e02 - Per Product FAQs SUPPORT

Post by ecartz »

villameschik wrote: Thu May 13, 2021 6:00 am line 390: return $faq['faq_question'];
line 399: return $faq['faq_answer'];
My guess would be a data level problem. The equivalent of the previous suggestion would be to write

Code: Select all

if (isset($faq['faq_question'])) {
  return $faq['faq_question'];
}

Code: Select all

if (isset($faq['faq_answer'])) {
  return $faq['faq_answer'];
}
However, I suspect that there is some kind of problem with the database query. For example, if it is requesting a FAQ that isn't there.

Tags:


Join The Code Co-op to get access to your library in the Code Co-op Forum
villameschik

Re: s08e02 - Per Product FAQs SUPPORT

Post by villameschik »

ecartz wrote: Thu May 13, 2021 1:00 pm
villameschik wrote: Thu May 13, 2021 6:00 am line 390: return $faq['faq_question'];
line 399: return $faq['faq_answer'];
My guess would be a data level problem. The equivalent of the previous suggestion would be to write

Code: Select all

if (isset($faq['faq_question'])) {
  return $faq['faq_question'];
}

Code: Select all

if (isset($faq['faq_answer'])) {
  return $faq['faq_answer'];
}
However, I suspect that there is some kind of problem with the database query. For example, if it is requesting a FAQ that isn't there.
Thanks @ecartz for help, what should I do with the database query problem?
villameschik

Re: s08e02 - Per Product FAQs SUPPORT

Post by villameschik »

Fiber wrote: Thu May 13, 2021 8:01 am
I have installed on a clean version only in English and it gives the same error in admin/faq.php:
line 390: return $faq['faq_question'];
line 399: return $faq['faq_answer'];
Also installed in 1.0.8.3 and no errors , 2 languages.. very strange that you have the errors with a clean install.
then I have problems, but do you get the questions in both languages or just the language that the customer asks the question?
Fiber
Contributor
Posts: 173
Joined: Mon Oct 26, 2020 12:16 pm
Phoenix Version: v1.1.0.6
Has thanked: 17 times
Been thanked: 27 times

Re: s08e02 - Per Product FAQs SUPPORT

Post by Fiber »

villameschik wrote: Thu May 13, 2021 4:09 pm then I have problems, but do you get the questions in both languages or just the language that the customer asks the question?
In both languages from the admin..
shopside from customer only the language dutch en only answer in dutch language from the admin
Turn up the Max
villameschik

Re: s08e02 - Per Product FAQs SUPPORT

Post by villameschik »

unfortunately i think @ecartz is right about the database, but i am not familiar with mysql, I am attaching image
You do not have the required permissions to view the files attached to this post.
villameschik

Re: s08e02 - Per Product FAQs SUPPORT

Post by villameschik »

villameschik wrote: Thu May 13, 2021 4:01 pm
ecartz wrote: Thu May 13, 2021 1:00 pm
villameschik wrote: Thu May 13, 2021 6:00 am line 390: return $faq['faq_question'];
line 399: return $faq['faq_answer'];
My guess would be a data level problem. The equivalent of the previous suggestion would be to write

Code: Select all

if (isset($faq['faq_question'])) {
  return $faq['faq_question'];
}

Code: Select all

if (isset($faq['faq_answer'])) {
  return $faq['faq_answer'];
}
However, I suspect that there is some kind of problem with the database query. For example, if it is requesting a FAQ that isn't there.
Thanks @ecartz for help, what should I do with the database query problem?
sorry for the trouble @ecartz, but making this change gives me this error:
Parse error: syntax error, unexpected end of file in xxx/admin/faq.php on line 403

if (isset($faq['faq_question'])) {
return $faq['faq_question'];
}
function tep_get_faq_answer($faq_id, $language_id = 0) {
global $languages_id;

if ($language_id == 0) $language_id = $languages_id;
$faq_query = tep_db_query("select faq_answer from clubosc_faq_info where faq_id = '" . (int)$faq_id . "' and language_id = '" . (int)$language_id . "'");
$faq = tep_db_fetch_array($faq_query);

if (isset($faq['faq_answer'])) {
return $faq['faq_answer'];
}
?>
I had my hosting checked and they tell me that MYSQL works perfectly.
User avatar
burt
Core Team
Posts: 4550
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: s08e02 - Per Product FAQs SUPPORT

Post by burt »

Just delete the whole installation of this addon and try again. If it is working for other people in multiple languages, then you know it is not the addon that is broken...and it may be either something else in your shop or you have done something incorrect in the installation.
I am not here to build for you.
I am here to build with you. Let's help each other.
Omar_one
Senior Contributor
Posts: 676
Joined: Fri Oct 25, 2019 5:06 pm
Phoenix Version: v1.0.8.16
Has thanked: 100 times
Been thanked: 56 times

Re: s08e02 - Per Product FAQs SUPPORT

Post by Omar_one »

I test it with two languages on v1.0.8.2 and it's working as it should
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: s08e02 - Per Product FAQs SUPPORT

Post by ecartz »

Code: Select all

    if (isset($faq['faq_question'])) {
      return $faq['faq_question'];
    }
  }

  function tep_get_faq_answer($faq_id, $language_id = 0) {
    global $languages_id;

    if ($language_id == 0) $language_id = $languages_id;
    $faq_query = tep_db_query("select faq_answer from clubosc_faq_info where faq_id = '" . (int)$faq_id . "' and language_id = '" . (int)$language_id . "'");
    $faq = tep_db_fetch_array($faq_query);

  if (isset($faq['faq_answer'])) {
    return $faq['faq_answer'];
  }
}
?>
Sorry, I missed that post until just now. You're missing two }. I added how it would look here.
villameschik

Re: s08e02 - Per Product FAQs SUPPORT

Post by villameschik »

burt wrote: Mon May 17, 2021 2:30 pm Just delete the whole installation of this addon and try again. If it is working for other people in multiple languages, then you know it is not the addon that is broken...and it may be either something else in your shop or you have done something incorrect in the installation.
HI @Burt, I have never doubted your work, I have installed again on a clean version, everything works for me but it does not show me the client's questions in the different language. I use php 7.4, I have no errors log. how can I solve?


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply