Featured Products CE v3.0. (Phoenix Cart)
---------------------------------

Compatibility: Phoenix Cart 1.1.0.0+
Tested with Phoenix 1.1.0.1 and PHP 8.3
Lower versions, please use Featured Products CE v2.0.0.-2.3.11

These instructions were modified by @raiwa to update this contribution for use with Phoenix Cart version.
All credits for this Addon go to DunWeb Designs.

Changes version 3.0.:        
 - Updated for Phoenix 1.1.0.0+ and Bootstrap 5
 - Tested with Phoenix 1.1.0.1 and PHP 8.3
 
Changes version 2.3.11.:        
 - Removed SMALL_IMAGE_WIDTH and SMALL_IMAGE_HEIGHT in admin infobox for Phoenix 1.0.9.8+ compatibility
 - Tested with Phoenix 1.0.9.9 and PHP 8.3
 
Changes version 2.3.10.:        
 - Updated $card['extra'] to array in templates for Phoenix 1.0.9.5 compatibility
 - Tested with Phoenix 1.0.9.7 and PHP 8.3
 
Changes version 2.3.9.:        
 - Updated template width class to match Phoenix 1.0.9.4 core
 - Tested with Phoenix 1.0.9.4 and PHP 8.3
 
Changes version 2.3.8.:        
 - Fixed seach query for special characters in Product Title or Model. Thanks to @14Steve14 for the report
 - Tested with Phoenix 1.0.9.3 and PHP 8.3
 
Changes version 2.3.7.:        
 - Updated legacy oscTemplate functions to Template functions.
 - Tested with Phoenix 1.0.9.1 and PHP 8.2
 
Changes version 2.3.6.:        
 - Updated expiry date input to html date field and selector.
 - Fixed index nested module to show only featured products.
 - Tested with Phoenix 1.0.8.21 and PHP 8.2
 
Changes version 2.3.5.:        
 - Removed obsolete search_featured.php link in search button. Thanks to @mhsuffolk for the report.
 - Changed min Phoenix version to 1.0.8.7. Thanks to @mhsuffolk for the report.

Changes version 2.3.4.:        
 - updated queries in index module and featured page to match core coding and support not showing buy button for products with attributes.

Changes version 2.3.3.:        
 - updated deprecated tep_cfg_ functions
 - renamed admin box module to catalog_featured.php

Changes version 2.3.2.:        
 - Fixed wrong configuration constants of the index nested module.

Changes version 2.3.1.:        
 - Fixed error in sql query of the index nested module. Thanks to @artfulweb for the report.

Changes version 2.3.0.:        
 - Complete remake of Admin Featured Products page. Modularized and code modernization to match actual core.
 - Merged search function into main page.
 - converted featured products functions to class.
 - removed siteWide hook.
 - Fixed wrong default expire date value to null. Thanks to @BrockleyJohn for the report
 - Updated all shop modules to use products class

Changes version 2.2.5.:        
 - Fixed error in the queries of the index modules for not retrieved final price. Thanks to @plamastus for the report.
 
Changes version 2.2.4.:        
 - Fixed error for PHP versions lower than 7.3.

Changes version 2.2.3.:        
 - Updated for Phoenix 1.0.7.12+.
 - Updated Box Module to use Products Class.
 - Moved shop hook and page template to override template.
 - Modernized code to match actual Core standards.
 - Updated Copyright Info to Phoenix Cart

Changes version 2.2.2.:        
 - Updated for Phoenix 1.0.7.11+.
 - Removed include currencies class in admin/featured.php and admin/select_featured.php.
 - Added Search Button language definition to admin/featured.php language file.
 - updated all language files to const
 - removed unused category support in index module.
 
Changes version 2.2.1.:        
 - Fixed error in admin/featured_products.php with search option. Thanks to @rupruprup for the report
 - Fixed missing $PHP_SELF global in content modules. Thanks to @rupruprup, @Omar_one and @kgtee

Changes version 2.2.0.:        
 - Updated featured_products.php to templateable page for OSCOM CE Phoenix 1.0.7.4.+
 - Updated content and box modules to abstract executable modules for OSCOM CE Phoenix 1.0.7.4.+
 - Updated content and box modules templates to match core coding
 - Updated admin/featured_products.php buttons to bootstrap buttons
 
