In opencart 3.0.2.0 How do I add my store’s name to all pages (product, manufacturer, information etc)?
Thank You
If you're trying to edit your page title to something like this:
Your Store - Product Name
Edit this file:
catalog\controller\product\product.php
Find:
$this->document->setTitle($product_info['meta_title']);
Replace With:
$this->document->setTitle($this->config->get('config_name') . ' - ' . $product_info['meta_title']);
You can do the same for other pages like category.php, you need to search for setTitle.
$this->config->get('config_name') - name of store
Related
I would like to add a meta tag and meta description to the specials page ( .../index.php?route=product/special ). could anyone assist?
I'm using OpenCart 3.0.2.0
I did how ever figure out how to add a description to the page but not a meta description nor meta keywords like the categories and products.
Any info would be appreciated.
Thanks in advance
Edit this file:
catalog\controller\product\special.php
Find:
$this->document->setTitle($this->language->get('heading_title'));
Add After:
$this->document->setDescription('My description...');
$this->document->setKeywords('my, keyword');
I'm using multistore in Opencart 1.5. I want to show the total number of store that I have made and I want to show it in the setting/store page. Can anybody help?
The function $this->model_setting_store->getTotalStores() will return the number of stores excluding the default store.
So total number of stores:
In controller add the line:
$this->data['total_stores'] = $this->model_setting_store->getTotalStores()+1;
In template file use it as below:
<?php
echo $total_stores;
?>
However, to get it working in the controller file and avoid any errors first you need to load your model:
$this->load->model('setting/store');
I would like to add a custom "trending topics" section to my news website at the top of the homepage. An existing example that shows precisely what I am looking for is the Daily Beast homepage.
I would like to do this with custom code or with a plugin, but not as a widget. Does anyone know how I can do this in a flexible way that can easily customize to style and look of my website.
My site is a Spanish language 24/7 news website called Yasta.pr. Thx!
it depends on how you are storing your data in your database but you can try this:
add a div section in the header of your webpage above the menu bar.
then you can dynamically add the most trending topic to it automatically when the page starts by inserting this code inside it:
<div id="*id_name">
$query = "SELECT * FROM *table_name ORDER BY *most_trending_column LIMIT 1";
mysql_select_db(*database_name, *connection);
$result = mysql_query($query) or die(mysql_error());
$data = mysql_fetch_assoc($result);
echo "<h3 id='*id_name'>" . $data['*title_column_name'] . "</h3>";
</div>
dont forget to connect to your database first.
I have a couple of fields in my model that to which I wish to add a link that will allow the user to search for names/files (external from the application's database).
So what I would like is:
Field name: [text box] - LINK
Is there a straightforward django way of achieving this?
Cheers.
You need to change the widget that the form field uses to display the models information. You basically add some html after the input to link to where you want.
Here's some code I put together to create a widget that displays how many characters are left for a CharacterField so it's similar to what you are looking to do:
https://github.com/pastylegs/django-widget-charsleft/blob/master/widget_charsleft/widgets.py
string: "Here is the badges, https://stackoverflow.com/badges bla bla bla"
If string contatins a link (see above) I want to parse the website title of that link.
It should return : Badges - Stack Overflow.
How can i do that?
Thanks.
#!/usr/bin/perl -w
require LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->env_proxy;
my $response = $ua->get('http://search.cpan.org/');
if ($response->is_success) {
print $response->title();
}
else {
die $response->status_line;
}
See LWP::UserAgent. Cheers :-)
I use URI::Find::Simple's list_uris method and URI::Title for this.
Depending how the link is given and how you define title, you need one or other approach.
In the exact scenario that you have presented, getting the URL with URI::Find, HTML::LinkExtractor etc, and then my $title=URI->new($link)->path() will provide the title and the link.
But if the website title is the linked text like badged, then How can I extract URL and link text from HTML in Perl? will give you the answer.
If the title is encoded in the link itself and the link is the text itself of the link, how do you define the title?
Do you want the last bit of the URI before any query? What happens with the queries set as URL paths?
Do you want the part between the host and the query?
Do you want to parse the link source and retrieve the title tag if any?
As always going from trivial first implementation to cover all corner cases is a daunting tasks ;-)