diff --git a/NEUE DATEIEN/DEINADMIN/includes/languages/english/edit_orders.php b/NEUE DATEIEN/DEINADMIN/includes/languages/english/edit_orders.php index a8e86d9..bb30d7f 100644 --- a/NEUE DATEIEN/DEINADMIN/includes/languages/english/edit_orders.php +++ b/NEUE DATEIEN/DEINADMIN/includes/languages/english/edit_orders.php @@ -96,7 +96,7 @@ // Order Totals Display define('TEXT_ADD_ORDER_TOTAL', 'Add '); define('TEXT_CHOOSE_SHIPPING_MODULE', 'Choose a shipping module: '); -if (!defined('TEXT_COMMAND_TO_DELETE_CURRENT_COUPON_FROM_ORDER')) define('TEXT_COMMAND_TO_DELETE_CURRENT_COUPON_FROM_ORDER', 'REMOVE'); +define('TEXT_COMMAND_TO_DELETE_CURRENT_COUPON_FROM_ORDER', 'REMOVE'); // Add a Product define('TEXT_ADD_NEW_PRODUCT', 'Add Product'); diff --git a/NEUE DATEIEN/DEINADMIN/includes/languages/german/edit_orders.php b/NEUE DATEIEN/DEINADMIN/includes/languages/german/edit_orders.php index b35b5d5..b0ae06d 100644 --- a/NEUE DATEIEN/DEINADMIN/includes/languages/german/edit_orders.php +++ b/NEUE DATEIEN/DEINADMIN/includes/languages/german/edit_orders.php @@ -86,7 +86,7 @@ // Order Totals Display define('TEXT_ADD_ORDER_TOTAL', 'Hinzufügen '); define('TEXT_CHOOSE_SHIPPING_MODULE', 'Wählen Sie eine Versandart: '); -if (!defined('TEXT_COMMAND_TO_DELETE_CURRENT_COUPON_FROM_ORDER')) define('TEXT_COMMAND_TO_DELETE_CURRENT_COUPON_FROM_ORDER', 'REMOVE'); +define('TEXT_COMMAND_TO_DELETE_CURRENT_COUPON_FROM_ORDER', 'REMOVE'); // Add a Product define('TEXT_ADD_NEW_PRODUCT', 'Artikel hinzufügen'); define('ADDPRODUCT_TEXT_CATEGORY_CONFIRM', 'OK'); diff --git a/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_add_prdct_action_display.php b/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_add_prdct_action_display.php index 38adac0..d1e66d3 100644 --- a/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_add_prdct_action_display.php +++ b/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_add_prdct_action_display.php @@ -2,18 +2,18 @@ /** * @package Edit Orders for Zen Cart German * Edit Orders plugin by Cindy Merkin a.k.a. lat9 (cindy@vinosdefrutastropicales.com) - * Copyright (c) 2017-2022 Vinos de Frutas Tropicales + * Copyright (c) 2017-2024 Vinos de Frutas Tropicales * @copyright Copyright 2003-2022 Zen Cart Development Team * Zen Cart German Version - www.zen-cart-pro.at * @copyright Portions Copyright 2003 osCommerce * @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0 - * @version $Id: eo_add_prdct_action_display.php 2022-06-10 08:21:16Z webchills $ + * @version $Id: eo_add_prdct_action_display.php 2024-03-20 07:49:16Z webchills $ */ // ----- // Prior to EO v4.6.0, this code was in-line in the main /admin/edit_orders.php script. Now required by // that script in global context for the rendering for its 'edit' action. // - $order_parms = zen_get_all_get_params(['oID', 'action', 'resend']) . "oID=$oID&action=edit"; +$order_parms = zen_get_all_get_params(['oID', 'action', 'resend']) . "oID=$oID&action=edit"; ?> @@ -30,75 +30,75 @@ 0.5, 'text' => ADDPRODUCT_CHOOSE_CATEGORY]); +// Step 1: Choose Category +if ($add_product_categories_id == .5) { + // Handle initial population of categories + $categoriesarr = zen_get_category_tree(); + array_unshift($categoriesarr, ['id' => 0.5, 'text' => ADDPRODUCT_CHOOSE_CATEGORY]); - $categoryselectoutput = zen_draw_pull_down_menu('add_product_categories_id', $categoriesarr, 0.5, 'onchange="this.form.submit();"'); - } else { - // Add the category selection. Selecting a category will override the search - $categoryselectoutput = zen_draw_pull_down_menu('add_product_categories_id', zen_get_category_tree(), $current_category_id, 'onchange="this.form.submit();"'); - } + $categoryselectoutput = zen_draw_pull_down_menu('add_product_categories_id', $categoriesarr, 0.5, 'onchange="this.form.submit();"'); +} else { + // Add the category selection. Selecting a category will override the search + $categoryselectoutput = zen_draw_pull_down_menu('add_product_categories_id', zen_get_category_tree(), $current_category_id, 'onchange="this.form.submit();"'); +} ?> - + 1 && ($add_product_categories_id != .5 || zen_not_null($_POST['search']))) { - $query = - "SELECT p.products_id, p.products_model, pd.products_name, p.products_status - FROM " . TABLE_PRODUCTS . " p - INNER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd - ON pd.products_id = p.products_id - AND pd.language_id = " . (int)$_SESSION['languages_id']; +// Step 2: Choose Product +if ($step > 1 && ($add_product_categories_id != .5 || !empty($_POST['search']))) { + $query = + "SELECT p.products_id, p.products_model, pd.products_name, p.products_status + FROM " . TABLE_PRODUCTS . " p + INNER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd + ON pd.products_id = p.products_id + AND pd.language_id = " . (int)$_SESSION['languages_id']; - if ($add_product_categories_id >= 1) { - $query .= - " LEFT JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc - ON ptc.products_id = p.products_id - WHERE ptc.categories_id=" . (int)$add_product_categories_id . " - ORDER BY p.products_id"; - } elseif (zen_not_null($_POST['search'])) { - // Handle case where a product search was entered - $keywords = zen_db_input(zen_db_prepare_input($_POST['search'])); + if ($add_product_categories_id >= 1) { + $query .= + " LEFT JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc + ON ptc.products_id = p.products_id + WHERE ptc.categories_id=" . (int)$add_product_categories_id; + } elseif (!empty($_POST['search'])) { + $keyword_search_fields = [ + 'pd.products_name', + 'pd.products_description', + 'p.products_id', + 'p.products_model', + ]; + $query .= zen_build_keyword_where_clause($keyword_search_fields, trim($_POST['search'])); + } - $query .= - " WHERE (pd.products_name LIKE '%$keywords%' - OR pd.products_description LIKE '%$keywords%' - OR p.products_id = " . (int)$keywords . " - OR p.products_model LIKE '%$keywords%') - ORDER BY p.products_id"; - } + $query .= zen_products_sort_order(); ?> 2 && $add_product_products_id > 0) { - // Skip to Step 4 if no Options - if (!zen_has_product_attributes($add_product_products_id)) { - $step = 4; +// Step 3: Choose Options +if ($step > 2 && $add_product_products_id > 0) { + // Skip to Step 4 if no Options + if (!zen_has_product_attributes($add_product_products_id, false)) { + $step = 4; ?> 3) { +// Step 4: Confirm +if ($step > 3) { ?>
-
 
