For users of the fantastic “Ecommerce Templates” PHP shopping cart software, here is a FREE download file containing HTML and PHP code snippets to generate dynamic <title>, <meta description> and <meta og: tags> in your website page code.
Developed here at I.T. ZAP Website Design Works, this dynamic code is essential to maximise your Search Engine Optimization strategy and Social Media impact.
Download Free, No Charge
This file will UnZip into a folder named “ect-dynamic-code”
Once you have downloaded and UnZipped the file, please open the “00-ect-dynamic-code-readme.pdf” file which explains all.
The HTML and PHP code is provided “as is” and was written using Adobe Dreamweaver CC 2015.
UPDATED Monday, 29th January 2018.
I have been testing this code for some time now on this website, and others, using a succession of Ecommerce PHP Versions 6.6 up to the very latest release. My standard website configuration is as follows:
cPanel LiteSpeed Server running PHP Version 7.1
Vanilla page URL’s or “Has Static URL”. (Not using .htaccess Mod RewriteRules)
Both “Short” and “Long” descriptions entered for each Category and Product page. Short description is a “must have” for the <meta description> entry.
The dynamic code will work using Search Engine Friendly URL’s, but with one small modification to the <canonical> and <og:url> entries, as explained in the ReadMe pdf.
Implementing this dynamic code requires the end user to open the sample files provided, then Copy (CTRL+C) and Paste (CTRL+V) code snippets into your own Ecommerce Templates website PHP files in 3 locations:
Above <!DOCTYPE html>
Inside “Editable Regions” in the <head>, and
Inside “Editable Regions” in the <body> of your page.
The code must go inside "Editable Regions" so as it is not overwritten upon Template update.
If you need to add another "Editable Region" to your website Template file where you can insert dynamic code, perhaps inside the <head> or before the closing </body> tag, then go ahead and do so. Select Dreamweaver Menu: Insert ⇒ Template ⇒ Editable Region.
Even if you are not on Facebook or Twitter, do add all the <meta og: tag> code entries just the same, because somebody may well “Share” your page URL on a Social Media website, which can then load up all that “Open Graph” information automatic.
WinZip Download File Contents
Here is a description. See the ReadMe pdf for more detail and critical notes.
Special Parameters used in the PHP code that you need to EDIT to suit your business and then add to your existing includes.php config file.
Use of this “include_once” file is optional, but my recommended way to load the Ecommerce Templates content management system files first up at Line 1, all in the correct order, above <!DOCTYPE html> like so:
<?php include_once ( $_SERVER["DOCUMENT_ROOT"] . "/start-ect-metainfo-page.php") ?>
Important: If you have any of those Ecommerce Templates system files being loaded further down on any page, then you must remove those lines. They cannot be duplicated. And without “metainfo.php” loaded up top, the dynamic code entries will be BLANK.
Another optional “include_once” file, but without loading metainfo.php on the end. Loaded first up on ECT pages like index.php, clientlogin.php, cart.php, search.php, etc, where page title and description code is entered manually.
<?php include_once ( $_SERVER["DOCUMENT_ROOT"] . "/start-ect-page.php") ?>
An “include_once” file that I use to insert Facebook “Administrator” and “Application” ID numbers. You need to EDIT and insert your own unique Facebook ID numbers. You can also add <meta> properties for Twitter in here as well.
(a) To create a Facebook App ID
for your website, go to the Facebook Developer page here
, click on "Get Started" at top-right of the page and then enter your website details. The App tracks and properly attributes all the Likes, Shares, Reactions, Comment numbers to your Business Page. It also generates detailed Facebook Insight Reports
that will provide helpful data in measuring your Facebook Post reach, effectiveness, marketing and planning advertising campaigns.
(b) To obtain your correct Facebook Administrator ID
number, go to the Find My Facebook ID website here
and enter the URL of your Personal
Facebook Page. Note that you can add Multiple Facebook Administrator ID lines, so as each authorised person will get access to view those detailed Facebook Insights reports.
Use this to copy/paste dynamic code snippets into your categories.php file.
Use this to copy/paste dynamic code snippets into your products.php file.
This is basically a CLONE of your products.php file for use when creating a static “Category URL (Optional)” page in 30 seconds flat, where the “Category Function” is “Products can be added to this category”.
This is basically a CLONE of your categories.php file for use when creating a static “Category URL (Optional)” page in 30 seconds flat, where the “Category Function” is “Categories can be added to this category”.
Use this to copy/paste dynamic code snippets into your manufacturers.php file. It is simply a CLONE of categories.php, but uses those parameters you entered into includes.php named : $rootmanufacturertitle and $rootmanufacturerdescription
Use this to copy/paste dynamic code snippets into your proddetail.php file. The line:
does require Ecommerce Plus PHP Version 6.6 or later. And in your includes.php config file, do check that you do have:
<?php print $metaogimage; ?>
(a) “socialmedia” in the $detailpagelayout entry.
(b) $usegiantogimage=true; (new in v6.8.0) will fetch the first GIANT image (if available) for the <meta og:image> URL entry on proddetail.php pages. Recommended because big photos are better for Social Media posts.
This is a CLONE of proddetail.php that you can use to create a “Has Static URL” product page in 30 seconds flat.
Once you have Pasted the dynamic code into your Ecommerce Templates PHP files, delete all the spaces between lines. They were only put there to separate code snippets for clarity.
Hopefully the explanations provided are clear enough. Feedback is welcome, along with any suggested improvements.
To make all this dynamic PHP code work, how should details be entered into the Ecommerce Templates Administration Panel?
Sample Menu Category page
Sample Product Detail page
Do you have dynamic code for the ASP and Wordpress versions ?
No, sorry. I do not work with those versions. This is a conversion that somebody else in the Ecommerce Templates community might kindly provide.
Can you do it all for me ?
Yes, if you are a PHP user and are happy to pay a modest fee (in AUD$) for the time involved, then you may order below. I would need a copy of these files:
Dynamic code implemented by IT ZAP is guaranteed to work with Ecommerce Templates Shopping Cart PHP Plus Versions 6.6 onward.