Post by Cleo » Fri Sep 09, 2011 1:02 pm

Hello I have upload the module FAQ 148 because I'm using OC V.1.4.9.1 (French version) and followed the instruction but when I go to see my store the following text appear on the left menu just under FAQ

Undefined variable: text_faq in /home/cleo/public_html/catalog/view/theme/sport/template/module/information.tpl on line 8

Can you tell me what the problem is and what I need to change please?


tks
Cleo
Last edited by Cleo on Sat Jan 21, 2012 3:58 pm, edited 2 times in total.

Opencart v1.5.4.1 fr/en
Theme: Custom
vqmod-2.6.0
PHP: 7.3 (ea-php73)


User avatar
Active Member

Posts

Joined
Wed Mar 09, 2011 5:19 am

Post by fido-x » Fri Sep 09, 2011 1:51 pm

The error is not in the FAQ module. You have tried to add a link to it from your Information module. You can't do this by just adding a line to the template file. You need to define the text string in your language file and define the variable in the controller.

In "catalog/language/english/module/information.php", add the following:

Code: Select all

$_['text_faq'] = 'FAQs'; 
Do the same in your French language file.

In "catalog/controller/module/information.php", insert the following:

Code: Select all

$this->data['text_faq'] = $this->language->get('text_faq');
$this->data['faq'] = HTTP_SERVER . 'index.php?route=information/faq'; 
In your template file (catalog/view/theme/YOUR_THEME/template/module/information.tpl), you should have something like:

Code: Select all

<li><a href="<?php echo str_replace('&', '&', $faq); ?>"><?php echo $text_faq; ?></a></li>

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Cleo » Fri Sep 09, 2011 2:14 pm

Oh thank you very much for your fast reply! That's what I call service! :-*

Opencart v1.5.4.1 fr/en
Theme: Custom
vqmod-2.6.0
PHP: 7.3 (ea-php73)


User avatar
Active Member

Posts

Joined
Wed Mar 09, 2011 5:19 am

Post by Cleo » Fri Sep 09, 2011 2:50 pm

Oooops!

Ok I did as you suggest, in my (catalog/view/theme/YOUR_THEME/template/module/information.tpl) I had the following

<?php } ?>
<li><a href="<?php echo $faq; ?>"><?php echo $text_faq; ?></a></li>


Should I leave it there or remove it to add what you wrote?

Cause I tried just adding your's or deleting the one above and now I have the following showing:

Notice: Undefined variable: text_faq in /home/cleo/public_html/catalog/view/theme/sport/template/module/information.tpl on line 8
Notice: Undefined variable: text_faq in /home/cleo/public_html/catalog/view/theme/sport/template/module/information.tpl on line 9


I'm really lost now LoL!

Opencart v1.5.4.1 fr/en
Theme: Custom
vqmod-2.6.0
PHP: 7.3 (ea-php73)


User avatar
Active Member

Posts

Joined
Wed Mar 09, 2011 5:19 am

Post by fido-x » Fri Sep 09, 2011 3:10 pm

This is what your "catalog/view/theme/YOUR_THEME/template/module/information.tpl" should look like:

Code: Select all

<div class="box">
  <div class="top"><img src="catalog/view/theme/default/image/information.png" alt="" /><?php echo $heading_title; ?></div>
  <div id="information" class="middle">
    <ul>
      <?php foreach ($informations as $information) { ?>
      <li><a href="<?php echo str_replace('&', '&', $information['href']); ?>"><?php echo $information['title']; ?></a></li>
      <?php } ?>
      <li><a href="<?php echo str_replace('&', '&', $faq); ?>"><?php echo $text_faq; ?></a></li>
      <li><a href="<?php echo str_replace('&', '&', $contact); ?>"><?php echo $text_contact; ?></a></li>
      <li><a href="<?php echo str_replace('&', '&', $sitemap); ?>"><?php echo $text_sitemap; ?></a></li>
    </ul>
  </div>
  <div class="bottom">&nbsp;</div>
</div>

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Cleo » Fri Sep 09, 2011 3:28 pm

Hello again Fido-x

To make sure I removed completely the content of that file and copied yours instead and this is what I get now on my homepage:

Notice: Undefined variable: text_faq in /home/cleo/public_html/catalog/view/theme/sport/template/module/information.tpl on line 8


???

Tks
Cleo

Opencart v1.5.4.1 fr/en
Theme: Custom
vqmod-2.6.0
PHP: 7.3 (ea-php73)


User avatar
Active Member

Posts

