Categories
»
Published
22nd January 2022
Order Code ect-code

Ecommerce Templates Dynamic PHP Page title, meta description and meta og:tag code

For users of the Ecommerce Templates PHP shopping cart software, here is a FREE download file containing HTML and PHP code to dynamically generate website page title, meta description, meta og tags, h1 heading and short description 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

Click to download the WinZip file

This file will UnZip into a folder named “ect-dynamic-code

Once you have downloaded and UnZipped the file, please open the “ect-dynamic-code-readme.pdf” file which explains all.

The dynamic code has been tested on I.T.ZAP website builds with:

  • Ecommerce Plus PHP Version 7.4.6 (and later) with no custom Mods installed.
  • cPanel LiteSpeed Server running PHP Version 7.4.27 (and later).
  • Requires using the Search Engine Friendly URL’s.
  • Requires both “Short” and “Long” descriptions to be entered for each Category, Product and Article page.
  • All files are provided “as is”.

The objective was to make all the code on the following Ecommerce Templates pages totally dynamic so that it could be used on any website whatsoever.

  • categories.php
  • products.php
  • proddetail.php

Note: This January 2022 update makes the manufacturers.php (or brands.php) page obsolete.

Implementing this dynamic code requires the end user to Copy Ctrl+C and Paste Ctrl+V code snippets into those website PHP files in 3 locations:

  1. Above <!DOCTYPE html>
  2. Inside “Editable Regions” in the <head>, and
  3. Inside “Editable Regions” in the <body> of your page.

To adapt the code for your website, all that needs to be done is to edit and copy/paste code into these configuration files:

  • .htaccess
  • vsadmin/includes.php
  • social-meta-ids.php (Enter Facebook admin and appid numbers here. You can also add <meta> properties for Twitter.)

$sitesocialimage defines a SSL secured filepath to one Full HD Business Promo image (Premises, Logo or similar) for use as og:image on index.php, categories.php, or products.php pages when any of those page URL’s are shared on social media websites.

$publisher creates structured data rich snippets to identify Article Publisher and Author.

You will note that I just paste this one single line above <!DOCTYPE html> to start the visit session and load the necessary Ecommerce Templates content management system files:


	<?php include_once("start-ect-metainfo-page.php"); ?>

I find this super simple; no spelling errors; everything loaded in the correct order. Otherwise, if you prefer, you can paste in the regular code.


	<?php session_cache_limiter('none');
	session_start(); ob_start();
	include "vsadmin/db_conn_open.php";
	include "vsadmin/inc/languagefile.php";
	include "vsadmin/includes.php";
	include "vsadmin/inc/incfunctions.php";
	include "vsadmin/inc/metainfo.php" ?>

Please note: If you have any of those code entries appearing 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.

categories.php

How it works:

Page Title and H1 heading:
(1) If viewing the brand/ page, then the $rootmanufacturertitle you added to includes.php gets printed. Otherwise :
(2) If you entered something into the Page Title Tag (Optional) field, then that gets printed.
Otherwise :
(3) If not the top Root Category, then print the Menu "Section Name" you entered | and "Site Name".
Otherwise it must be the Menu Root Category, so :
(4) Print the $rootcategorytitle you added to includes.php

Page Description:
(1) If viewing the brand/ page, then the $rootmanufacturerdescription you added to includes.php gets printed. Otherwise :
(2) If you entered something into the Meta Description (Optional) field, then that gets printed.
Otherwise if not the top Root Category :
(3) Print the Category Section "Short Description" that you entered.
Otherwise it must be the Menu Root Category, so :
(4) Print the $rootcategorydescription you added to includes.php

products.php

How it works:

<?php $pno > function adds a “page number” onto the end of Titles, Headings and Descriptions to stop Google Webmaster Tools grizzling about duplicate content.

Page Title and H1 heading:
(1) If you entered something into the Page Title Tag (Optional) field, then that gets printed. Otherwise :
(2) If not the top Root Category, then print the Menu "Section Name" you entered | and "Site Name".
Otherwise you must be viewing the list of All Pages, so :
(3) Print the $allpagestitle you added to includes.php AND add the $pagenumber to the end.

Page Description:
(1) If you entered something into the Meta Description (Optional) field, then that gets printed. Otherwise :
(2) If not the top Root Category, then Print the Category Section "Short Description" that you entered.
Otherwise you must be viewing the list of All Pages, so :
(3) Print the $allpagesdescription you added to includes.php AND add the $pagenumber to the end.

proddetail.php

Works in a similar fashion.

0
2 Reviews - Average 5 / 5 (Show All)
Excellent, works perfect, thank you !
- 18th March 2018
!! one of the best !! Awesome. Hope to do business with you again. A +++++++++
Great Service
- 30th January 2018
Thanks Gary for the extra effort you took when updating our website. Any hiccups and questions were taken care of very quickly. Will highly recommend you.

More Related Pages

Ecommerce Templates thanks receipt.css and ectadmincustom.css
Published
13th June 2024
6
UPDATED June 2024, this FREE download for the Ecommerce Templates shopping cart software contains files that will transform the appearance of your Order Confirmation pages, Admin Panel Invoices, Packi...
0
How to configure Ecommerce Templates shopping cart software for Articles
Published
01st September 2022
The Ecommerce Templates shopping cart software Version 7.2.1 released 30th March 2020 introduced a method to enter Articles into the content management system, together with appropriate Rich Snippets ...
0