Changes version 2.1.1.:        
 - Updated featured_products.php OSCOM CE Phoenix 1.0.4.x

Changes version 2.1.0.:        
 - Updated for OSCOM CE Phoenix 1.0.4.x
 - Updated index content module template files to match Phoenix 1.0.2.x-1.0.4.x product modules
 - Removed word length settings
 - Bootstrapped Admin/featured.php and Admin/select_featured.php
 - Removed Catalan and French admin language files
 - Translated Spanish and German admin/select_featured.php language files
 - Added Spanish and German store language files
 - Updated instructions
 
Changes version 2.0.0.:        
 - Updated for OSCOM CE Phoenix
 - moved expire featured products function call from application_top.php into a sitewide hook.
 - moved all html output into template files

Changes version 1.6.1.:        
 - Added missing "Delete" button in admin/featured.php

Changes version 1.6.:        
 - PHP 7.2 notice error fix in application_top.php
 - added admin/box module language file to avoid modifying main language file

Changes version 1.5.1.:        
 - fix in cm_in_featured_products.php

Changes version 1.5:        
 - Updated for 2.3.4.1. CE Frozen
 - Updated template naming and auto inclusion in content modules
 - updated deprecated each function in featured_products.php
 - fixed undefined messages in admin/featured.php and admin/select_featured.php
 - sanitized search input in admin/select_featured.php
 - Added  "is-product" class and  "data-is-special"  in content modules and featured products page
 - Added "data-has-attributes", "data-in-stock" and "data-product-id" to "buy" buttons in content modules and featured products page.

***********************************
	Installation Instructions
***********************************
WHAT IS IT?

The purpose of this contribution is to show selected products in the Infobox, instead of the previous stock new products Infobox. The featured products can be chosen in the admin. You also have the option of displaying just a side Infobox that would display only one featured item.
On the main default page of osCommerce, a selection of ALL the featured products will be displayed, and in top-level categories, only featured products that belong to that category. For example, "A Bug's Life" is a DVD movie in the sub-category "Cartoons", and "Cartoons" is a sub-category of "DVD Movies". If "A Bug's Life" is made a featured product, it will appear on the main osCommerce page as well as on the DVD Movies category page, but not on the Hardware page. 
If there are more featured products than the maximum allowed to be displayed, a random selection will be shown.
It's been written in such a way that the Infobox and main page content will *not* show up if there are no featured products to display.

HOW TO INSTALL

Installation should take about 5 - 10 minutes as there are some copying of files, and then some editing of current files necessary. 

=================
Database Changes
=================
There are no manual database changes. Everything will be installed automatically with the content module.
You will have the possibility to choose anytime if you want to keep or delete the new created table (featured) when uninstalling the content module.

===========
Copy Files
===========

Step 1:
As always, first BACKUP FILES AND DATABASE!!!


Step 2:
FTP all of the files and folders inside the catalog folder. Copy the directory structure that came with this archive, as it is. 
ALl files are new, none of your existing files will be overwritten.

  
Step 3:
 - Make sure you install at least one of the modules: content/index, content/index_nested. Once installed you can activate or deactivate them.

Step 4:
Make sure you are using the "override" template and have it selected in:
Admin : Configuration : My Store : Template Selection
Otherwise you must copy:
  templates/override/includes/hooks/shop/siteWide/featuredProducts.php
  templates/override/includes/pages/featured_products.php
TO:
  templates/YOUR SELECTED TEMPLATE/includes/hooks/shop/siteWide/featuredProducts.php
  templates/YOUR SELECTED TEMPLATE/includes/pages/featured_products.php
  
Step 5: 
How to Add Products:
•	Go to your store's admin section's "catalog" box
•	Click on "Featured Products".
•	Click on “New Featured Product”

You will now be presented with a screen that will allow you to select a product to display as featured. 

Optionally:
•	Fill in Product Name or Model to search for products. Click on “Search”. 
The search results will show up in the Products Drop down menu.
The expiration date is optional. Then click “insert” and you will be taken to the main Featured Products screen. 
Here you will see all of your featured products and you can set them as active or inactive. 
Any expired Featured Product will automatically get changed to “inactive” status when their expiration date is reached.

===========
That's it.
===========  