Joined
Wed Mar 09, 2011 5:19 am

Post by fido-x » Fri Sep 09, 2011 3:35 pm

You haven't defined the variable in the controller.
fido-x wrote:In "catalog/controller/module/information.php", insert the following:

Code: Select all

$this->data['text_faq'] = $this->language->get('text_faq');
$this->data['faq'] = HTTP_SERVER . 'index.php?route=information/faq';  
And don't forget the entry in the language file(s).

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Cleo » Fri Sep 09, 2011 3:45 pm

Sniff sniff, sorry :( won't do it again I promise ! Because I was having that problem I didnt thought about going further!

I know absolutely nothing about programming that's why I'm so lost, but I am learning as I go with the help of all the nice people in this forum!

Thank you again for your quick reply and all your help!

Cleo ;) :-*

Opencart v1.5.4.1 fr/en
Theme: Custom
vqmod-2.6.0
PHP: 7.3 (ea-php73)


User avatar
Active Member

Posts

Joined
Wed Mar 09, 2011 5:19 am

Post by fido-x » Fri Sep 09, 2011 3:47 pm

No worries. ;)

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Cleo » Fri Sep 09, 2011 3:52 pm

Wow! It's working! Except that now when I click on the FAQs from the store I get this message:

Error: Could not load model fido/faq!


:laugh:

Opencart v1.5.4.1 fr/en
Theme: Custom
vqmod-2.6.0
PHP: 7.3 (ea-php73)


User avatar
Active Member

Posts

Joined
Wed Mar 09, 2011 5:19 am

Post by Cleo » Fri Sep 09, 2011 5:20 pm

Ok I think I know why I get this error!

I installed the module in extension and if I look at "Position" it's Catalog

But because my store is in French it should say Catalogue (well I think that's the reason but I may be wrong!)

???

If I'm correct then I don't know where to change it ???

Opencart v1.5.4.1 fr/en
Theme: Custom
vqmod-2.6.0
PHP: 7.3 (ea-php73)


User avatar
Active Member

Posts

Joined
Wed Mar 09, 2011 5:19 am

Post by Cleo » Fri Sep 09, 2011 5:52 pm

Whoot whoot, I found out where to change Catalog to Catalogue but I was wrong cause I still get the error:

Error: Could not load model fido/faq!



Sniff sniff :(

Opencart v1.5.4.1 fr/en
Theme: Custom
vqmod-2.6.0
PHP: 7.3 (ea-php73)


User avatar
Active Member

Posts

Joined
Wed Mar 09, 2011 5:19 am

Post by Cleo » Fri Sep 09, 2011 6:47 pm

ok, fixed that error again!

Now when I click on Catalogue the FAQs does not appear
So of course when I go to the store and select FAQs it says: FAQ Page Not Found!

I just noticed also that the FAQ does not appear in the site map page ???

Ok, I'm off to bed now and will check again later cause now I have no more idea ???

@Fido-x I hope you will be able to help me one more time! Or anyone else ::)

Opencart v1.5.4.1 fr/en
Theme: Custom
vqmod-2.6.0
PHP: 7.3 (ea-php73)


User avatar
Active Member

Posts

Joined
Wed Mar 09, 2011 5:19 am

Post by Cleo » Tue Sep 13, 2011 3:23 pm

Oh well I believe I almost fixed it :)

The only thing that is weird is that in your file it says From the menu, select "Catalog–>FAQs".

Assuming you have followed the installation and configuration instructions properly, you will be presented with a page displaying a list of your FAQs. You may delete the sample question, or edit it to suit.

To insert a new entry, click the "Insert" button. The entry page contains "Question" and "Answer" fields to hold the question and answer.

By clicking the "Data" tab you will be able to set the status of the entry to "Enabled" or "Disabled" (disabled by default). You can also set the sort order on this page.

When done, click "Save".


What is funny for me the FAQ doesn't appear in my Catalog drop down, it's showing in Extension/Module!

So I went trough all (a lot) my files and finally found the one with the English text: Frequently Ask Question and translate them in French, I didn't find any Sample questions text though. So I am doing my own.

The only thing is the FAQ does not appear in the Site Map but that's not a big deal!

Well for a French Blond dummy who knows nothing about programming I'm proud of myself :crazy: :laugh:

Opencart v1.5.4.1 fr/en
Theme: Custom
vqmod-2.6.0
PHP: 7.3 (ea-php73)


User avatar
Active Member

Posts

Joined
Wed Mar 09, 2011 5:19 am
Who is online

Users browsing this forum: No registered users and 1 guest