From 65f0efa5554ff874f062b7cbaa143bd4d572de1a Mon Sep 17 00:00:00 2001 From: Matt Fletcher Date: Thu, 25 Jun 2020 12:41:57 +0000 Subject: [PATCH 01/16] Update to modern standard --- includes/modules/boxes/bm_languages.php | 78 ++++++++++--------------- 1 file changed, 32 insertions(+), 46 deletions(-) diff --git a/includes/modules/boxes/bm_languages.php b/includes/modules/boxes/bm_languages.php index 5cf8c755e..6c7d5a782 100644 --- a/includes/modules/boxes/bm_languages.php +++ b/includes/modules/boxes/bm_languages.php @@ -10,67 +10,53 @@ Released under the GNU General Public License */ - class bm_languages { - var $code = 'bm_languages'; - var $group = 'boxes'; - var $title; - var $description; - var $sort_order; - var $enabled = false; + class bm_languages extends abstract_block_module { - function __construct() { - $this->title = MODULE_BOXES_LANGUAGES_TITLE; - $this->description = MODULE_BOXES_LANGUAGES_DESCRIPTION; + const CONFIG_KEY_BASE = 'MODULE_BOXES_LANGUAGES_'; - if ( defined('MODULE_BOXES_LANGUAGES_STATUS') ) { - $this->sort_order = MODULE_BOXES_LANGUAGES_SORT_ORDER; - $this->enabled = (MODULE_BOXES_LANGUAGES_STATUS == 'True'); + public function execute() { + global $PHP_SELF, $lng, $request_type; - $this->group = ((MODULE_BOXES_LANGUAGES_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right'); - } - } - - function execute() { - global $PHP_SELF, $lng, $request_type, $oscTemplate; - - if (substr(basename($PHP_SELF), 0, 8) != 'checkout') { - if (!isset($lng) || (isset($lng) && !is_object($lng))) { - include('includes/classes/language.php'); - $lng = new language; + if (substr(basename($PHP_SELF), 0, 8) !== 'checkout') { + if (!isset($lng) || !($lng instanceof language)) { + $lng = new language(); } if (count($lng->catalog_languages) > 1) { $languages_string = ''; + $parameters = tep_get_all_get_params(['language', 'currency']) . 'language='; foreach($lng->catalog_languages as $key => $value) { - $languages_string .= ' ' .tep_image('includes/languages/' . $value['directory'] . '/images/' . $value['image'], htmlspecialchars($value['name']), NULL, NULL, NULL, false) . ' '; + $languages_string .= ' ' + . tep_image('includes/languages/' . $value['directory'] . '/images/' . $value['image'], htmlspecialchars($value['name']), null, null, null, false) + . ' '; } - + $tpl_data = ['group' => $this->group, 'file' => __FILE__]; include 'includes/modules/block_template.php'; } } } - function isEnabled() { - return $this->enabled; - } - - function check() { - return defined('MODULE_BOXES_LANGUAGES_STATUS'); - } - - function install() { - tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Languages Module', 'MODULE_BOXES_LANGUAGES_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_LANGUAGES_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); - tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_LANGUAGES_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + protected function get_parameters() { + return [ + 'MODULE_BOXES_LANGUAGES_STATUS' => [ + 'title' => 'Enable Languages Module', + 'value' => 'True', + 'desc' => 'Do you want to add the module to your shop?', + 'set_func' => "tep_cfg_select_option(['True', 'False'], ", + ], + 'MODULE_BOXES_LANGUAGES_CONTENT_PLACEMENT' => [ + 'title' => 'Content Placement', + 'value' => 'Right Column', + 'desc' => 'Should the module be loaded in the left or right column?', + 'set_func' => "tep_cfg_select_option(['Left Column', 'Right Column'], ", + ], + 'MODULE_BOXES_LANGUAGES_SORT_ORDER' => [ + 'title' => 'Sort Order', + 'value' => '0', + 'desc' => 'Sort order of display. Lowest is displayed first.', + ], + ]; } - function remove() { - tep_db_query("delete from configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - return array('MODULE_BOXES_LANGUAGES_STATUS', 'MODULE_BOXES_LANGUAGES_CONTENT_PLACEMENT', 'MODULE_BOXES_LANGUAGES_SORT_ORDER'); - } } -?> From 7480e83addd0920adb8f305c1ffe7226fe5f3318 Mon Sep 17 00:00:00 2001 From: Matt Fletcher Date: Thu, 25 Jun 2020 22:20:20 +0000 Subject: [PATCH 02/16] Fix WSOD on admin > hooks Consistent and distinct variable naming to avoid fatal errors with updates elsewhere. --- admin/modules_hooks.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/admin/modules_hooks.php b/admin/modules_hooks.php index 423230f3e..f928aa690 100644 --- a/admin/modules_hooks.php +++ b/admin/modules_hooks.php @@ -12,13 +12,11 @@ require 'includes/application_top.php'; - $admin_hooks = $OSCOM_Hooks; - $OSCOM_Hooks = new hooks('shop'); + $hooks = new hooks('shop'); $template_name = defined('TEMPLATE_SELECTION') ? TEMPLATE_SELECTION : 'default'; $template_name .= '_template'; $template = new $template_name(); - $directories = $OSCOM_Hooks->get_hook_directories(); - $OSCOM_Hooks = $admin_hooks; + $directories = $hooks->get_hook_directories(); function tep_find_contents($base, $test) { $contents = []; @@ -64,7 +62,7 @@ function tep_find_listeners($class) { $class = "hook_{$site}_{$group}_{$pathinfo['filename']}"; foreach (tep_find_listeners($class) as $listener) { tep_guarantee_all( - $hooks, + $contents, $site, $group, $listener, @@ -92,7 +90,7 @@ function tep_find_listeners($class) { } tep_guarantee_all( - $hooks, + $contents, $hook['hooks_site'], $hook['hooks_group'], $hook['hooks_action'], @@ -108,7 +106,7 @@ function tep_find_listeners($class) {
$groups ) { + foreach ( $contents as $site => $groups ) { ?> From 058087cf5d6ea351146bb17d2f82795e86aca16f Mon Sep 17 00:00:00 2001 From: Matt Fletcher Date: Thu, 25 Jun 2020 22:28:31 +0000 Subject: [PATCH 03/16] Initialize variable --- admin/modules_hooks.php | 1 + 1 file changed, 1 insertion(+) diff --git a/admin/modules_hooks.php b/admin/modules_hooks.php index f928aa690..6fbac52f1 100644 --- a/admin/modules_hooks.php +++ b/admin/modules_hooks.php @@ -49,6 +49,7 @@ function tep_find_listeners($class) { return $listeners; } + $contents = []; foreach ($directories as $directory) { $directory = dirname($directory); foreach (tep_find_contents($directory, 'is_dir') as $site) { From 79376b24eec234648522cf0c5ff4bc9a26eed769 Mon Sep 17 00:00:00 2001 From: Matt Fletcher Date: Sat, 27 Jun 2020 11:28:00 +0000 Subject: [PATCH 04/16] Update only default address when customer edited --- admin/customers.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/admin/customers.php b/admin/customers.php index 6b9ab62a2..30d6149a6 100644 --- a/admin/customers.php +++ b/admin/customers.php @@ -41,7 +41,11 @@ } else { require 'includes/functions/password_funcs.php'; } - $customer_data->update($customer_details, ['id' => $customer_details['id']]); + + $customer_data->update($customer_details, [ + 'id' => $customer_details['id'], + 'address_book_id' => (int)$_POST['default_address_id'], + ]); tep_db_query("UPDATE customers_info SET customers_info_date_account_last_modified = NOW() WHERE customers_info_id = " . (int)$customer_details['id']); $OSCOM_Hooks->call('customers', 'updateAction'); @@ -89,7 +93,9 @@
'; echo '
'; @@ -100,9 +106,6 @@ echo tep_hide_session_id(); echo ''; } - else { - echo tep_draw_bootstrap_button(IMAGE_CANCEL, 'fas fa-angle-left', tep_href_link('customers.php', tep_get_all_get_params(array('action'))), null, null, 'btn-light'); - } ?>
@@ -112,7 +115,7 @@ $hooks =& $OSCOM_Hooks; $oscTemplate = new oscTemplate(); echo tep_draw_form('customers', 'customers.php', tep_get_all_get_params(['action']) . 'action=update', 'post'); - echo tep_draw_hidden_field('default_address_id', $customer_data->get('address_id', $customer_details)); + echo tep_draw_hidden_field('default_address_id', $customer_data->get('default_address_id', $customer_details)); $cwd = getcwd(); chdir(DIR_FS_CATALOG); From dc2e2a8aa3edf180c15ac643aa69dc1c28f687ac Mon Sep 17 00:00:00 2001 From: gburton Date: Sat, 27 Jun 2020 15:52:34 +0100 Subject: [PATCH 05/16] Sort Order of order_total modules Ensure that database matches files --- includes/modules/order_total/ot_shipping.php | 2 +- includes/modules/order_total/ot_subtotal.php | 2 +- includes/modules/order_total/ot_tax.php | 2 +- includes/modules/order_total/ot_total.php | 2 +- install/phoenix.sql | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/includes/modules/order_total/ot_shipping.php b/includes/modules/order_total/ot_shipping.php index 5318f3338..544fe4057 100644 --- a/includes/modules/order_total/ot_shipping.php +++ b/includes/modules/order_total/ot_shipping.php @@ -79,7 +79,7 @@ public function get_parameters() { ], 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER' => [ 'title' => 'Sort Order', - 'value' => '2', + 'value' => '20', 'desc' => 'Sort order of display.', ], 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING' => [ diff --git a/includes/modules/order_total/ot_subtotal.php b/includes/modules/order_total/ot_subtotal.php index e9ca4cae2..93acdbbc6 100644 --- a/includes/modules/order_total/ot_subtotal.php +++ b/includes/modules/order_total/ot_subtotal.php @@ -49,7 +49,7 @@ function keys() { function install() { tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Sub-Total', 'MODULE_ORDER_TOTAL_SUBTOTAL_STATUS', 'true', 'Do you want to display the order sub-total cost?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); - tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_SUBTOTAL_SORT_ORDER', '1', 'Sort order of display.', '6', '2', now())"); + tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_SUBTOTAL_SORT_ORDER', '10', 'Sort order of display.', '6', '2', now())"); } function remove() { diff --git a/includes/modules/order_total/ot_tax.php b/includes/modules/order_total/ot_tax.php index 6adfd1aa3..db18f233e 100644 --- a/includes/modules/order_total/ot_tax.php +++ b/includes/modules/order_total/ot_tax.php @@ -53,7 +53,7 @@ function keys() { function install() { tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Tax', 'MODULE_ORDER_TOTAL_TAX_STATUS', 'true', 'Do you want to display the order tax value?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); - tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_TAX_SORT_ORDER', '3', 'Sort order of display.', '6', '2', now())"); + tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_TAX_SORT_ORDER', '30', 'Sort order of display.', '6', '2', now())"); } function remove() { diff --git a/includes/modules/order_total/ot_total.php b/includes/modules/order_total/ot_total.php index 43a5477bc..0ea5a81ab 100644 --- a/includes/modules/order_total/ot_total.php +++ b/includes/modules/order_total/ot_total.php @@ -49,7 +49,7 @@ function keys() { function install() { tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Total', 'MODULE_ORDER_TOTAL_TOTAL_STATUS', 'true', 'Do you want to display the total order value?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); - tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_TOTAL_SORT_ORDER', '4', 'Sort order of display.', '6', '2', now())"); + tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_TOTAL_SORT_ORDER', '40', 'Sort order of display.', '6', '2', now())"); } function remove() { diff --git a/install/phoenix.sql b/install/phoenix.sql index 4b82eb833..7f118c0a4 100644 --- a/install/phoenix.sql +++ b/install/phoenix.sql @@ -705,7 +705,7 @@ INSERT INTO configuration (configuration_title, configuration_key, configuration INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Default Image', 'DEFAULT_IMAGE', '', 'The default image to show if the image is not a valid file. Leave blank not to show a default.', '4', '5', NOW()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Installed Modules', 'MODULE_PAYMENT_INSTALLED', 'cod.php', 'List of payment module filenames separated by a semi-colon. This is automatically updated. No need to edit. (Example: cod.php;paypal_express.php)', '6', '0', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Installed Modules', 'MODULE_ORDER_TOTAL_INSTALLED', 'ot_subtotal.php;ot_tax.php;ot_shipping.php;ot_total.php', 'List of order_total module filenames separated by a semi-colon. This is automatically updated. No need to edit. (Example: ot_subtotal.php;ot_tax.php;ot_shipping.php;ot_total.php)', '6', '0', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Installed Modules', 'MODULE_ORDER_TOTAL_INSTALLED', 'ot_subtotal.php;ot_shipping.php;ot_tax.php;ot_total.php', 'List of order_total module filenames separated by a semi-colon. This is automatically updated. No need to edit.', '6', '0', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Installed Modules', 'MODULE_SHIPPING_INSTALLED', 'flat.php', 'List of shipping module filenames separated by a semi-colon. This is automatically updated. No need to edit. (Example: ups.php;flat.php;item.php)', '6', '0', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Installed Modules', 'MODULE_ACTION_RECORDER_INSTALLED', 'ar_admin_login.php;ar_contact_us.php;ar_reset_password.php', 'List of action recorder module filenames separated by a semi-colon. This is automatically updated. No need to edit.', '6', '0', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Installed Modules', 'MODULE_CONTENT_NAVBAR_INSTALLED', 'nb_hamburger_button.php;nb_brand.php;nb_currencies.php;nb_account.php;nb_shopping_cart.php;nb_special_offers.php', 'List of navbar module filenames separated by a semi-colon. This is automatically updated. No need to edit.', '6', '0', now()); @@ -722,16 +722,16 @@ INSERT INTO configuration (configuration_title, configuration_key, configuration INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Default Language', 'DEFAULT_LANGUAGE', 'en', 'Default Language', '6', '0', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Default Order Status For New Orders', 'DEFAULT_ORDERS_STATUS_ID', '1', 'When a new order is created, this order status will be assigned to it.', '6', '0', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display Shipping', 'MODULE_ORDER_TOTAL_SHIPPING_STATUS', 'True', 'Do you want to display the order shipping cost?', '6', '1','tep_cfg_select_option([\'True\', \'False\'], ', NOW()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Sort Order', 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER', '2', 'Sort order of display.', '6', '2', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Sort Order', 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER', '20', 'Sort order of display.', '6', '2', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Allow Free Shipping', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING', 'False', 'Do you want to allow free shipping?', '6', '3', 'tep_cfg_select_option([\'True\', \'False\'], ', NOW()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, date_added) VALUES ('Free Shipping For Orders Over', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER', '50', 'Provide free shipping for orders over the set amount.', '6', '4', 'currencies->format', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Provide Free Shipping For Orders Made', 'MODULE_ORDER_TOTAL_SHIPPING_DESTINATION', 'national', 'Provide free shipping for orders sent to the set destination.', '6', '5', 'tep_cfg_select_option([\'national\', \'international\', \'both\'], ', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display Sub-Total', 'MODULE_ORDER_TOTAL_SUBTOTAL_STATUS', 'true', 'Do you want to display the order sub-total cost?', '6', '1','tep_cfg_select_option([\'true\', \'false\'], ', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Sort Order', 'MODULE_ORDER_TOTAL_SUBTOTAL_SORT_ORDER', '1', 'Sort order of display.', '6', '2', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Sort Order', 'MODULE_ORDER_TOTAL_SUBTOTAL_SORT_ORDER', '10', 'Sort order of display.', '6', '2', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display Tax', 'MODULE_ORDER_TOTAL_TAX_STATUS', 'true', 'Do you want to display the order tax value?', '6', '1','tep_cfg_select_option([\'true\', \'false\'], ', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Sort Order', 'MODULE_ORDER_TOTAL_TAX_SORT_ORDER', '3', 'Sort order of display.', '6', '2', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Sort Order', 'MODULE_ORDER_TOTAL_TAX_SORT_ORDER', '30', 'Sort order of display.', '6', '2', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display Total', 'MODULE_ORDER_TOTAL_TOTAL_STATUS', 'true', 'Do you want to display the total order value?', '6', '1','tep_cfg_select_option([\'true\', \'false\'], ', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Sort Order', 'MODULE_ORDER_TOTAL_TOTAL_SORT_ORDER', '4', 'Sort order of display.', '6', '2', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Sort Order', 'MODULE_ORDER_TOTAL_TOTAL_SORT_ORDER', '40', 'Sort order of display.', '6', '2', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Minimum Minutes Per E-Mail', 'MODULE_ACTION_RECORDER_CONTACT_US_EMAIL_MINUTES', '15', 'Minimum number of minutes to allow 1 e-mail to be sent (eg, 15 for 1 e-mail every 15 minutes)', '6', '0', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Allowed Minutes', 'MODULE_ACTION_RECORDER_ADMIN_LOGIN_MINUTES', '5', 'Number of minutes to allow login attempts to occur.', '6', '0', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Allowed Attempts', 'MODULE_ACTION_RECORDER_ADMIN_LOGIN_ATTEMPTS', '3', 'Number of login attempts to allow within the specified period.', '6', '0', now()); From ccd12b96f0a6d90ae95f299a9facf81c70a41654 Mon Sep 17 00:00:00 2001 From: Matt Fletcher Date: Sat, 27 Jun 2020 17:38:22 +0000 Subject: [PATCH 06/16] Fix shipping tax during checkout --- .../system/versioned/1.0.7.3/abstract_shipping_module.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/system/versioned/1.0.7.3/abstract_shipping_module.php b/includes/system/versioned/1.0.7.3/abstract_shipping_module.php index 100c9290a..08b50acdd 100644 --- a/includes/system/versioned/1.0.7.3/abstract_shipping_module.php +++ b/includes/system/versioned/1.0.7.3/abstract_shipping_module.php @@ -17,10 +17,14 @@ abstract class abstract_shipping_module extends abstract_zoneable_module { public $quotes; protected $country; + public function __construct() { + parent::__construct(); + $this->tax_class = $this->base_constant('TAX_CLASS') ?? 0; + } + public function quote_common() { global $order; - $this->tax_class = $this->base_constant('TAX_CLASS') ?? 0; if ($this->tax_class > 0) { $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); } From cd08dd9c3a3bb4f6ec0ad337c8cc34d88ed5e9b3 Mon Sep 17 00:00:00 2001 From: Matt Fletcher Date: Mon, 29 Jun 2020 20:58:10 +0000 Subject: [PATCH 07/16] Fix SQL error on PayPal login attempt --- includes/modules/content/login/cm_paypal_login.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/modules/content/login/cm_paypal_login.php b/includes/modules/content/login/cm_paypal_login.php index 4d1eb82c3..9dac9d3ae 100644 --- a/includes/modules/content/login/cm_paypal_login.php +++ b/includes/modules/content/login/cm_paypal_login.php @@ -98,7 +98,7 @@ function execute() { function guarantee_address($customer_id, $address) { $address['id'] = $customer_id; - $check_query = tep_db_query($GLOBALS['customer_data']->build_read(['address_book_id'], 'address_book', $address) . "' LIMIT 1"); + $check_query = tep_db_query($GLOBALS['customer_data']->build_read(['address_book_id'], 'address_book', $address) . " LIMIT 1"); if ($check = tep_db_fetch_array($check_query)) { $_SESSION['sendto'] = $check['address_book_id']; } else { From de5add868026120822143064a11c6407dc053312 Mon Sep 17 00:00:00 2001 From: Matt Fletcher Date: Tue, 30 Jun 2020 07:23:32 +0000 Subject: [PATCH 08/16] Fix infobox forms As per the HTML spec, forms can't start inside a table but outside a TD or TH. So any form that needs to cover multiple elements in a table should be outside the table. Otherwise Javascript won't be able to access the form because it can't parse the DOM. This fixes things like editing the Braintree module's configuration, which relies on Javascript to set one of the values. Left forms that start and end inside the same table element, as those are fine. --- admin/includes/classes/box.php | 13 ++++++----- admin/includes/classes/table_block.php | 23 ++++++-------------- admin/includes/classes/templates/tpl_box.php | 10 +++++++++ 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/admin/includes/classes/box.php b/admin/includes/classes/box.php index ccd18aa6b..bea482084 100644 --- a/admin/includes/classes/box.php +++ b/admin/includes/classes/box.php @@ -19,9 +19,6 @@ class box extends tableBlock { - //private $this->heading = []; - //private $this->contents = []; - function infoBox($heading, $contents) { if (is_array($heading)) { $heading = $heading[0]['text']; @@ -29,8 +26,14 @@ function infoBox($heading, $contents) { $parameters = ['heading' => &$heading, 'contents' => &$contents]; $GLOBALS['OSCOM_Hooks']->call(pathinfo($GLOBALS['PHP_SELF'], PATHINFO_FILENAME), 'infoBox', $parameters); - //$this->table_row_parameters = ''; - //$this->table_data_parameters = 'class="infoBoxContent"'; + if (isset($contents['form'])) { + $form_start = $contents['form'] . PHP_EOL; + $form_close = '' . PHP_EOL; + unset($contents['form']); + } else { + $form_start = ''; + $form_close = ''; + } $contents = $this->tableBlock($contents); ob_start(); diff --git a/admin/includes/classes/table_block.php b/admin/includes/classes/table_block.php index 18d66082f..aef9d2b86 100644 --- a/admin/includes/classes/table_block.php +++ b/admin/includes/classes/table_block.php @@ -11,30 +11,23 @@ */ class tableBlock { - var $table_parameters = ''; - var $table_row_parameters = ''; - var $table_data_parameters = ''; + + public $table_row_parameters = ''; + public $table_data_parameters = ''; function __construct() {} function tableBlock($contents) { $tableBox_string = ''; - $form_set = false; - if (isset($contents['form'])) { - $tableBox_string .= $contents['form'] . PHP_EOL; - $form_set = true; - array_shift($contents); - } - - for ($i=0, $n=sizeof($contents); $i<$n; $i++) { + for ($i=0, $n=count($contents); $i<$n; $i++) { $tableBox_string .= 'table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters; if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params']; $tableBox_string .= '>'; if (isset($contents[$i][0]) && is_array($contents[$i][0])) { - for ($x=0, $y=sizeof($contents[$i]); $x<$y; $x++) { + for ($x=0, $y=count($contents[$i]); $x<$y; $x++) { if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) { $tableBox_string .= 'table_data_parameters)) { $tableBox_string .= ' ' . $this->table_data_parameters; } - $tableBox_string .= '>' . $contents[$i]['text'] . ''; + $tableBox_string .= '>' . $contents[$i]['text'] . '' . PHP_EOL; } $tableBox_string .= '
'; } - if ($form_set == true) $tableBox_string .= ''; - return $tableBox_string; } } diff --git a/admin/includes/classes/templates/tpl_box.php b/admin/includes/classes/templates/tpl_box.php index 955a4c512..c6d3f64bf 100644 --- a/admin/includes/classes/templates/tpl_box.php +++ b/admin/includes/classes/templates/tpl_box.php @@ -1,4 +1,9 @@
+
@@ -9,6 +14,11 @@
+
Date: Tue, 30 Jun 2020 10:13:30 +0100 Subject: [PATCH 09/16] Admin Menu Revert to Icons for all except XS. Change to popover for better readability. Align popover right/left as appropriate. --- .../english/modules/boxes/catalog.php | 2 +- .../english/modules/boxes/configuration.php | 2 +- .../english/modules/boxes/customers.php | 2 +- .../english/modules/boxes/layout.php | 2 +- .../english/modules/boxes/localization.php | 2 +- .../english/modules/boxes/modules.php | 2 +- .../english/modules/boxes/orders.php | 2 +- .../english/modules/boxes/paypal.php | 2 +- .../english/modules/boxes/reports.php | 2 +- .../languages/english/modules/boxes/taxes.php | 2 +- .../languages/english/modules/boxes/tools.php | 2 +- includes/hooks/admin/siteWide/popover.php | 30 +++++++++++++++++++ 12 files changed, 41 insertions(+), 11 deletions(-) create mode 100644 includes/hooks/admin/siteWide/popover.php diff --git a/admin/includes/languages/english/modules/boxes/catalog.php b/admin/includes/languages/english/modules/boxes/catalog.php index 0161154ae..9e184126d 100644 --- a/admin/includes/languages/english/modules/boxes/catalog.php +++ b/admin/includes/languages/english/modules/boxes/catalog.php @@ -10,4 +10,4 @@ Released under the GNU General Public License */ - define('BOX_HEADING_CATALOG', 'Catalog'); + define('BOX_HEADING_CATALOG', 'Catalog'); diff --git a/admin/includes/languages/english/modules/boxes/configuration.php b/admin/includes/languages/english/modules/boxes/configuration.php index 22d2a6e4c..6e4838eab 100644 --- a/admin/includes/languages/english/modules/boxes/configuration.php +++ b/admin/includes/languages/english/modules/boxes/configuration.php @@ -10,4 +10,4 @@ Released under the GNU General Public License */ - define('BOX_HEADING_CONFIGURATION', 'Configuration'); + define('BOX_HEADING_CONFIGURATION', 'Configuration'); diff --git a/admin/includes/languages/english/modules/boxes/customers.php b/admin/includes/languages/english/modules/boxes/customers.php index 231d644d2..1981697bd 100644 --- a/admin/includes/languages/english/modules/boxes/customers.php +++ b/admin/includes/languages/english/modules/boxes/customers.php @@ -10,4 +10,4 @@ Released under the GNU General Public License */ - define('BOX_HEADING_CUSTOMERS', 'Customers'); + define('BOX_HEADING_CUSTOMERS', 'Customers'); diff --git a/admin/includes/languages/english/modules/boxes/layout.php b/admin/includes/languages/english/modules/boxes/layout.php index e41ec5c7e..891b97c32 100644 --- a/admin/includes/languages/english/modules/boxes/layout.php +++ b/admin/includes/languages/english/modules/boxes/layout.php @@ -10,5 +10,5 @@ Released under the GNU General Public License */ - define('BOX_HEADING_LAYOUT', 'Layout Modules'); + define('BOX_HEADING_LAYOUT', 'Layout Modules'); \ No newline at end of file diff --git a/admin/includes/languages/english/modules/boxes/localization.php b/admin/includes/languages/english/modules/boxes/localization.php index 1552bf6f5..8f05a077e 100644 --- a/admin/includes/languages/english/modules/boxes/localization.php +++ b/admin/includes/languages/english/modules/boxes/localization.php @@ -10,5 +10,5 @@ Released under the GNU General Public License */ - define('BOX_HEADING_LOCALIZATION', 'Localization'); + define('BOX_HEADING_LOCALIZATION', 'Localization'); \ No newline at end of file diff --git a/admin/includes/languages/english/modules/boxes/modules.php b/admin/includes/languages/english/modules/boxes/modules.php index 227998fc7..b00f41ae1 100644 --- a/admin/includes/languages/english/modules/boxes/modules.php +++ b/admin/includes/languages/english/modules/boxes/modules.php @@ -10,5 +10,5 @@ Released under the GNU General Public License */ - define('BOX_HEADING_MODULES', 'Modules'); + define('BOX_HEADING_MODULES', 'Modules'); \ No newline at end of file diff --git a/admin/includes/languages/english/modules/boxes/orders.php b/admin/includes/languages/english/modules/boxes/orders.php index 2b8326f5f..a3bd63332 100644 --- a/admin/includes/languages/english/modules/boxes/orders.php +++ b/admin/includes/languages/english/modules/boxes/orders.php @@ -10,4 +10,4 @@ Released under the GNU General Public License */ - define('BOX_HEADING_ORDERS', 'Orders'); + define('BOX_HEADING_ORDERS', 'Orders'); diff --git a/admin/includes/languages/english/modules/boxes/paypal.php b/admin/includes/languages/english/modules/boxes/paypal.php index 559b758e0..777995877 100644 --- a/admin/includes/languages/english/modules/boxes/paypal.php +++ b/admin/includes/languages/english/modules/boxes/paypal.php @@ -10,7 +10,7 @@ Released under the GNU General Public License */ - define('MODULES_ADMIN_MENU_PAYPAL_HEADING', 'Paypal'); + define('MODULES_ADMIN_MENU_PAYPAL_HEADING', 'Paypal'); define('MODULES_ADMIN_MENU_PAYPAL_BALANCE', 'Balance'); define('MODULES_ADMIN_MENU_PAYPAL_CONFIGURE', 'Configure'); diff --git a/admin/includes/languages/english/modules/boxes/reports.php b/admin/includes/languages/english/modules/boxes/reports.php index eb33b4847..519f6518e 100644 --- a/admin/includes/languages/english/modules/boxes/reports.php +++ b/admin/includes/languages/english/modules/boxes/reports.php @@ -10,4 +10,4 @@ Released under the GNU General Public License */ - define('BOX_HEADING_REPORTS', 'Reports'); + define('BOX_HEADING_REPORTS', 'Reports'); diff --git a/admin/includes/languages/english/modules/boxes/taxes.php b/admin/includes/languages/english/modules/boxes/taxes.php index 2d0ba352f..01d5d9dd9 100644 --- a/admin/includes/languages/english/modules/boxes/taxes.php +++ b/admin/includes/languages/english/modules/boxes/taxes.php @@ -10,5 +10,5 @@ Released under the GNU General Public License */ - define('BOX_HEADING_LOCATION_AND_TAXES', 'Locations & Taxes'); + define('BOX_HEADING_LOCATION_AND_TAXES', 'Locations & Taxes'); \ No newline at end of file diff --git a/admin/includes/languages/english/modules/boxes/tools.php b/admin/includes/languages/english/modules/boxes/tools.php index 7f25c5965..7e35f7b0e 100644 --- a/admin/includes/languages/english/modules/boxes/tools.php +++ b/admin/includes/languages/english/modules/boxes/tools.php @@ -10,5 +10,5 @@ Released under the GNU General Public License */ - define('BOX_HEADING_TOOLS', 'Tools'); + define('BOX_HEADING_TOOLS', 'Tools'); \ No newline at end of file diff --git a/includes/hooks/admin/siteWide/popover.php b/includes/hooks/admin/siteWide/popover.php new file mode 100644 index 000000000..edf5411a8 --- /dev/null +++ b/includes/hooks/admin/siteWide/popover.php @@ -0,0 +1,30 @@ + +$(function () { + $('[data-toggle="popover"]').popover({ + container: 'body', + trigger: 'hover click' + }) +}) + +pp; + + return $popover; + } + +} From 3521c1ea6797a11477aa2b5b76a4d98c501104f6 Mon Sep 17 00:00:00 2001 From: gburton Date: Wed, 1 Jul 2020 10:42:13 +0100 Subject: [PATCH 10/16] Sub Category Display Default to 4 per Row. --- .../content/index_nested/cm_in_category_listing.php | 2 +- install/phoenix.sql | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/modules/content/index_nested/cm_in_category_listing.php b/includes/modules/content/index_nested/cm_in_category_listing.php index e2e366e90..a9a9b85b8 100644 --- a/includes/modules/content/index_nested/cm_in_category_listing.php +++ b/includes/modules/content/index_nested/cm_in_category_listing.php @@ -75,7 +75,7 @@ protected function get_parameters() { ], 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW_XL' => [ 'title' => 'Items In Each Row (XL)', - 'value' => '6', + 'value' => '4', 'desc' => 'How many products should display per Row in XL (Extra Large) viewport?', 'set_func' => "tep_cfg_select_option(['12', '11', '10', '9', '8', '7', '6', '5', '4', '3', '2', '1'], ", ], diff --git a/install/phoenix.sql b/install/phoenix.sql index 7f118c0a4..fbca45771 100644 --- a/install/phoenix.sql +++ b/install/phoenix.sql @@ -1565,10 +1565,10 @@ insert into configuration (configuration_title, configuration_key, configuration insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_IN_CATEGORY_LISTING_CONTENT_WIDTH', '12', 'What width container should the content be shown in?', '6', '2', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Category Card Layout', 'MODULE_CONTENT_IN_CATEGORY_LISTING_LAYOUT', 'card-deck', 'What Layout suits your shop? See card/#card-layout
card-columns is a special use case that will not suit most shops as card-columns is very difficult to layout and sort by...
', '6', '3', 'tep_cfg_select_option([\'card-group\', \'card-deck\', \'card-columns\'], ', now()); insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Items In Each Row (SM)', 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW_SM', '2', 'How many products should display per Row in SM (Small) viewport?', '6', '4', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); -insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Items In Each Row (MD)', 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW_MD', '3', 'How many products should display per Row in MD (Medium) viewport?', '6', '4', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); -insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Items In Each Row (LG)', 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW_LG', '4', 'How many products should display per Row in LG (Large) viewport?', '6', '4', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); -insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Items In Each Row (XL)', 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW_XL', '6', 'How many products should display per Row in XL (Extra Large) viewport?', '6', '4', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); -insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_IN_CATEGORY_LISTING_SORT_ORDER', '200', 'Sort order of display. Lowest is displayed first.', '6', '4', now()); +insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Items In Each Row (MD)', 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW_MD', '3', 'How many products should display per Row in MD (Medium) viewport?', '6', '5', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); +insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Items In Each Row (LG)', 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW_LG', '4', 'How many products should display per Row in LG (Large) viewport?', '6', '6', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); +insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Items In Each Row (XL)', 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW_XL', '6', 'How many products should display per Row in XL (Extra Large) viewport?', '4', '7', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); +insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_IN_CATEGORY_LISTING_SORT_ORDER', '200', 'Sort order of display. Lowest is displayed first.', '6', '8', now()); insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable New Products Module', 'MODULE_CONTENT_IN_CARD_PRODUCTS_STATUS', 'True', 'Do you want to enable this module?', '6', '1', 'tep_cfg_select_option([\'True\', \'False\'], ', now()); insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_IN_CARD_PRODUCTS_CONTENT_WIDTH', '12', 'What width container should the content be shown in? (12 = full width, 6 = half width).', '6', '2', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); From c0e9145266379236482a70f08fdad0d3b31ad3a7 Mon Sep 17 00:00:00 2001 From: gburton Date: Wed, 1 Jul 2020 14:02:10 +0100 Subject: [PATCH 11/16] Grid Cards Removes the card options in favour of griddable cards. --- .../content/index/cm_i_card_products.php | 2 +- .../templates/tpl_cm_i_card_products.php | 70 ++++++++--------- .../index_nested/cm_in_card_products.php | 2 +- .../index_nested/cm_in_category_listing.php | 38 ++-------- .../templates/tpl_cm_in_card_products.php | 70 ++++++++--------- .../templates/tpl_cm_in_category_listing.php | 34 +++------ .../product_info/cm_pi_also_purchased.php | 2 +- .../templates/tpl_cm_pi_also_purchased.php | 70 ++++++++--------- install/phoenix.sql | 13 +--- .../includes/components/product_listing.php | 75 +++++++++---------- .../includes/hooks/shop/index/catCSS.php | 35 --------- .../includes/hooks/shop/siteWide/cardCSS.php | 41 ---------- 12 files changed, 150 insertions(+), 302 deletions(-) delete mode 100644 templates/default/includes/hooks/shop/index/catCSS.php delete mode 100644 templates/default/includes/hooks/shop/siteWide/cardCSS.php diff --git a/includes/modules/content/index/cm_i_card_products.php b/includes/modules/content/index/cm_i_card_products.php index ca3c68986..cbf3b49aa 100644 --- a/includes/modules/content/index/cm_i_card_products.php +++ b/includes/modules/content/index/cm_i_card_products.php @@ -22,7 +22,7 @@ public function execute() { global $new_products_category_id, $currencies, $PHP_SELF; $content_width = MODULE_CONTENT_CARD_PRODUCTS_CONTENT_WIDTH; - $card_layout = IS_PRODUCT_PRODUCTS_LAYOUT; + $card_layout = IS_PRODUCT_PRODUCTS_DISPLAY_ROW; if ( empty($new_products_category_id) ) { $card_products_query = tep_db_query(<<<'EOSQL' diff --git a/includes/modules/content/index/templates/tpl_cm_i_card_products.php b/includes/modules/content/index/templates/tpl_cm_i_card_products.php index 6e5e76640..349e96bc6 100644 --- a/includes/modules/content/index/templates/tpl_cm_i_card_products.php +++ b/includes/modules/content/index/templates/tpl_cm_i_card_products.php @@ -3,42 +3,38 @@
-
- -
-
- -
-
- display_price($card_products['products_price'], tep_get_tax_rate($card_products['products_tax_class_id'])), $currencies->display_price($card_products['specials_new_products_price'], tep_get_tax_rate($card_products['products_tax_class_id']))); - } - else { - echo sprintf(IS_PRODUCT_SHOW_PRICE, $currencies->display_price($card_products['products_price'], tep_get_tax_rate($card_products['products_tax_class_id']))); - } - ?> -
-
- @@ -46,17 +42,13 @@ diff --git a/includes/modules/content/index_nested/cm_in_card_products.php b/includes/modules/content/index_nested/cm_in_card_products.php index 788b077e7..b403e3ac5 100644 --- a/includes/modules/content/index_nested/cm_in_card_products.php +++ b/includes/modules/content/index_nested/cm_in_card_products.php @@ -22,7 +22,7 @@ public function execute() { global $current_category_id, $currencies, $PHP_SELF; $content_width = MODULE_CONTENT_IN_CARD_PRODUCTS_CONTENT_WIDTH; - $card_layout = IS_PRODUCT_PRODUCTS_LAYOUT; + $card_layout = IS_PRODUCT_PRODUCTS_DISPLAY_ROW; $card_products_query = tep_db_query(<<<'EOSQL' SELECT DISTINCT p.*, pd.*, diff --git a/includes/modules/content/index_nested/cm_in_category_listing.php b/includes/modules/content/index_nested/cm_in_category_listing.php index a9a9b85b8..0c136e642 100644 --- a/includes/modules/content/index_nested/cm_in_category_listing.php +++ b/includes/modules/content/index_nested/cm_in_category_listing.php @@ -22,7 +22,7 @@ public function execute() { global $current_category_id, $OSCOM_category; $content_width = MODULE_CONTENT_IN_CATEGORY_LISTING_CONTENT_WIDTH; - $category_card_layout = MODULE_CONTENT_IN_CATEGORY_LISTING_LAYOUT; + $category_card_layout = MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW; $category_name = $OSCOM_category->getData($current_category_id, 'name'); $category_level = $OSCOM_category->setMaximumLevel(1); @@ -46,38 +46,10 @@ protected function get_parameters() { 'desc' => 'What width container should the content be shown in?', 'set_func' => "tep_cfg_select_option(['12', '11', '10', '9', '8', '7', '6', '5', '4', '3', '2', '1'], ", ], - 'MODULE_CONTENT_IN_CATEGORY_LISTING_LAYOUT' => [ - 'title' => 'Category Card Layout', - 'value' => 'card-deck', - 'desc' => <<<'EOD' -What Layout suits your shop? See card/#card-layout
card-columns is a special use case that will not suit most shops as card-columns is very difficult to lay out and sort by...
-EOD - , - 'set_func' => "tep_cfg_select_option(['card-group', 'card-deck', 'card-columns'], ", - ], - 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW_SM' => [ - 'title' => 'Items In Each Row (SM)', - 'value' => '2', - 'desc' => 'How many products should display per Row in SM (Small) viewport?', - 'set_func' => "tep_cfg_select_option(['12', '11', '10', '9', '8', '7', '6', '5', '4', '3', '2', '1'], ", - ], - 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW_MD' => [ - 'title' => 'Items In Each Row (MD)', - 'value' => '3', - 'desc' => 'How many products should display per Row in MD (Medium) viewport?', - 'set_func' => "tep_cfg_select_option(['12', '11', '10', '9', '8', '7', '6', '5', '4', '3', '2', '1'], ", - ], - 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW_LG' => [ - 'title' => 'Items In Each Row (LG)', - 'value' => '4', - 'desc' => 'How many products should display per Row in LG (Large) viewport?', - 'set_func' => "tep_cfg_select_option(['12', '11', '10', '9', '8', '7', '6', '5', '4', '3', '2', '1'], ", - ], - 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW_XL' => [ - 'title' => 'Items In Each Row (XL)', - 'value' => '4', - 'desc' => 'How many products should display per Row in XL (Extra Large) viewport?', - 'set_func' => "tep_cfg_select_option(['12', '11', '10', '9', '8', '7', '6', '5', '4', '3', '2', '1'], ", + 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW' => [ + 'title' => 'Categories Per Row', + 'value' => 'row-cols-2 row-cols-sm-3 row-cols-md-4', + 'desc' => 'How many categories should display per Row per viewport? Default: XS 2, SM 3, MD and above 4', ], 'MODULE_CONTENT_IN_CATEGORY_LISTING_SORT_ORDER' => [ 'title' => 'Sort Order', diff --git a/includes/modules/content/index_nested/templates/tpl_cm_in_card_products.php b/includes/modules/content/index_nested/templates/tpl_cm_in_card_products.php index 081ea3433..06f7aec21 100644 --- a/includes/modules/content/index_nested/templates/tpl_cm_in_card_products.php +++ b/includes/modules/content/index_nested/templates/tpl_cm_in_card_products.php @@ -3,42 +3,38 @@
-
- -
-
- -
-
- display_price($card_products['products_price'], tep_get_tax_rate($card_products['products_tax_class_id'])), $currencies->display_price($card_products['specials_new_products_price'], tep_get_tax_rate($card_products['products_tax_class_id']))); - } - else { - echo sprintf(IS_PRODUCT_SHOW_PRICE, $currencies->display_price($card_products['products_price'], tep_get_tax_rate($card_products['products_tax_class_id']))); - } - ?> -
-
- @@ -46,17 +42,13 @@ diff --git a/includes/modules/content/index_nested/templates/tpl_cm_in_category_listing.php b/includes/modules/content/index_nested/templates/tpl_cm_in_category_listing.php index 3c2b5b4a6..0873be62c 100644 --- a/includes/modules/content/index_nested/templates/tpl_cm_in_category_listing.php +++ b/includes/modules/content/index_nested/templates/tpl_cm_in_category_listing.php @@ -1,21 +1,15 @@
$v) { - echo '
' . PHP_EOL; - echo '' . tep_image('images/' . $v['image'], htmlspecialchars($v['title'])) . ''; - echo ''; } ?>
@@ -23,17 +17,13 @@ diff --git a/includes/modules/content/product_info/cm_pi_also_purchased.php b/includes/modules/content/product_info/cm_pi_also_purchased.php index 91af74ada..4d59d9dca 100644 --- a/includes/modules/content/product_info/cm_pi_also_purchased.php +++ b/includes/modules/content/product_info/cm_pi_also_purchased.php @@ -22,7 +22,7 @@ function execute() { global $currencies, $PHP_SELF; $content_width = (int)MODULE_CONTENT_PRODUCT_INFO_ALSO_PURCHASED_CONTENT_WIDTH; - $card_layout = IS_PRODUCT_PRODUCTS_LAYOUT; + $card_layout = IS_PRODUCT_PRODUCTS_DISPLAY_ROW; $orders_query = tep_db_query(<<<'EOSQL' SELECT diff --git a/includes/modules/content/product_info/templates/tpl_cm_pi_also_purchased.php b/includes/modules/content/product_info/templates/tpl_cm_pi_also_purchased.php index 64822b5a0..1aca5bb3d 100644 --- a/includes/modules/content/product_info/templates/tpl_cm_pi_also_purchased.php +++ b/includes/modules/content/product_info/templates/tpl_cm_pi_also_purchased.php @@ -3,42 +3,38 @@
-
- -
-
- -
-
- display_price($orders['products_price'], tep_get_tax_rate($orders['products_tax_class_id'])), $currencies->display_price($orders['specials_new_products_price'], tep_get_tax_rate($orders['products_tax_class_id']))); - } - else { - echo sprintf(IS_PRODUCT_SHOW_PRICE, $currencies->display_price($orders['products_price'], tep_get_tax_rate($orders['products_tax_class_id']))); - } - ?> -
-
- @@ -46,17 +42,13 @@ diff --git a/install/phoenix.sql b/install/phoenix.sql index fbca45771..46855788f 100644 --- a/install/phoenix.sql +++ b/install/phoenix.sql @@ -742,12 +742,7 @@ INSERT INTO configuration (configuration_title, configuration_key, configuration INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Larger packages - percentage increase.', 'SHIPPING_BOX_PADDING', '10', 'For 10% enter 10', '7', '5', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Allow Orders Not Matching Defined Shipping Zones ', 'SHIPPING_ALLOW_UNDEFINED_ZONES', 'False', 'Should orders be allowed to shipping addresses not matching defined shipping module shipping zones?', '7', '5', 'tep_cfg_select_option([\'True\', \'False\'], ', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Product Card Layout', 'IS_PRODUCT_PRODUCTS_LAYOUT', 'card-deck', 'What Layout suits your shop? See card/#card-layout
card-columns is a special use case that will not suit most shops as card-columns is very difficult to layout and sort by...
', '8', '100', 'tep_cfg_select_option([\'card-group\', \'card-deck\', \'card-columns\'], ', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Products In Each Row (SM)', 'IS_PRODUCT_PRODUCTS_DISPLAY_ROW_SM', '2', 'How many products should display per Row in SM (Small) viewport?', '8', '110', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Products In Each Row (MD)', 'IS_PRODUCT_PRODUCTS_DISPLAY_ROW_MD', '3', 'How many products should display per Row in MD (Medium) viewport?', '8', '120', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Products In Each Row (LG)', 'IS_PRODUCT_PRODUCTS_DISPLAY_ROW_LG', '4', 'How many products should display per Row in LG (Large) viewport?', '8', '130', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Products In Each Row (XL)', 'IS_PRODUCT_PRODUCTS_DISPLAY_ROW_XL', '4', 'How many products should display per Row in XL (Large) viewport?', '8', '140', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); - +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Products Per Row', 'IS_PRODUCT_PRODUCTS_DISPLAY_ROW', 'row-cols-2 row-cols-sm-3 row-cols-md-4', 'How many products should display per Row per viewport? Default: XS 2, SM 3, MD and above 4', '8', '110', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Sort Option: Manufacturer Name (0=disable; 1=enable)','PRODUCT_LIST_MANUFACTURER', '0', 'Allow sorting by Manufacturer Name?', '8', '200', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Sort Option: Model (0=disable; 1=enable)', 'PRODUCT_LIST_MODEL', '0', 'Allow sorting by Product Model?', '8', '210', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Sort Option: Name (0=disable; 1=enable)', 'PRODUCT_LIST_NAME', '1', 'Allow sorting by Product Name?', '8', '220', now()); @@ -1563,11 +1558,7 @@ insert into configuration (configuration_title, configuration_key, configuration insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Category Listing Module', 'MODULE_CONTENT_IN_CATEGORY_LISTING_STATUS', 'True', 'Should this module be enabled?', '6', '1', 'tep_cfg_select_option([\'True\', \'False\'], ', now()); insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_IN_CATEGORY_LISTING_CONTENT_WIDTH', '12', 'What width container should the content be shown in?', '6', '2', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Category Card Layout', 'MODULE_CONTENT_IN_CATEGORY_LISTING_LAYOUT', 'card-deck', 'What Layout suits your shop? See card/#card-layout
card-columns is a special use case that will not suit most shops as card-columns is very difficult to layout and sort by...
', '6', '3', 'tep_cfg_select_option([\'card-group\', \'card-deck\', \'card-columns\'], ', now()); -insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Items In Each Row (SM)', 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW_SM', '2', 'How many products should display per Row in SM (Small) viewport?', '6', '4', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); -insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Items In Each Row (MD)', 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW_MD', '3', 'How many products should display per Row in MD (Medium) viewport?', '6', '5', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); -insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Items In Each Row (LG)', 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW_LG', '4', 'How many products should display per Row in LG (Large) viewport?', '6', '6', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); -insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Items In Each Row (XL)', 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW_XL', '6', 'How many products should display per Row in XL (Extra Large) viewport?', '4', '7', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); +insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Categories Per Row', 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW', 'row-cols-2 row-cols-sm-3 row-cols-md-4', 'How many categories should display per Row per viewport? Default: XS 2, SM 3, MD and above 4', '6', '4', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_IN_CATEGORY_LISTING_SORT_ORDER', '200', 'Sort order of display. Lowest is displayed first.', '6', '8', now()); insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable New Products Module', 'MODULE_CONTENT_IN_CARD_PRODUCTS_STATUS', 'True', 'Do you want to enable this module?', '6', '1', 'tep_cfg_select_option([\'True\', \'False\'], ', now()); diff --git a/templates/default/includes/components/product_listing.php b/templates/default/includes/components/product_listing.php index 663566eb5..8b8248466 100644 --- a/templates/default/includes/components/product_listing.php +++ b/templates/default/includes/components/product_listing.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2018 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ @@ -94,58 +94,53 @@ $prod_list_contents = NULL; - $item = 1; while ($listing = tep_db_fetch_array($listing_query)) { - $prod_list_contents .= '
' . PHP_EOL; - if (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id'])) { - $prod_list_contents .= '' . tep_image('images/' . $listing['products_image'], htmlspecialchars($listing['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, '', true, 'card-img-top') . '' . PHP_EOL; - } else { - $prod_list_contents .= '' . tep_image('images/' . $listing['products_image'], htmlspecialchars($listing['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, '', true, 'card-img-top') . '' . PHP_EOL; - } - - $prod_list_contents .= '
' . PHP_EOL; - $prod_list_contents .= '
'; - if (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id'])) { - $prod_list_contents .= '' . $listing['products_name'] . ''; + $prod_list_contents .= '
'; + $prod_list_contents .= '
' . PHP_EOL; - $prod_list_contents .= '
'; - if ($listing['is_special'] == 1) { - $prod_list_contents .= sprintf(IS_PRODUCT_SHOW_PRICE_SPECIAL, $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])), $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id']))); + + $prod_list_contents .= '
' . PHP_EOL; + $prod_list_contents .= '
'; + if (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id'])) { + $prod_list_contents .= '' . $listing['products_name'] . ''; + } else { + $prod_list_contents .= '' . $listing['products_name'] . ''; } - else { - $prod_list_contents .= sprintf(IS_PRODUCT_SHOW_PRICE, $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id']))); + $prod_list_contents .= '
' . PHP_EOL; + $prod_list_contents .= '
'; + if ($listing['is_special'] == 1) { + $prod_list_contents .= sprintf(IS_PRODUCT_SHOW_PRICE_SPECIAL, $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])), $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id']))); + } + else { + $prod_list_contents .= sprintf(IS_PRODUCT_SHOW_PRICE, $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id']))); + } + $prod_list_contents .= '
' . PHP_EOL; + if (tep_not_null($listing['products_seo_description'])) { + $prod_list_contents .= '
'; + $prod_list_contents .= $listing['products_seo_description']; + $prod_list_contents .= '
' . PHP_EOL; } - $prod_list_contents .= '
' . PHP_EOL; - if (tep_not_null($listing['products_seo_description'])) { - $prod_list_contents .= '
'; - $prod_list_contents .= $listing['products_seo_description']; - $prod_list_contents .= '
' . PHP_EOL; - } - $prod_list_contents .= '
' . PHP_EOL; + $prod_list_contents .= '
' . PHP_EOL; - $prod_list_contents .= '' . PHP_EOL; $prod_list_contents .= '
' . PHP_EOL; - - if ( $item%IS_PRODUCT_PRODUCTS_DISPLAY_ROW_SM == 0 ) $prod_list_contents .= '
' . PHP_EOL; - if ( $item%IS_PRODUCT_PRODUCTS_DISPLAY_ROW_MD == 0 ) $prod_list_contents .= '
' . PHP_EOL; - if ( $item%IS_PRODUCT_PRODUCTS_DISPLAY_ROW_LG == 0 ) $prod_list_contents .= '
' . PHP_EOL; - if ( $item%IS_PRODUCT_PRODUCTS_DISPLAY_ROW_XL == 0 ) $prod_list_contents .= '
' . PHP_EOL; - $item++; } echo $GLOBALS['OSCOM_Hooks']->call('filter', 'drawForm'); - echo '
' . PHP_EOL; + echo '
' . PHP_EOL; echo $prod_list_contents; echo '
' . PHP_EOL; diff --git a/templates/default/includes/hooks/shop/index/catCSS.php b/templates/default/includes/hooks/shop/index/catCSS.php deleted file mode 100644 index 20aa644e9..000000000 --- a/templates/default/includes/hooks/shop/index/catCSS.php +++ /dev/null @@ -1,35 +0,0 @@ -@media (min-width: 576px) {.cm-in-category-listing > .card-group > .card {max-width: {$sm}%;}.cm-in-category-listing > .card-deck > .card {max-width: calc({$sm}% - 30px);}.cm-in-category-listing > .card-columns {column-count: {$sm_count};}} @media (min-width: 768px) {.cm-in-category-listing > .card-group > .card {max-width: {$md}%;}.cm-in-category-listing > .card-deck > .card {max-width: calc({$md}% - 30px);}.cm-in-category-listing > .card-columns {column-count: {$md_count};}} @media (min-width: 992px) {.cm-in-category-listing > .card-group > .card {max-width: {$lg}%;}.cm-in-category-listing > .card-deck > .card {max-width: calc({$lg}% - 30px);}.cm-in-category-listing > .card-columns {column-count: {$lg_count};}} @media (min-width: 1200px) {.cm-in-category-listing > .card-group > .card {max-width: {$xl}%;}.cm-in-category-listing > .card-deck > .card {max-width: calc({$xl}% - 30px);}.cm-in-category-listing > .card-columns {column-count: {$xl_count};}} -eod; - - return $catCSS; - } - } - -} diff --git a/templates/default/includes/hooks/shop/siteWide/cardCSS.php b/templates/default/includes/hooks/shop/siteWide/cardCSS.php deleted file mode 100644 index 6e249ee47..000000000 --- a/templates/default/includes/hooks/shop/siteWide/cardCSS.php +++ /dev/null @@ -1,41 +0,0 @@ -@media (min-width: 576px) {.card-group > .card.is-product {max-width: {$sm}%;}.card-deck > .card.is-product {max-width: calc({$sm}% - 30px);}.card-columns {column-count: {$sm_count};}} @media (min-width: 768px) {.card-group > .card.is-product {max-width: {$md}%;}.card-deck > .card.is-product {max-width: calc({$md}% - 30px);}.card-columns {column-count: {$md_count};}} @media (min-width: 992px) {.card-group > .card.is-product {max-width: {$lg}%;}.card-deck > .card.is-product {max-width: calc({$lg}% - 30px);}.card-columns {column-count: {$lg_count};}} @media (min-width: 1200px) {.card-group > .card.is-product {max-width: {$xl}%;}.card-deck > .card.is-product {max-width: calc({$xl}% - 30px);}.card-columns {column-count: {$xl_count};}} -eod; - - $this->SiteStart .= $cardCSS . PHP_EOL; - - return $this->SiteStart; - } - -} From 044c6719e11fad3f2a5b85c5be8b05911125a0cf Mon Sep 17 00:00:00 2001 From: gburton Date: Wed, 1 Jul 2020 14:19:43 +0100 Subject: [PATCH 12/16] Add Row --- install/phoenix.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/phoenix.sql b/install/phoenix.sql index 46855788f..70ddf8088 100644 --- a/install/phoenix.sql +++ b/install/phoenix.sql @@ -742,7 +742,7 @@ INSERT INTO configuration (configuration_title, configuration_key, configuration INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Larger packages - percentage increase.', 'SHIPPING_BOX_PADDING', '10', 'For 10% enter 10', '7', '5', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Allow Orders Not Matching Defined Shipping Zones ', 'SHIPPING_ALLOW_UNDEFINED_ZONES', 'False', 'Should orders be allowed to shipping addresses not matching defined shipping module shipping zones?', '7', '5', 'tep_cfg_select_option([\'True\', \'False\'], ', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Products Per Row', 'IS_PRODUCT_PRODUCTS_DISPLAY_ROW', 'row-cols-2 row-cols-sm-3 row-cols-md-4', 'How many products should display per Row per viewport? Default: XS 2, SM 3, MD and above 4', '8', '110', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Products Per Row', 'IS_PRODUCT_PRODUCTS_DISPLAY_ROW', 'row row-cols-2 row-cols-sm-3 row-cols-md-4', 'How many products should display per Row per viewport? Default: XS 2, SM 3, MD and above 4', '8', '110', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Sort Option: Manufacturer Name (0=disable; 1=enable)','PRODUCT_LIST_MANUFACTURER', '0', 'Allow sorting by Manufacturer Name?', '8', '200', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Sort Option: Model (0=disable; 1=enable)', 'PRODUCT_LIST_MODEL', '0', 'Allow sorting by Product Model?', '8', '210', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Sort Option: Name (0=disable; 1=enable)', 'PRODUCT_LIST_NAME', '1', 'Allow sorting by Product Name?', '8', '220', now()); @@ -1558,7 +1558,7 @@ insert into configuration (configuration_title, configuration_key, configuration insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Category Listing Module', 'MODULE_CONTENT_IN_CATEGORY_LISTING_STATUS', 'True', 'Should this module be enabled?', '6', '1', 'tep_cfg_select_option([\'True\', \'False\'], ', now()); insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_IN_CATEGORY_LISTING_CONTENT_WIDTH', '12', 'What width container should the content be shown in?', '6', '2', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); -insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Categories Per Row', 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW', 'row-cols-2 row-cols-sm-3 row-cols-md-4', 'How many categories should display per Row per viewport? Default: XS 2, SM 3, MD and above 4', '6', '4', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); +insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Categories Per Row', 'MODULE_CONTENT_IN_CATEGORY_LISTING_DISPLAY_ROW', 'row row-cols-2 row-cols-sm-3 row-cols-md-4', 'How many categories should display per Row per viewport? Default: XS 2, SM 3, MD and above 4', '6', '4', now()); insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_IN_CATEGORY_LISTING_SORT_ORDER', '200', 'Sort order of display. Lowest is displayed first.', '6', '8', now()); insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable New Products Module', 'MODULE_CONTENT_IN_CARD_PRODUCTS_STATUS', 'True', 'Do you want to enable this module?', '6', '1', 'tep_cfg_select_option([\'True\', \'False\'], ', now()); From ab60045e51b1291d34d9f401316194f94c8f070d Mon Sep 17 00:00:00 2001 From: gburton Date: Fri, 3 Jul 2020 11:13:31 +0100 Subject: [PATCH 13/16] Equal Height Cards --- .../modules/content/index/templates/tpl_cm_i_card_products.php | 2 +- .../content/index_nested/templates/tpl_cm_in_card_products.php | 2 +- .../content/product_info/templates/tpl_cm_pi_also_purchased.php | 2 +- templates/default/includes/components/product_listing.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/modules/content/index/templates/tpl_cm_i_card_products.php b/includes/modules/content/index/templates/tpl_cm_i_card_products.php index 349e96bc6..7440dff84 100644 --- a/includes/modules/content/index/templates/tpl_cm_i_card_products.php +++ b/includes/modules/content/index/templates/tpl_cm_i_card_products.php @@ -6,7 +6,7 @@ while ($card_products = tep_db_fetch_array($card_products_query)) { ?>
-
+
diff --git a/includes/modules/content/index_nested/templates/tpl_cm_in_card_products.php b/includes/modules/content/index_nested/templates/tpl_cm_in_card_products.php index 06f7aec21..40ad492e2 100644 --- a/includes/modules/content/index_nested/templates/tpl_cm_in_card_products.php +++ b/includes/modules/content/index_nested/templates/tpl_cm_in_card_products.php @@ -6,7 +6,7 @@ while ($card_products = tep_db_fetch_array($card_products_query)) { ?>
-
+
diff --git a/includes/modules/content/product_info/templates/tpl_cm_pi_also_purchased.php b/includes/modules/content/product_info/templates/tpl_cm_pi_also_purchased.php index 1aca5bb3d..292b40628 100644 --- a/includes/modules/content/product_info/templates/tpl_cm_pi_also_purchased.php +++ b/includes/modules/content/product_info/templates/tpl_cm_pi_also_purchased.php @@ -6,7 +6,7 @@ while ($orders = tep_db_fetch_array($orders_query)) { ?>
-
+
diff --git a/templates/default/includes/components/product_listing.php b/templates/default/includes/components/product_listing.php index 8b8248466..f7e10fc6b 100644 --- a/templates/default/includes/components/product_listing.php +++ b/templates/default/includes/components/product_listing.php @@ -96,7 +96,7 @@ while ($listing = tep_db_fetch_array($listing_query)) { $prod_list_contents .= '
'; - $prod_list_contents .= '
' . PHP_EOL; + $prod_list_contents .= '
' . PHP_EOL; if (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id'])) { $prod_list_contents .= '' . tep_image('images/' . $listing['products_image'], htmlspecialchars($listing['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, '', true, 'card-img-top') . '' . PHP_EOL; } else { From 0c2b16da6e791eb1ed28326ebb1398a19d841d7c Mon Sep 17 00:00:00 2001 From: Matt Fletcher Date: Fri, 3 Jul 2020 22:12:34 +0000 Subject: [PATCH 14/16] Allow turning off customer data modules on this page --- templates/default/includes/pages/create_account.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/templates/default/includes/pages/create_account.php b/templates/default/includes/pages/create_account.php index 8030b2aa8..d8ab11de1 100644 --- a/templates/default/includes/pages/create_account.php +++ b/templates/default/includes/pages/create_account.php @@ -33,7 +33,12 @@ 0; + }); + + if ([] === $modules) { continue; } ?> @@ -41,7 +46,7 @@

display_input($customer_details); } } From a2e713787645e6690079a00813989dd220ec0891 Mon Sep 17 00:00:00 2001 From: gburton Date: Sat, 4 Jul 2020 17:04:28 +0100 Subject: [PATCH 15/16] Full height -> Margin Bottom Full height on a gridded card breaks the margin bottom on the card; set mb on the containing col to compensate. --- .../content/index/templates/tpl_cm_i_card_products.php | 4 ++-- .../index_nested/templates/tpl_cm_in_card_products.php | 4 ++-- .../product_info/templates/tpl_cm_pi_also_purchased.php | 4 ++-- templates/default/includes/components/product_listing.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/includes/modules/content/index/templates/tpl_cm_i_card_products.php b/includes/modules/content/index/templates/tpl_cm_i_card_products.php index 7440dff84..af9c44b0d 100644 --- a/includes/modules/content/index/templates/tpl_cm_i_card_products.php +++ b/includes/modules/content/index/templates/tpl_cm_i_card_products.php @@ -5,8 +5,8 @@ -
-
+
+
diff --git a/includes/modules/content/index_nested/templates/tpl_cm_in_card_products.php b/includes/modules/content/index_nested/templates/tpl_cm_in_card_products.php index 40ad492e2..14d3bea9d 100644 --- a/includes/modules/content/index_nested/templates/tpl_cm_in_card_products.php +++ b/includes/modules/content/index_nested/templates/tpl_cm_in_card_products.php @@ -5,8 +5,8 @@ -
-
+
+
diff --git a/includes/modules/content/product_info/templates/tpl_cm_pi_also_purchased.php b/includes/modules/content/product_info/templates/tpl_cm_pi_also_purchased.php index 292b40628..ce6aa01e7 100644 --- a/includes/modules/content/product_info/templates/tpl_cm_pi_also_purchased.php +++ b/includes/modules/content/product_info/templates/tpl_cm_pi_also_purchased.php @@ -5,8 +5,8 @@ -
-
+
+
diff --git a/templates/default/includes/components/product_listing.php b/templates/default/includes/components/product_listing.php index f7e10fc6b..2a41460b8 100644 --- a/templates/default/includes/components/product_listing.php +++ b/templates/default/includes/components/product_listing.php @@ -95,8 +95,8 @@ $prod_list_contents = NULL; while ($listing = tep_db_fetch_array($listing_query)) { - $prod_list_contents .= '
'; - $prod_list_contents .= '
' . PHP_EOL; + $prod_list_contents .= '
'; + $prod_list_contents .= '
' . PHP_EOL; if (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id'])) { $prod_list_contents .= '' . tep_image('images/' . $listing['products_image'], htmlspecialchars($listing['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, '', true, 'card-img-top') . '' . PHP_EOL; } else { From bbf8576c5222c1f0d697c9014eeae14338828635 Mon Sep 17 00:00:00 2001 From: gburton Date: Sat, 4 Jul 2020 17:07:57 +0100 Subject: [PATCH 16/16] 1.0.7.5 --- includes/version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/version.php b/includes/version.php index 37577951d..6e0714f9c 100644 --- a/includes/version.php +++ b/includes/version.php @@ -1 +1 @@ -1.0.7.4 +1.0.7.5