@@ -107,49 +107,49 @@
@@ -157,148 +157,152 @@
$optionInfo) { - $option_name = $optionInfo['name']; - $attrib_id = "attrib-$optionID"; - switch ($optionInfo['type']) { - case PRODUCTS_OPTIONS_TYPE_ATTRIBUTE_GRID: - case PRODUCTS_OPTIONS_TYPE_RADIO: - case PRODUCTS_OPTIONS_TYPE_SELECT: - case PRODUCTS_OPTIONS_TYPE_SELECT_SBA: + foreach ($attrs as $optionID => $optionInfo) { + $option_name = $optionInfo['name']; + $attrib_id = "attrib-$optionID"; + switch ($optionInfo['type']) { + case PRODUCTS_OPTIONS_TYPE_ATTRIBUTE_GRID: + case PRODUCTS_OPTIONS_TYPE_RADIO: + case PRODUCTS_OPTIONS_TYPE_SELECT: + case PRODUCTS_OPTIONS_TYPE_SELECT_SBA: ?> $attributeValue) { - $products_options_array[] = [ - 'id' => $attributeId, - 'text' => $attributeValue - ]; - } - $selected_attribute = $products_options_array[0]['id']; - if (isset($_POST['id'][$optionID])) { - $selected_attribute = $_POST['id'][$optionID]['value']; - } - echo zen_draw_pull_down_menu('id[' . $optionID . '][value]', $products_options_array, $selected_attribute, 'id="' . $attrib_id . '"') . '
' . PHP_EOL; - unset($products_options_array, $selected_attribute, $attributeId, $attributeValue); - echo zen_draw_hidden_field('id[' . $optionID . '][type]', $optionInfo['type']); - break; - - case PRODUCTS_OPTIONS_TYPE_CHECKBOX: + $products_options_array = []; + foreach ($optionInfo['options'] as $attributeId => $attributeValue) { + $products_options_array[] = [ + 'id' => $attributeId, + 'text' => $attributeValue + ]; + } + $selected_attribute = $products_options_array[0]['id']; + if (isset($_POST['id'][$optionID])) { + $selected_attribute = $_POST['id'][$optionID]['value']; + } + echo zen_draw_pull_down_menu('id[' . $optionID . '][value]', $products_options_array, $selected_attribute, 'id="' . $attrib_id . '"') . '
' . PHP_EOL; + unset($products_options_array, $selected_attribute, $attributeId, $attributeValue); + echo zen_draw_hidden_field('id[' . $optionID . '][type]', $optionInfo['type']); + break; + + case PRODUCTS_OPTIONS_TYPE_CHECKBOX: ?>
$attributeValue) { - $checked = isset($_POST['id'][$optionID]['value'][$attributeId]); - echo zen_draw_checkbox_field('id[' . $optionID . '][value][' . $attributeId . ']', $attributeId, $checked, null, 'id="' . $attrib_id . '-' . $attributeId . '"') . '
' . PHP_EOL; - } - unset($checked, $attributeId, $attributeValue); - echo zen_draw_hidden_field('id[' . $optionID . '][type]', $optionInfo['type']); + foreach ($optionInfo['options'] as $attributeId => $attributeValue) { + $checked = isset($_POST['id'][$optionID]['value'][$attributeId]); + echo + zen_draw_checkbox_field('id[' . $optionID . '][value][' . $attributeId . ']', $attributeId, $checked, null, 'id="' . $attrib_id . '-' . $attributeId . '"') . + '
' . PHP_EOL; + } + unset($checked, $attributeId, $attributeValue); + echo zen_draw_hidden_field('id[' . $optionID . '][type]', $optionInfo['type']); ?>
1 ) { - echo zen_draw_textarea_field($field_name, 'hard', $field_size, $optionInfo['rows'], $text, 'class="attribsTextarea" id="' . $attrib_id . '"') . '
' . PHP_EOL; - } else { - echo zen_draw_input_field($field_name, $text, 'size="' . $field_size . '" maxlength="' . $field_length . '" id="' . $attrib_id . '"') . '
' . PHP_EOL; - } - echo zen_draw_hidden_field('id[' . $optionID . '][type]', $optionInfo['type']); - break; - - case PRODUCTS_OPTIONS_TYPE_FILE: + $field_name = 'id[' . $optionID . '][value]'; + $field_size = $optionInfo['size']; + $field_length = $optionInfo['length']; + if ($optionInfo['rows'] > 1 ) { + echo zen_draw_textarea_field($field_name, 'hard', $field_size, $optionInfo['rows'], $text, 'class="attribsTextarea" id="' . $attrib_id . '"') . '
' . PHP_EOL; + } else { + echo zen_draw_input_field($field_name, $text, 'size="' . $field_size . '" maxlength="' . $field_length . '" id="' . $attrib_id . '"') . '
' . PHP_EOL; + } + echo zen_draw_hidden_field('id[' . $optionID . '][type]', $optionInfo['type']); + break; + + case PRODUCTS_OPTIONS_TYPE_FILE: ?>

 
-
- + $value) { - if (is_array($value)) { - foreach ($value as $id2 => $value2) { - if (is_array($value2)) { - foreach ($value2 as $id3 => $value3) { - echo zen_draw_hidden_field('id[' . $id . '][' . $id2 . '][' . $id3 . ']', zen_output_string_protected($value3)); - } - } else { - echo zen_draw_hidden_field('id[' . $id . '][' . $id2 . ']', zen_output_string_protected($value2)); + if (isset($_POST['id'])) { + foreach ($_POST['id'] as $id => $value) { + if (is_array($value)) { + foreach ($value as $id2 => $value2) { + if (is_array($value2)) { + foreach ($value2 as $id3 => $value3) { + echo zen_draw_hidden_field('id[' . $id . '][' . $id2 . '][' . $id3 . ']', zen_output_string_protected($value3)); } + } else { + echo zen_draw_hidden_field('id[' . $id . '][' . $id2 . ']', zen_output_string_protected($value2)); } - } else { - echo zen_draw_hidden_field('id[' . $id . ']', zen_output_string_protected($value)); } + } else { + echo zen_draw_hidden_field('id[' . $id . ']', zen_output_string_protected($value)); } } - echo zen_draw_hidden_field('add_product_categories_id', $add_product_categories_id) . - zen_draw_hidden_field('add_product_products_id', $add_product_products_id) . - zen_draw_hidden_field('step', '5'); + } + echo zen_draw_hidden_field('add_product_categories_id', $add_product_categories_id) . + zen_draw_hidden_field('add_product_products_id', $add_product_products_id) . + zen_draw_hidden_field('step', '5'); ?>
diff --git a/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_add_prdct_action_processing.php b/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_add_prdct_action_processing.php index c198f42..9ecc5da 100644 --- a/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_add_prdct_action_processing.php +++ b/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_add_prdct_action_processing.php @@ -2,19 +2,19 @@ /** * @package Edit Orders for Zen Cart German * Edit Orders plugin by Cindy Merkin a.k.a. lat9 (cindy@vinosdefrutastropicales.com) - * Copyright (c) 2017-2022 Vinos de Frutas Tropicales + * Copyright (c) 2017-2024 Vinos de Frutas Tropicales * @copyright Copyright 2003-2022 Zen Cart Development Team * Zen Cart German Version - www.zen-cart-pro.at * @copyright Portions Copyright 2003 osCommerce * @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0 - * @version $Id: eo_add_prdct_action_processing.php 2022-06-10 08:21:16Z webchills $ + * @version $Id: eo_add_prdct_action_processing.php 2024-03-20 07:21:16Z webchills $ */ // ----- // Prior to EO v4.6.0, this code was in-line in the main /admin/edit_orders.php script. Now required by // that script in global context for its 'add_prdct' action. // $redirect_required = false; -if (!zen_not_null($step)) { +if (empty($step)) { $step = 1; } $eo->eoLog( @@ -42,7 +42,7 @@ } // Retrieve the information for the new product - $attributes = (isset($_POST['id'])) ? zen_db_prepare_input($_POST['id']) : []; + $attributes = zen_db_prepare_input($_POST['id'] ?? []); $new_product = eo_get_new_product( $add_product_products_id, $add_product_quantity, @@ -66,7 +66,7 @@ // Remove the low order and/or cod fees (will automatically repopulate if needed) foreach ($order->totals as $key => $total) { - if ($total['class'] == 'ot_loworderfee' || $total['class'] == 'ot_cod_fee') { + if ($total['class'] === 'ot_loworderfee' || $total['class'] === 'ot_cod_fee') { // Update the information in the order $total['title'] = ''; $total['value'] = 0; diff --git a/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_common_address_format.php b/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_common_address_format.php index 7b8cc23..0dbc2f8 100644 --- a/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_common_address_format.php +++ b/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_common_address_format.php @@ -2,19 +2,19 @@ /** * @package Edit Orders for Zen Cart German * Edit Orders plugin by Cindy Merkin a.k.a. lat9 (cindy@vinosdefrutastropicales.com) - * Copyright (c) 2017-2022 Vinos de Frutas Tropicales + * Copyright (c) 2017-2024 Vinos de Frutas Tropicales * @copyright Copyright 2003-2022 Zen Cart Development Team * Zen Cart German Version - www.zen-cart-pro.at * @copyright Portions Copyright 2003 osCommerce * @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0 - * @version $Id: eo_common_address_format.php 2022-06-10 08:21:16Z webchills $ + * @version $Id: eo_common_address_format.php 2024-03-20 08:21:16Z webchills $ */ // // This module is loaded in global scope by /admin/includes/modules/edit_orders/eo_edit_action_display.php. // // The following variables are set for the module's use: // -// $address_icon ..... The name of the icon associated with the address' information. +// $address_icon ..... The name of the FA icon associated with the address' information. // $address_label .... The label, e.g. "Customer" to associate with the address information. // $address_name ..... The specific address, e.g. 'customer' or 'billing', that is being displayed. This is // used to create unique form-field names for the three variants of addresses. @@ -23,85 +23,92 @@ // $address_notifier . The notification to be raised at the end of EO's standard address elements. // ?> -
+
+arrayImplode($address_fields)); +?> - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - 'label_name', //-No trailing ':', that will be added by EO. - // 'value' => $value //-This is the form-field to be added - // ), - // ); - // - $additional_rows = []; - $zco_notifier->notify($address_notifier, $address_fields, $additional_rows); - if (!empty($additional_rows)) { - foreach ($additional_rows as $next_row) { - ?> + 'label_name', //-No trailing ':', that will be added by EO. +// 'value' => $value //-This is the form-field to be added +// ), +// ); +// +$additional_rows = []; +$zco_notifier->notify($address_notifier, $address_fields, $additional_rows); +if (!empty($additional_rows)) { + foreach ($additional_rows as $next_row) { +?> - - + + - +} +?>
id="update__name"> id="update__name">
id="update__company"> id="update__company">
id="update__address"> id="update__address">
id="update__suburb"> id="update__suburb">
id="update__city"> id="update__city">
id="update__state"> id="update__state">
id="update__postcode"> id="update__postcode">
- '; - } - ?> +'; +} +?>
diff --git a/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_edit_action_addresses_display.php b/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_edit_action_addresses_display.php index 56f5c83..4027be4 100644 --- a/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_edit_action_addresses_display.php +++ b/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_edit_action_addresses_display.php @@ -2,12 +2,12 @@ /** * @package Edit Orders for Zen Cart German * Edit Orders plugin by Cindy Merkin a.k.a. lat9 (cindy@vinosdefrutastropicales.com) - * Copyright (c) 2017-2022 Vinos de Frutas Tropicales - * @copyright Copyright 2003-2022 Zen Cart Development Team + * Copyright (c) 2017-2024 Vinos de Frutas Tropicales + * @copyright Copyright 2003-2024 Zen Cart Development Team * Zen Cart German Version - www.zen-cart-pro.at * @copyright Portions Copyright 2003 osCommerce * @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0 - * @version $Id: eo_edit_action_addresses_display.php 2022-06-10 08:21:16Z webchills $ + * @version $Id: eo_edit_action_addresses_display.php 2024-03-20 08:21:16Z webchills $ */ // // This module is loaded in global scope by /admin/edit_orders.php. @@ -27,12 +27,12 @@ $max_country_length = 'maxlength="' . zen_field_length(TABLE_ORDERS, 'customers_country') . '"'; ?>
-
+
customer; @@ -41,19 +41,19 @@ ?>
-
+
billing; $address_notifier = 'EDIT_ORDERS_ADDL_BILLING_ADDRESS_ROWS'; } else { - $address_icon = 'icon_shipping.png'; + $address_icon = 'fa-solid fa fa-truck'; $address_label = ENTRY_SHIPPING_ADDRESS; $address_name = 'delivery'; $address_fields = $order->delivery; @@ -63,19 +63,19 @@ ?>
-
+
delivery; $address_notifier = 'EDIT_ORDERS_ADDL_SHIPPING_ADDRESS_ROWS'; } else { - $address_icon = 'icon_billing.png'; + $address_icon = 'fa-regular fa fa-credit-card'; $address_label = ENTRY_BILLING_ADDRESS; $address_name = 'billing'; $address_fields = $order->billing; @@ -84,4 +84,4 @@ require DIR_WS_MODULES . 'edit_orders/eo_common_address_format.php'; ?>
-
\ No newline at end of file +
diff --git a/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_edit_action_display.php b/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_edit_action_display.php index 0e4e2c1..806a120 100644 --- a/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_edit_action_display.php +++ b/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_edit_action_display.php @@ -2,22 +2,22 @@ /** * @package Edit Orders for Zen Cart German * Edit Orders plugin by Cindy Merkin a.k.a. lat9 (cindy@vinosdefrutastropicales.com) - * Copyright (c) 2017-2022 Vinos de Frutas Tropicales + * Copyright (c) 2017-2024 Vinos de Frutas Tropicales * @copyright Copyright 2003-2022 Zen Cart Development Team * Zen Cart German Version - www.zen-cart-pro.at * @copyright Portions Copyright 2003 osCommerce * @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0 - * @version $Id: eo_edit_action_display.php 2022-06-10 08:21:16Z webchills $ + * @version $Id: eo_edit_action_display.php 2024-03-20 08:21:16Z webchills $ */ // ----- // Prior to EO v4.6.0, this code was in-line in the main /admin/edit_orders.php script. Now required by // that script in global context for the rendering for its 'edit' action. // -if ($order->info['payment_module_code']) { - if (file_exists(DIR_FS_CATALOG_MODULES . 'payment/' . $order->info['payment_module_code'] . '.php')) { - require DIR_FS_CATALOG_MODULES . 'payment/' . $order->info['payment_module_code'] . '.php'; - require DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/modules/payment/' . $order->info['payment_module_code'] . '.php'; - $module = new $order->info['payment_module_code']; +if (!empty($order->info['payment_module_code'])) { + $payment_module_file = $order->info['payment_module_code'] . '.php'; + if ($eo->loadModuleLanguageFile('payment', $payment_module_file) === true) { + require DIR_FS_CATALOG_MODULES . 'payment/' . $payment_module_file; + $module = new $order->info['payment_module_code'](); } } @@ -36,8 +36,8 @@ # - - " class="btn btn-primary btn-sm" role="button"> + + " class="btn btn-primary btn-xs" role="button"> @@ -83,7 +83,7 @@ > @@ -112,10 +112,10 @@ - + info['cc_type']) || !empty($order->info['cc_owner']) || $order->info['payment_method'] == "Credit Card" || !empty($order->info['cc_number'])) { +if (!empty($order->info['cc_type']) || !empty($order->info['cc_owner']) || $order->info['payment_method'] === "Credit Card" || !empty($order->info['cc_number'])) { $max_type_length = 'maxlength="' . zen_field_length(TABLE_ORDERS, 'cc_type') . '"'; $max_owner_length = 'maxlength="' . zen_field_length(TABLE_ORDERS, 'cc_owner') . '"'; $max_number_length = 'maxlength="' . zen_field_length(TABLE_ORDERS, 'cc_number') . '"'; @@ -142,7 +142,7 @@ - @@ -280,7 +280,7 @@ } } ?> - + @@ -326,59 +326,60 @@ PHP_EOL . '============================================================' . PHP_EOL . 'Product Details:' . PHP_EOL . $eo->eoFormatArray($order->products[$i]) . PHP_EOL - ); + ); ?> $alignment, // One of 'center', 'right', or 'left' (optional) -// 'text' => $value -// ], -// ]; -// -// Observer note: Be sure to check that the $p2/$extra_data value is specifically (bool)false before initializing, since -// multiple observers might be injecting content! -// -$extra_data = false; -$product_info = $order->products[$i]; -$product_info['orders_products_id'] = $orders_products_id; -$zco_notifier->notify('EDIT_ORDERS_PRODUCTS_DATA_1', $product_info, $extra_data); -if (is_array($extra_data)) { - foreach ($extra_data as $data) { - $align = ''; - if (isset($data['align'])) { - switch ($data['align']) { - case 'center': - $align = ' a-c'; - break; - case 'right': - $align = ' a-r'; - break; - default: - $align = ''; - break; + // ----- + // To add more columns at the beginning of the order's products' table, a + // watching observer can provide an associative array in the form: + // + // $extra_data = [ + // [ + // 'align' => $alignment, // One of 'center', 'right', or 'left' (optional) + // 'text' => $value + // ], + // ]; + // + // Observer note: Be sure to check that the $p2/$extra_data value is specifically (bool)false before initializing, since + // multiple observers might be injecting content! + // + $extra_data = false; + $product_info = $order->products[$i]; + $product_info['orders_products_id'] = $orders_products_id; + $zco_notifier->notify('EDIT_ORDERS_PRODUCTS_DATA_1', $product_info, $extra_data); + if (is_array($extra_data)) { + foreach ($extra_data as $data) { + $align = ''; + if (isset($data['align'])) { + switch ($data['align']) { + case 'center': + $align = ' a-c'; + break; + case 'right': + $align = ' a-r'; + break; + default: + $align = ''; + break; + } } - } ?> - - - + + products[$i]['tax']); $final_price = $gross_price; ?> - + - + @@ -551,14 +561,24 @@
> info['payment_method'] != 'Credit Card') ? ENTRY_UPDATE_TO_CC : ENTRY_UPDATE_TO_CK; ?>> info['payment_method'] !== 'Credit Card') ? ENTRY_UPDATE_TO_CC : ENTRY_UPDATE_TO_CK; ?>
>
' . RESET_TOTALS . '' . zen_draw_checkbox_field('reset_totals', '', (EO_TOTAL_RESET_DEFAULT == 'on')); +$reset_totals_block = '' . RESET_TOTALS . '' . zen_draw_checkbox_field('reset_totals', '', (EO_TOTAL_RESET_DEFAULT === 'on')); $payment_calc_choice = ''; $priceClass = 'amount p-n'; $priceMessage = ''; -if (EO_PRODUCT_PRICE_CALC_METHOD == 'Choose') { +if (EO_PRODUCT_PRICE_CALC_METHOD === 'Choose') { $choices = [ ['id' => 1, 'text' => PAYMENT_CALC_AUTOSPECIALS], ['id' => 2, 'text' => PAYMENT_CALC_AUTO], @@ -232,7 +232,7 @@ $additional_inputs = ''; $zco_notifier->notify('EDIT_ORDERS_FORM_ADDITIONAL_INPUTS', $order, $additional_inputs); ?> - +
/>  X  /> + + > products[$i]['id']); - if (isset($order->products[$i]['attributes']) && count($order->products[$i]['attributes']) > 0) { + if (isset($order->products[$i]['attributes']) && count($order->products[$i]['attributes']) !== 0) { ?> -
  - />    
+
  + >    
products[$i]['id']); @@ -432,7 +433,7 @@ $products_options_array, $selected_attribute, "id=\"opid-$orders_products_id-oid-$option_id\"" - ) . "
\n"; + ) . "
\n"; echo $option_type_hidden_field; break; @@ -458,7 +459,7 @@ isset($checked[$attributeId]), null, "id=\"$option_html_id\"" - ) . "
" . PHP_EOL; + ) . "
" . PHP_EOL; } echo $option_type_hidden_field . ''; break; @@ -491,7 +492,7 @@ if (!empty($orders_products_attributes_id)) { $optionValue = eo_get_selected_product_attribute_value_by_id($orders_products_attributes_id[0], array_key_first($optionInfo['options'])); } - echo "$option_name: " . (!empty($optionValue) ? $optionValue : TEXT_ATTRIBUTES_UPLOAD_NONE) . '
'; + echo "$option_name: " . (!empty($optionValue) ? $optionValue : TEXT_ATTRIBUTES_UPLOAD_NONE) . '
'; if (!empty($optionValue)) { echo zen_draw_hidden_field("update_products[$orders_products_id][attr][$option_id][value]", $optionValue); echo $option_type_hidden_field; @@ -504,18 +505,18 @@ echo '' . - $optionInfo['name'] . ': ' . $optionValue . '
'; + $optionInfo['name'] . ': ' . $optionValue . '
'; echo $option_type_hidden_field; break; } } unset($optionID, $optionInfo, $products_options_array, $selected_attribute, $attributeId, $attributeValue, $optionValue, $text, $checked); - } + } // ----- // Starting with EO v4.4.0, both the net and gross prices are displayed when the store displays prices with tax. // - if (DISPLAY_PRICE_WITH_TAX == 'true') { + if (DISPLAY_PRICE_WITH_TAX === 'true') { $final_price = $order->products[$i]['final_price']; $onetime_charges = $order->products[$i]['onetime_charges']; } else { @@ -526,21 +527,30 @@ ?>
/> /> % /> + > % + + > + + /> + > + format($final_price * $order->products[$i]['qty'] + $onetime_charges, true, $order->info['currency'], $order->info['currency_value']); ?> + format($final_price * $order->products[$i]['qty'] + $onetime_charges, true, $order->info['currency'], $order->info['currency_value']); ?> +
- + - + + arrayImplode($order->products))) . + zen_draw_hidden_field('existing_totals', md5($eo->arrayImplode($order->totals))); + ?> + - +   - + @@ -566,7 +586,7 @@ -
+
@@ -584,7 +604,7 @@ // $additional_osh_content = []; $zco_notifier->notify('EDIT_ORDERS_ADDITIONAL_OSH_CONTENT', $order, $additional_osh_content); -if (is_array($additional_osh_content) && count($additional_osh_content) != 0) { +if (is_array($additional_osh_content) && count($additional_osh_content) !== 0) { foreach ($additional_osh_content as $osh_content) { ?> @@ -599,11 +619,15 @@ - fields['orders_status_id']] ;?> + + fields['orders_status_id']] ;?> + - fields['orders_status_id']); ?> + + fields['orders_status_id']); ?> + - + diff --git a/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_edit_action_osh_table_display.php b/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_edit_action_osh_table_display.php index 5f2a770..32667d5 100644 --- a/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_edit_action_osh_table_display.php +++ b/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_edit_action_osh_table_display.php @@ -2,12 +2,12 @@ /** * @package Edit Orders for Zen Cart German * Edit Orders plugin by Cindy Merkin a.k.a. lat9 (cindy@vinosdefrutastropicales.com) - * Copyright (c) 2017-2022 Vinos de Frutas Tropicales - * @copyright Copyright 2003-2022 Zen Cart Development Team + * Copyright (c) 2017-2024 Vinos de Frutas Tropicales + * @copyright Copyright 2003-2024 Zen Cart Development Team * Zen Cart German Version - www.zen-cart-pro.at * @copyright Portions Copyright 2003 osCommerce * @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0 - * @version $Id: eo_edit_action_osh_table_display.php 2022-06-10 08:21:16Z webchills $ + * @version $Id: eo_edit_action_osh_table_display.php 2024-03-20 08:21:16Z webchills $ */ // ----- // Prior to EO v4.6.0, this code was in-line in the main /admin/edit_orders.php script. Now required by @@ -20,7 +20,7 @@ // ----- // Gather the order's status-history records, sorting based on the configuration setting added in v4.4.0. // -$osh_order_by = (EO_STATUS_HISTORY_DISPLAY_ORDER == 'Desc') ? "date_added DESC, orders_status_history_id DESC" : "date_added ASC, orders_status_history_id ASC"; +$osh_order_by = (EO_STATUS_HISTORY_DISPLAY_ORDER === 'Desc') ? 'date_added DESC, orders_status_history_id DESC' : 'date_added ASC, orders_status_history_id ASC'; $orders_history = $db->Execute( "SELECT * FROM " . TABLE_ORDERS_STATUS_HISTORY . " @@ -140,12 +140,12 @@ if (!array_key_exists($field_name, $osh)) { continue; } - + // ----- // Grab the current field's value to improve readability. // $field_value = $osh[$field_name]; - + // ----- // No show_function? Then just output the associated field value. // @@ -153,12 +153,12 @@ $display_value = $field_value; } else { $show_function = $field_values['show_function']; - + // ----- // Built-in function? Make sure it's supported and then provide the output for the // current field. // - if ($show_function == 'built-in') { + if ($show_function === 'built-in') { switch ($field_name) { case 'orders_status_id': $display_value = $orders_status_array[$field_value]; @@ -191,7 +191,7 @@ } } } - + // ----- // Output the current field's display-value if there's an associated header-column. // @@ -199,12 +199,12 @@ ?> diff --git a/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_edit_action_ot_table_display.php b/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_edit_action_ot_table_display.php index 928f004..2bdcaac 100644 --- a/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_edit_action_ot_table_display.php +++ b/NEUE DATEIEN/DEINADMIN/includes/modules/edit_orders/eo_edit_action_ot_table_display.php @@ -2,21 +2,21 @@ /** * @package Edit Orders for Zen Cart German * Edit Orders plugin by Cindy Merkin a.k.a. lat9 (cindy@vinosdefrutastropicales.com) - * Copyright (c) 2017-2022 Vinos de Frutas Tropicales - * @copyright Copyright 2003-2022 Zen Cart Development Team + * Copyright (c) 2017-2024 Vinos de Frutas Tropicales + * @copyright Copyright 2003-2024 Zen Cart Development Team * Zen Cart German Version - www.zen-cart-pro.at * @copyright Portions Copyright 2003 osCommerce * @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0 - * @version $Id: eo_edit_action_ot_table_display.php 2022-06-10 08:21:16Z webchills $ + * @version $Id: eo_edit_action_ot_table_display.php 2024-03-20 08:21:16Z webchills $ */ // ----- // Prior to EO v4.6.0, this code was in-line in the main /admin/edit_orders.php script. Now required by // /admin/includes/modules/edit_orders/eo_edit_action_display.php in global context for the rendering of the // current order's orders-status-history table. // -$eo_href_link = zen_href_link(FILENAME_EDIT_ORDERS, zen_get_all_get_params(['oID', 'action']) . "oID=$oID&action=add_prdct"); +$eo_href_link = zen_href_link(FILENAME_EDIT_ORDERS, zen_get_all_get_params(['oID', 'action']) . "oID=$oID&action=add_prdct"); $eo_add_product_button = zen_image_button('button_add_product.gif', TEXT_ADD_NEW_PRODUCT); -$eo_add_button_link = '' . TEXT_ADD_NEW_PRODUCT . ''; +$eo_add_button_link = '' . TEXT_ADD_NEW_PRODUCT . ''; // ----- // Give a watching observer the chance to identify additional order-totals that should be considered display-only. @@ -40,7 +40,7 @@ // The number of columns displayed in this section depends on whether/not the store displays prices // with tax. If so, both the net- and gross-prices are displayed; otherwise, simply the net. // -$columns = ((DISPLAY_PRICE_WITH_TAX == 'true') ? 7 : 6) - 2; +$columns = ((DISPLAY_PRICE_WITH_TAX === 'true') ? 7 : 6) - 2; // Iterate over the order totals. for ($i = 0, $index = 0, $n = count($order->totals); $i < $n; $i++) { @@ -108,7 +108,7 @@  % @@ -144,7 +144,7 @@ - + + + $_POST['update_delivery_postcode'], 'delivery_country' => $_POST['update_delivery_country'], 'payment_method' => $_POST['update_info_payment_method'], - 'cc_type' => (isset($_POST['update_info_cc_type'])) ? $_POST['update_info_cc_type'] : '', - 'cc_owner' => (isset($_POST['update_info_cc_owner'])) ? $_POST['update_info_cc_owner'] : '', - 'cc_expires' => (isset($_POST['update_info_cc_expires'])) ? $_POST['update_info_cc_expires'] : '', + 'cc_type' => $_POST['update_info_cc_type'] ?? '', + 'cc_owner' => $_POST['update_info_cc_owner'] ?? '', + 'cc_expires' => $_POST['update_info_cc_expires'] ?? '', 'order_tax' => 0 ]; @@ -78,7 +78,7 @@ // If the number is not already obfuscated, we use the same method // as the authorize.net module to obfuscate the entered CC number if (ctype_digit($update_info_cc_number)) { - $update_info_cc_number = str_pad(substr($_POST['update_info_cc_number'], -4), strlen($_POST['update_info_cc_number']), "X", STR_PAD_LEFT); + $update_info_cc_number = str_pad(substr($_POST['update_info_cc_number'], -4), strlen($_POST['update_info_cc_number']), 'X', STR_PAD_LEFT); } $sql_data_array['cc_number'] = $update_info_cc_number; @@ -106,8 +106,8 @@ // Update the order's status-history (and send emails, if requested) via the common // Zen Cart function. // -$email_include_message = (isset($_POST['notify_comments']) && $_POST['notify_comments'] == 'on'); -$customer_notified = isset($_POST['notify']) ? (int)$_POST['notify'] : 0; +$email_include_message = (isset($_POST['notify_comments']) && $_POST['notify_comments'] === 'on'); +$customer_notified = (int)($_POST['notify'] ?? 0); $status_updated = zen_update_orders_history($oID, $comments, null, $status, $customer_notified, $email_include_message); $order_updated = ($status_updated > 0); @@ -139,13 +139,17 @@ // applied to start afresh. // if (isset($_POST['reset_totals'])) { - $order->info['tax'] = $order->info['shipping_tax'] = $order->info['shipping_cost'] = $order->info['total'] = $order->info['subtotal'] = 0; + $order->info['tax'] = 0; + $order->info['shipping_tax'] = 0; + $order->info['shipping_cost'] = 0; + $order->info['total'] = 0; + $order->info['subtotal'] = 0; $order->totals = []; foreach ($order->info['tax_groups'] as $key => $value) { $order->info['tax_groups'][$key] = 0; } } - + // ----- // Initialize the shipping cost, tax-rate and tax-value. // @@ -162,9 +166,9 @@ // Determine the 'base' price-calculation method to be used, setting the message to be // written to the order's status-history once the order's products have been processed. // - if (EO_PRODUCT_PRICE_CALC_METHOD == 'Auto' || EO_PRODUCT_PRICE_CALC_METHOD == 'AutoSpecials' || (EO_PRODUCT_PRICE_CALC_METHOD == 'Choose' && $_POST['payment_calc_method'] != 3)) { + if (EO_PRODUCT_PRICE_CALC_METHOD === 'Auto' || EO_PRODUCT_PRICE_CALC_METHOD === 'AutoSpecials' || (EO_PRODUCT_PRICE_CALC_METHOD === 'Choose' && $_POST['payment_calc_method'] !== '3')) { $price_calc_method_message = EO_MESSAGE_PRICING_AUTO; - if (EO_PRODUCT_PRICE_CALC_METHOD == 'AutoSpecials' || (EO_PRODUCT_PRICE_CALC_METHOD == 'Choose' && $_POST['payment_calc_method'] == 1)) { + if (EO_PRODUCT_PRICE_CALC_METHOD === 'AutoSpecials' || (EO_PRODUCT_PRICE_CALC_METHOD === 'Choose' && $_POST['payment_calc_method'] === '1')) { $price_calc_method_message = EO_MESSAGE_PRICING_AUTOSPECIALS; } $price_calc_method = 'auto'; @@ -197,7 +201,7 @@ PHP_EOL . 'Order Product ID: ' . $orders_products_id . ' Row ID: ' . $rowID . PHP_EOL . 'Product in Request: ' . PHP_EOL . $eo->eoFormatArray($product_update) ); - + // Only update if there is an existing item in the order if ($rowID >= 0) { // Grab the old product + attributes @@ -227,17 +231,17 @@ if ($product_update['qty'] > 0) { // Retrieve the information for the new product - $attrs = (isset($product_update['attr'])) ? $product_update['attr'] : ''; + $attrs = $product_update['attr'] ?? ''; unset($product_update['attr']); $new_product = eo_get_new_product( $old_product['id'], $product_update['qty'], $product_update['tax'], $attrs, - (EO_PRODUCT_PRICE_CALC_METHOD == 'AutoSpecials' || (EO_PRODUCT_PRICE_CALC_METHOD == 'Choose' && $_POST['payment_calc_method'] == 1)) + (EO_PRODUCT_PRICE_CALC_METHOD === 'AutoSpecials' || (EO_PRODUCT_PRICE_CALC_METHOD === 'Choose' && $_POST['payment_calc_method'] === '1')) ); unset($attrs); - + // Handle the case where the product was deleted // from the store. This should probably never be done. // Removing the product will cause issues with links @@ -263,17 +267,17 @@ // Depending on the product-price calculation method, either the values entered // or the pricing just calculated "rule". // - if ($price_calc_method == 'auto') { + if ($price_calc_method === 'auto') { $new_product = array_merge($product_update, $new_product); } else { $new_product = array_merge($new_product, $product_update); } - + // ----- // If the admin has an option to "Choose" the pricing calculation method, save the // current selection in the session so that it's maintained during their processing. // - if (EO_PRODUCT_PRICE_CALC_METHOD == 'Choose') { + if (EO_PRODUCT_PRICE_CALC_METHOD === 'Choose') { $_SESSION['eo_price_calculations'] = $_POST['payment_calc_method']; } @@ -283,6 +287,10 @@ // Update Subtotal and Pricing eo_update_order_subtotal($oID, $new_product); + // ----- + // Log the new product added; don't need its description! + // + unset($new_product['products_description']); $eo->eoLog ( PHP_EOL . $price_calc_method . PHP_EOL . 'Added Product:' . PHP_EOL . $eo->eoFormatArray($new_product) . PHP_EOL . @@ -295,16 +303,30 @@ $order_updated = true; } } - + // ----- // If the order's been updated ... // - if ($order_updated) { + if ($order_updated === true) { + // ----- + // See if additional details regarding what was updated in the order are available. + // + $additional_history = ''; + if (html_entity_decode($eo->arrayImplode($order->customer), ENT_COMPAT, CHARSET) !== html_entity_decode($_POST['existing-customer'], ENT_COMPAT, CHARSET)) { + $additional_history .= "\n\n" . sprintf(EO_MESSAGE_ADDRESS_UPDATED, EO_CUSTOMER) . $_POST['existing-customer']; + } + if (html_entity_decode($eo->arrayImplode($order->billing), ENT_COMPAT, CHARSET) !== html_entity_decode($_POST['existing-billing'], ENT_COMPAT, CHARSET)) { + $additional_history .= "\n\n" . sprintf(EO_MESSAGE_ADDRESS_UPDATED, EO_BILLING) . $_POST['existing-billing']; + } + if (html_entity_decode($eo->arrayImplode($order->delivery), ENT_COMPAT, CHARSET) !== html_entity_decode($_POST['existing-delivery'], ENT_COMPAT, CHARSET)) { + $additional_history .= "\n\n" . sprintf(EO_MESSAGE_ADDRESS_UPDATED, EO_DELIVERY) . $_POST['existing-delivery']; + } + // ----- // Add an orders-status-history record, identifying that an update was performed. // - $eo->eoRecordStatusHistory($oID, EO_MESSAGE_ORDER_UPDATED . $price_calc_method_message); - + $eo->eoRecordStatusHistory($oID, EO_MESSAGE_ORDER_UPDATED . $price_calc_method_message . $additional_history); + // ----- // Need to force update the tax field if the tax is zero. // This runs after the shipping tax is added by the above update @@ -333,6 +355,7 @@ $order->info['tax'] += $tax_value; } } + unset($order->products['products_description']); $eo->eoLog ( PHP_EOL . 'Updated Products in Order:' . PHP_EOL . $eo->eoFormatArray($order->products) . PHP_EOL . $eo->eoFormatOrderTotalsForLog($order, 'Updated Products Order Totals:') . @@ -355,19 +378,20 @@ ); foreach ($_POST['update_total'] as $order_total) { - $order_total['value'] = floatval($order_total['value']); + $order_total['value'] = (float)$order_total['value']; $order_total['text'] = $eo->eoFormatCurrencyValue($order_total['value']); $order_total['sort_order'] = $eo->eoGetOrderTotalSortOrder($order_total['code']); // TODO Special processing for some modules - if (zen_not_null($order_total['title']) && $order_total['title'] != ':') { + if (!empty($order_total['title']) && $order_total['title'] !== ':') { + $order_total['title'] = rtrim($order_total['title']) . ':'; switch ($order_total['code']) { case 'ot_shipping': $order->info['shipping_method'] = $order_total['title']; $order->info['shipping_module_code'] = $order_total['shipping_module']; break; case 'ot_tax': - if (count($order->products) == 0) { + if (count($order->products) === 0) { $order_total['title'] = ''; $order_total['value'] = 0; } @@ -390,7 +414,7 @@ case 'ot_coupon': // Default to using the title from the module $coupon = rtrim($order_total['title'], ': '); - $order_total['title'] = (isset($GLOBALS['ot_coupon'])) ? $GLOBALS['ot_coupon']->title : ''; + $order_total['title'] = $GLOBALS['ot_coupon']->title ?? ''; // Look for correctly formatted title preg_match('/([^:]+):([^:]+)/', $coupon, $matches); @@ -428,7 +452,7 @@ $found = false; foreach ($order->totals as $key => $total) { - if ($total['class'] == $order_total['code']) { + if ($total['class'] === $order_total['code']) { // Update the information in the order $order->totals[$key]['title'] = $order_total['title']; $order->totals[$key]['value'] = $order_total['value']; @@ -438,7 +462,7 @@ } } - if (!$found) { + if ($found === false) { $order->totals[] = [ 'class' => $order_total['code'], 'title' => $order_total['title'], @@ -454,7 +478,7 @@ // Update the order's order-totals eo_update_database_order_totals($oID); - + // ----- // Update the product's weight, too. // @@ -476,7 +500,7 @@ $order_updated = true; } -if ($order_updated) { +if ($order_updated === true) { $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success'); $zco_notifier->notify('EDIT_ORDER_ORDER_UPDATED_SUCCESS', $oID); } else {