ejsolutions 13 Posted October 6, 2021 Brilliant effort! One item stands out that really should've been a core inclusion, is an HTML editor for descriptions, IMHumbleO. Something like CKEditor, depending on suitability with jquery, PHP7/8 etc. 1 Hotclutch reacted to this Share this post Link to post Share on other sites
Hotclutch 188 Posted October 8, 2021 I am working on Meta Tags. Share this post Link to post Share on other sites
Hotclutch 188 Posted October 8, 2021 Tomorrow I start looking at the header tag modules catalog side. Share this post Link to post Share on other sites
Hotclutch 188 Posted October 8, 2021 Here is the code for Category SEO. It will add 1 query to every pageload. I will do another one each for manufacturers and products. function execute() { global $PHP_SELF, $oscTemplate, $current_category_id, $languages_id; if ( (basename($PHP_SELF) == 'index.php') && ($current_category_id > 0) ){ $categories_query = tep_db_query("select categories_name, categories_seo_title, categories_seo_description, categories_seo_keywords from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "' limit 1"); if (tep_db_num_rows($categories_query) > 0) { $categories = tep_db_fetch_array($categories_query); if (tep_not_null($categories['categories_seo_title'])) { $oscTemplate->setTitle($categories['categories_seo_title'] . ', ' . STORE_NAME); } else { $oscTemplate->setTitle($categories['categories_name'] . ', ' . STORE_NAME); } if ( tep_not_null($categories['categories_seo_description']) ) { $oscTemplate->addBlock('<meta name="description" content="' . tep_output_string($categories['categories_seo_description']) . '" />', $this->group); } if ( tep_not_null($categories['categories_seo_keywords']) ) { $oscTemplate->addBlock('<meta name="keywords" content="' . tep_output_string($categories['categories_seo_keywords']) . '" />', $this->group); } } } } Share this post Link to post Share on other sites
Hotclutch 188 Posted October 8, 2021 Manufacturers. function execute() { global $PHP_SELF, $oscTemplate, $languages_id; if (basename($PHP_SELF) == FILENAME_DEFAULT) { if (isset($_GET['manufacturers_id']) && is_numeric($_GET['manufacturers_id'])) { $manufacturers_query = tep_db_query("select m.manufacturers_name, mi.manufacturers_seo_title, mi.manufacturers_seo_description, mi.manufacturers_seo_keywords from " . TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS_INFO . " mi where m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' and mi.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' and mi.languages_id = '" . (int)$languages_id . "'"); if (tep_db_num_rows($manufacturers_query)) { $manufacturers = tep_db_fetch_array($manufacturers_query); if (tep_not_null($manufacturers['manufacturers_seo_title'])) { $oscTemplate->setTitle($manufacturers['manufacturers_seo_title'] . ', ' . STORE_NAME); } else { $oscTemplate->setTitle($manufacturers['manufacturers_name'] . ', ' . STORE_NAME); } if ( tep_not_null($manufacturers['manufacturers_seo_description']) ) { $oscTemplate->addBlock('<meta name="description" content="' . tep_output_string($manufacturers['manufacturers_seo_description']) . '" />', $this->group); } if ( tep_not_null($manufacturers['manufacturers_seo_keywords']) ) { $oscTemplate->addBlock('<meta name="keywords" content="' . tep_output_string($manufacturers['manufacturers_seo_keywords']) . '" />', $this->group); } } } } } Share this post Link to post Share on other sites
Hotclutch 188 Posted October 8, 2021 Products. function execute() { global $PHP_SELF, $oscTemplate, $languages_id, $product_check; if (basename($PHP_SELF) == FILENAME_PRODUCT_INFO) { if (isset($_GET['products_id'])) { if ($product_check['total'] > 0) { $product_info_query = tep_db_query("select pd.products_name, pd.products_seo_title, pd.products_seo_description, pd.products_seo_keywords from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$_GET['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_info = tep_db_fetch_array($product_info_query); if (tep_not_null($product_info['products_seo_title'])) { $oscTemplate->setTitle($product_info['products_seo_title'] . ', ' . STORE_NAME); } else { $oscTemplate->setTitle($product_info['products_name'] . ', ' . STORE_NAME); } if ( tep_not_null($product_info['products_seo_description']) ) { $oscTemplate->addBlock('<meta name="description" content="' . tep_output_string($product_info['products_seo_description']) . '" />', $this->group); } if ( tep_not_null($product_info['products_seo_keywords']) ) { $oscTemplate->addBlock('<meta name="keywords" content="' . tep_output_string($product_info['products_seo_keywords']) . '" />', $this->group); } } } } } Share this post Link to post Share on other sites
Hotclutch 188 Posted October 9, 2021 https://www.dropbox.com/s/4kre1hbg36c8ao6/W3-osC Seo Meta Tags.zip?dl=0 -> Category & Manufacturer Descriptions. -> Category, Manufacturer, Product Titles and Meta. That completes SEO Meta Tags for W3-osC. Follow the instructions in the package. Share this post Link to post Share on other sites
Hotclutch 188 Posted October 9, 2021 Display Product Name instead of Model in breadcrumb trail. Follow the updated instructions in the package above. Share this post Link to post Share on other sites
Hotclutch 188 Posted October 11, 2021 I have done some more work on ORP Related Products. -> Moved the Install/Uninstall SQL from the product module to Configuration. -> Replaced hardcoded filenames and database definitions. Share this post Link to post Share on other sites
Hotclutch 188 Posted October 11, 2021 In the SQL installer, there are 2 php8 errors: Warning: Undefined array key "install" switch ($_GET['install']) { this is the section of code: switch ($_GET['install']) { case ('new'): install_ORP_to_sql(); tep_redirect(tep_href_link($filename)); break; case ('remove'): $group_id = get_group_id($contrib); remove_keys($group_id); remove_group_id($contrib); remove_table(); tep_redirect(tep_href_link($filename)); break; case ('upgrade'): $group_id = get_group_id($contrib); remove_keys($group_id); install_ORP_to_sql($group_id); tep_redirect(tep_href_link($filename)); break; } And Fatal error: Uncaught TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, bool given in if (sizeof($group_id_array <= 1)) { function get_group_id($config_title) { $group_id_array = tep_db_fetch_array(tep_db_query("SELECT configuration_group_id FROM " . TABLE_CONFIGURATION_GROUP . " WHERE configuration_group_title like '". $config_title . "'")); if (sizeof($group_id_array <= 1)) { return $group_id_array['configuration_group_id']; } remove_group_id($contrib); return 0; } Share this post Link to post Share on other sites
Demitry 79 Posted October 11, 2021 (edited) if (is_array($group_id_array) && sizeof($group_id_array <= 1)) { Should really be... if (is_array($group_id_array) && sizeof($group_id_array) <= 1) { Edited October 11, 2021 by Demitry osCommerce: made for programmers, ...because store owners do not want to be programmers. https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce Share this post Link to post Share on other sites
Demitry 79 Posted October 11, 2021 Try this for the first one. switch (isset($_GET['install'])) { or switch ((isset($_GET['install']) ? $_GET['install'] : null)) { 1 Hotclutch reacted to this osCommerce: made for programmers, ...because store owners do not want to be programmers. https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce Share this post Link to post Share on other sites
Hotclutch 188 Posted October 11, 2021 16 minutes ago, Demitry said: Try this for the first one. switch (isset($_GET['install'])) { or switch ((isset($_GET['install']) ? $_GET['install'] : null)) { The first one works to clear the error. The other one I will look at again tomorrow. Share this post Link to post Share on other sites
Hotclutch 188 Posted October 12, 2021 tep_get_products_name tep_get_products_description tep_get_products_url function tep_get_products_name($product_id, $language_id = 0) { global $languages_id; if ($language_id == 0) $language_id = $languages_id; $product_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_name'] ?? ''; } function tep_get_products_description($product_id, $language_id) { $product_query = tep_db_query("select products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_description'] ?? ''; } function tep_get_products_url($product_id, $language_id) { $product_query = tep_db_query("select products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_url'] ?? ''; } I am starting to use ?? - null coalescing operator https://www.tutorialspoint.com/php7/php7_coalescing_operator.htm Which means the code is no longer compatible with php versions < 7. Share this post Link to post Share on other sites
Hotclutch 188 Posted October 12, 2021 Updating fontawesome to V6. https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta2/css/all.min.css Share this post Link to post Share on other sites
Hotclutch 188 Posted October 13, 2021 Ajax Attribute Manager for W3-osCommerce -> based on V2.8.14 https://apps.oscommerce.com/6E6Qw&ajax-attribute-manager -> tested on php8 Share this post Link to post Share on other sites
Hotclutch 188 Posted October 13, 2021 On 10/9/2021 at 11:21 AM, Hotclutch said: https://www.dropbox.com/s/4kre1hbg36c8ao6/W3-osC Seo Meta Tags.zip?dl=0 -> Category & Manufacturer Descriptions. -> Category, Manufacturer, Product Titles and Meta. That completes SEO Meta Tags for W3-osC. Follow the instructions in the package. There's an error in categories.php tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_url, products_viewed, products_seo_title, products_seo_description, products_seo_keywords) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_url']) . "', '0')"); Should be: tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_url, products_viewed, products_seo_title, products_seo_description, products_seo_keywords) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_url']) . "', '0', '" . tep_db_input($description['products_seo_title']) . "', '" . tep_db_input($description['products_seo_description']) . "', '" . tep_db_input($description['products_seo_keywords']) . "')"); Also the instruction for functions/general.php has been amended (for php8). Step 5: catalog/admin/includes/functions/general.php Add before the closing ?> // BOF SEO Meta Tags W3-osC function tep_get_category_description($category_id, $language_id) { $category_query = tep_db_query("select categories_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'"); $category = tep_db_fetch_array($category_query); return $category['categories_description'] ?? ''; } function tep_get_manufacturer_description($manufacturer_id, $language_id) { $manufacturer_query = tep_db_query("select manufacturers_description from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int)$manufacturer_id . "' and languages_id = '" . (int)$language_id . "'"); $manufacturer = tep_db_fetch_array($manufacturer_query); return $manufacturer['manufacturers_description'] ?? ''; } function tep_get_category_seo_description($category_id, $language_id) { $category_query = tep_db_query("select categories_seo_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'"); $category = tep_db_fetch_array($category_query); return $category['categories_seo_description'] ?? ''; } function tep_get_category_seo_keywords($category_id, $language_id) { $category_query = tep_db_query("select categories_seo_keywords from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'"); $category = tep_db_fetch_array($category_query); return $category['categories_seo_keywords'] ?? ''; } function tep_get_category_seo_title($category_id, $language_id = 0) { global $languages_id; if ($language_id == 0) $language_id = $languages_id; $category_query = tep_db_query("select categories_seo_title from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'"); $category = tep_db_fetch_array($category_query); return $category['categories_seo_title'] ?? ''; } function tep_get_manufacturer_seo_description($manufacturer_id, $language_id) { $manufacturer_query = tep_db_query("select manufacturers_seo_description from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int)$manufacturer_id . "' and languages_id = '" . (int)$language_id . "'"); $manufacturer = tep_db_fetch_array($manufacturer_query); return $manufacturer['manufacturers_seo_description'] ?? ''; } function tep_get_manufacturer_seo_keywords($manufacturer_id, $language_id) { $manufacturer_query = tep_db_query("select manufacturers_seo_keywords from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int)$manufacturer_id . "' and languages_id = '" . (int)$language_id . "'"); $manufacturer = tep_db_fetch_array($manufacturer_query); return $manufacturer['manufacturers_seo_keywords'] ?? ''; } function tep_get_manufacturer_seo_title($manufacturer_id, $language_id) { $manufacturer_query = tep_db_query("select manufacturers_seo_title from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int)$manufacturer_id . "' and languages_id = '" . (int)$language_id . "'"); $manufacturer = tep_db_fetch_array($manufacturer_query); return $manufacturer['manufacturers_seo_title'] ?? ''; } function tep_get_products_seo_description($product_id, $language_id = 0) { global $languages_id; if ($language_id == 0) $language_id = $languages_id; $product_query = tep_db_query("select products_seo_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_seo_description'] ?? ''; } function tep_get_products_seo_keywords($product_id, $language_id = 0) { global $languages_id; if ($language_id == 0) $language_id = $languages_id; $product_query = tep_db_query("select products_seo_keywords from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_seo_keywords'] ?? ''; } function tep_get_products_seo_title($product_id, $language_id = 0) { global $languages_id; if ($language_id == 0) $language_id = $languages_id; $product_query = tep_db_query("select products_seo_title from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'"); $product = tep_db_fetch_array($product_query); return $product['products_seo_title'] ?? ''; } // EOF SEO Meta Tags W3-osC Package updated. Share this post Link to post Share on other sites
Hotclutch 188 Posted October 14, 2021 Message stack in Admin updated. Share this post Link to post Share on other sites
Hotclutch 188 Posted October 15, 2021 I installed KissIT Image Thumbnailer by the original author (14 July 2012), on php8, and everything appears to work fine. https://apps.oscommerce.com/Get&39J0f Share this post Link to post Share on other sites
Hotclutch 188 Posted October 16, 2021 Admin/invoice.php updated. Share this post Link to post Share on other sites
Hotclutch 188 Posted October 16, 2021 Packing Slip. Share this post Link to post Share on other sites
Hotclutch 188 Posted October 16, 2021 Special Expire Date: https://apps.oscommerce.com/aLIAl&special-expire-date-in-product-page Share this post Link to post Share on other sites
Hotclutch 188 Posted October 25, 2021 Wish List Added Share this post Link to post Share on other sites