This is my first "real" contribution to the community, apart from a couple of templates I uploaded to the OpenCart contributions site. Thank you to those who have been downloading them.
From browsing the forums, I have noticed that there is a desire to control the contents of the home page from the database. The common method has been to use one of the information pages for the purpose. While a viable work-around, it degrades the importance of your home page.
Your home page is special! It is the gateway to your store and should be treated as a separate, individual entity.
With that in mind, I present to you my Homepage Upgrade package.
Overview
By adding 2 tables to your database, and with the necessary administration controller/template files, you can gain full control over the contents of your home page.
How does it work?
Once installed, 2 tables (homepage and homepage_description) are added to your database to contain the data that appears on your home page.
Log in to your administration and select "Catalog->Home Page" from the menu. Here you can insert, edit and delete entries in the same way as you would for "Information" entries. By clicking the "Insert" or "Edit" buttons, you will be taken to a screen where you can enter the title (heading) and the description (block of text below the heading) entries for your home page. The "Data" tab allows you to set the status of each entry to "Enabled" or "Disabled".
On the Catalog side of things, the replacement catalog/controller/home.php file extracts the entries from the database and presents these entries to the new catalog/template/content/home.tpl file, which displays all enabled items.
All necessary files are included in the package, including sql for the additional database tables. The accompanying "readme" includes full installation instructions.
Available as a free download from my website at http://www.fido-x.net for registered members - registration is free.
Hope you find this useful.
Regards, Fido-X.
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!
And secondly, I've just updated this package to include a sort order and an image handle. The images swap sides on the home page depending on whether the sort order is odd or even.
Regards, Fido-X.
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!
I've done this primarily because some commercial company's web browser's security phishing filter doesn't seem to like my security certificate. I host my own site on my own machine from home, and created my own security certificate to go with it. It seems that Internet Exploiter doesn't like self-signed certificates.
And, yes it is the updated version.
Regards, Fido-X.
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!
I just installed Homepage Upgrade and on my homepage, the initial default entry shows up, but...
My "Featured Products" do not show up any more, nor do my Latest Products.
I also get two errors, the first comes above the HompageUpgrade entry, the second comes below:
THE FIRST
Notice: Undefined variable: text_greeting in /home/username/public_html/catalog/template/default/content/home.tpl on line 6
THE SECOND
Notice: Undefined variable: text_latest in /home/username/public_html/catalog/template/default/content/home.tpl on line 21
Notice: Undefined variable: products in /home/username/public_html/catalog/template/default/content/home.tpl on line 22
Warning: Invalid argument supplied for foreach() in /home/username/public_html/catalog/template/default/content/home.tpl on line 22
Please advise... Thanks!
http://forum.opencart.com/index.php/top ... ml#msg7934
So I noticed the apology from fido-x, so I went and deleted the code... Wallah... the errors are gone...
BUT...
Now I don't see my featured products or my latest products...
I even went into the admin panel and "uninstalled" them both and reclicked the plus sign. I am thinking of reinstalling the whole "featured/latest/etc." module somehow on top of the homepage module.
Advice?
Anway, note this quote from the Latest/Featured/Specials instructions:
Being Modules, these only seem to function in layout.tpl.
Try adding something similar to the above.so, for example, if you only want them to appear on your home page, something of the form :
inserted in layout.tpl should do the trick.
Caveat: Because of the "" statement, things don't display if someone lands directly at your homepage - they do once they click your 'home' or equivalent button in your main navigation IF you haven't enabled aliasing. If you ARE using aliasing a hack is to set the priority order that index pages will be looked for at server level (index.html, index.htm, index.php, default.cfm etc etc) to index.html ... them in .htaccess do a re-direct:
Redirect /index.html /index.php?controller=home
Isn't life complicated?
ADDENDUM: I should have made it clearer that the above aliasing hack works with Dave Gilbert's version of alias support: http://forum.opencart.com/index.php/top ... .html If your store is not in the root of your web directory you'll need to put a .htaccess with the redirect code there. It'll be a little different if you use 0.7.8 standard aliasing but it should still work even with that if you simply upload a dummy index.html file to the root of your store
Chris @ SiteE@se Web Design
What's the point in that? I need the function to work when people type in the site address.
This particular cart IS in the root.
I went ahead and put the code you gave me in replacement of what was suggested in the forums. Now I get only this error on the homepage:
Notice: Undefined index: controller in /home/bradley/public_html/catalog/template/default/layout.tpl on line 44
It looks like it does not recognize the line about the "controller".
HERE is my layout.tpl file:
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html dir="<?php echo $direction; ?>" lang="<?php echo $code; ?>">
<head>
<title><?php echo $title; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>">
<base href="<?php echo $base; ?>">
<link rel="stylesheet" type="text/css" href="catalog/template/<?php echo $this->directory; ?>/css/default.css">
<link rel="alternate" type="application/rss+xml" title="<?php echo $title; ?>" href="rss.php">
</head>
<body>
<h1><a href="./"><?php echo $title; ?></a></h1>
<div id="container">
<?php if (isset($header)) { ?>
<div id="header"><?php echo $header; ?></div>
<?php } ?>
<div id="bar">
<?php if (isset($language)) { ?>
<?php echo $language; ?>
<?php } ?>
<?php if (isset($currency)) { ?>
<?php echo $currency; ?>
<?php } ?>
<?php if (isset($search)) { ?>
<?php echo $search; ?>
<?php } ?>
</div>
<div id="column">
<?php if (isset($cart)) { ?>
<?php echo $cart; ?>
<?php } ?>
<?php if (isset($category)) { ?>
<?php echo $category; ?>
<?php } ?>
<?php if (isset($review)) { ?>
<?php echo $review; ?>
<?php } ?>
<?php if (isset($information)) { ?>
<?php echo $information; ?>
<?php } ?>
</div>
<?php if (isset($content)) { ?>
<div id="content">
<?php if ($_REQUEST['controller'] == 'home') { ?>
<?php if (isset($latest)) { ?>
<?php echo $latest; ?>
<?php } ?>
<?php if (isset($featured)) { ?>
<?php echo $featured; ?>
<?php } ?>
<?php if (isset($specials)) { ?>
<?php echo $specials; ?>
<?php } ?>
<?php } ?>
</div>
<?php } ?>
<?php if (isset($footer)) { ?>
<div id="footer"><?php echo $footer; ?></div>
<?php } ?>
</div>
<?php if (isset($time)) { ?>
<div id="time"><?php echo $time; ?></div>
<?php } ?>
</body>
</html>
Thanks
http://forum.opencart.com/index.php/top ... ml#msg3898
I followed these steps in order to change the home.php file (which had been replaced during the install of HomepageUpgrade) as well as the change in layout.tpl.
Now I have HomepageUpgrade and Latest and Featured,etc. working now.
Thanks to all in the community...
Users browsing this forum: No registered users and 32 guests