' . esc_html($text) . '

'; }; if ($aieo_lc_bands) { rooster_admin_band_open(array('cols' => 2)); } list($aieo_lc_open, $aieo_lc_close) = AIEO_DMM_UI::card(array( 'anchor' => 'loyalty-classes-global-stacking-recipe', 'icon' => 'layers', 'title' => __('Global stacking recipe', 'ai-eshop-optimizer'), 'description' => __('Every discount a customer can receive, and the single rule that decides how they combine. A shopper can qualify for a role price, a brand discount, a loyalty class and a gift at the same time — this screen is where you decide whether those stack, override one another, or stop at the best one, so the price on the shelf is never an accident.', 'ai-eshop-optimizer'), 'span' => 'all', 'footer' => $aieo_lc_save('loyalty-classes-global-stacking-recipe'), )); echo $aieo_lc_open; echo $aieo_lc_why(__('Decide how role price, brand discount, loyalty class and brand gift combine across the whole shop.', 'ai-eshop-optimizer')); $aieo_lc_recipe_select = static function ($key, $id, $label, array $options, $class = '') use ($recipe) { $value = isset($options[(string) $recipe[$key]]) ? (string) $recipe[$key] : (string) key($options); return AIEO_Kit::row($label, AIEO_Kit::select('recipe[' . $key . ']', $options, $value, array('id' => $id)), '', array('id' => $id, 'class' => $class)); }; $aieo_lc_recipe_applies = static function ($key, $id, $label) use ($recipe) { return AIEO_Kit::row($label, AIEO_Kit::select('recipe_applies[' . $key . ']', array( 'on' => __('Applied', 'ai-eshop-optimizer'), 'off' => __('Off', 'ai-eshop-optimizer'), ), 'off' === (string) $recipe[$key] ? 'off' : 'on', array('id' => $id)), '', array('id' => $id)); }; $aieo_lc_fields = AIEO_Kit::row( __('When several discounts apply', 'ai-eshop-optimizer'), AIEO_Kit::select('discounts_combine', array( 'best' => __('The best one applies', 'ai-eshop-optimizer'), 'cascade' => __('They are applied one after the other', 'ai-eshop-optimizer'), ), AIEO_DMM_Settings::discounts_combine($settings), array('id' => 'aieo-lc-discounts-combine')), __('The shop\'s default. With the best one, a customer pays the lowest of the sale price, their role price, the largest discount and their class\'s price, and no discount is taken off a price that is already reduced. Each offer can have its own choice in the offers store.', 'ai-eshop-optimizer'), array('id' => 'aieo-lc-discounts-combine') ); $aieo_lc_fields .= $aieo_lc_recipe_select('role_pricing', 'aieo-lc-recipe-role-pricing', __('Role pricing', 'ai-eshop-optimizer'), array( 'active' => __('Active (role prices apply)', 'ai-eshop-optimizer'), 'off' => __('Off', 'ai-eshop-optimizer'), )); $aieo_lc_fields .= $aieo_lc_recipe_applies('brand_discount', 'aieo-lc-recipe-brand-discount-applies', __('Brand discount', 'ai-eshop-optimizer')); $aieo_lc_fields .= $aieo_lc_recipe_select('brand_discount', 'aieo-lc-recipe-brand-discount', __('How a brand discount stacks', 'ai-eshop-optimizer'), array( 'stack_multiplicative' => __('Stack × (on role-adjusted)', 'ai-eshop-optimizer'), 'stack_additive' => __('Stack additively', 'ai-eshop-optimizer'), 'replace_role' => __('Replace role price', 'ai-eshop-optimizer'), ), 'aieo-lc-when-cascade'); $aieo_lc_fields .= $aieo_lc_recipe_applies('loyalty_class', 'aieo-lc-recipe-loyalty-class-applies', __('Loyalty class', 'ai-eshop-optimizer')); $aieo_lc_fields .= $aieo_lc_recipe_select('loyalty_class', 'aieo-lc-recipe-loyalty-class', __('How a class\'s percentage stacks', 'ai-eshop-optimizer'), array( 'stack_multiplicative' => __('Stack × (on role+brand)', 'ai-eshop-optimizer'), 'stack_additive' => __('Stack additively', 'ai-eshop-optimizer'), 'replace_all' => __('Replace all other discounts', 'ai-eshop-optimizer'), ), 'aieo-lc-when-cascade'); $aieo_lc_fields .= $aieo_lc_recipe_select('brand_gift', 'aieo-lc-recipe-brand-gift', __('Brand gift', 'ai-eshop-optimizer'), array( 'over_and_above' => __('Over and above (in addition to %)', 'ai-eshop-optimizer'), 'off' => __('Off', 'ai-eshop-optimizer'), )); $aieo_lc_fields .= $aieo_lc_recipe_select('no_free_shipping_gate', 'aieo-lc-recipe-nfs-gate', __('No-free-shipping gate', 'ai-eshop-optimizer'), array( 'hard' => __('Hard (remove free shipping when any excluded item in cart)', 'ai-eshop-optimizer'), 'soft' => __('Soft (keep rates; UI can warn)', 'ai-eshop-optimizer'), 'off' => __('Off (no gate)', 'ai-eshop-optimizer'), )); ob_start(); echo '
' . $aieo_lc_fields . '
'; echo $aieo_lc_form('loyalty-classes-global-stacking-recipe'); echo $aieo_lc_close; do_action('aieo_dmm_offers_settings_cards'); list($aieo_lc_open, $aieo_lc_close) = AIEO_DMM_UI::card(array( 'anchor' => 'loyalty-classes-product-bundle-delivery', 'col' => 1, 'icon' => 'package', 'title' => __('Product-bundle delivery (performance)', 'ai-eshop-optimizer'), 'description' => __('Controls how the single-product page fetches upsells, cross-sells, need-based and related products. Both modes use the same cache table keyed by (product_id, role_hash, locale, mode) — flipping the switch does NOT require a cache flush. Prices are always pre-computed and baked into the cached HTML.', 'ai-eshop-optimizer'), 'footer' => $aieo_lc_save('loyalty-classes-product-bundle-delivery'), )); echo $aieo_lc_open; $bundle_mode = isset($settings['bundle_mode']) ? $settings['bundle_mode'] : 'full'; ob_start(); echo '
' . AIEO_Kit::row( __('Bundle mode', 'ai-eshop-optimizer'), AIEO_Kit::checks('bundle_mode', array( 'full' => __('Full', 'ai-eshop-optimizer'), 'rec_only' => __('Rec-only', 'ai-eshop-optimizer'), ), array((string) $bundle_mode), array( 'type' => 'radio', 'descriptions' => array( 'full' => __('one AJAX returns all 4 recommendation blocks PLUS variation data (feeds om-product-swatches). Fewest HTTP requests.', 'ai-eshop-optimizer'), 'rec_only' => __('one AJAX returns only the 4 recommendation blocks; om-product-swatches still fires its own variation AJAX. Cleaner separation.', 'ai-eshop-optimizer'), ), )), __('Recently-viewed is always handled separately with a localStorage-first strategy (zero AJAX when fresh).', 'ai-eshop-optimizer'), array('id' => 'aieo-lc-bundle-mode', 'group' => true) ) . '
'; echo $aieo_lc_form('loyalty-classes-product-bundle-delivery'); echo $aieo_lc_close; list($aieo_lc_open, $aieo_lc_close) = AIEO_DMM_UI::card(array( 'anchor' => 'loyalty-classes-pricing-engine', 'col' => 2, 'icon' => 'gauge', 'title' => __('Pricing engine (performance)', 'ai-eshop-optimizer'), 'description' => __('Controls how the DMM engine resolves brand/category/schedule/loyalty/NFS facts on every price request. Both modes produce identical prices — only the lookup strategy differs. Default is "Reactive" for a safe rollout. Flip to "Precomputed" on a server where you want to measure the hot-path savings. The switch takes effect on the next page load; FP rows are built lazily on first request.', 'ai-eshop-optimizer'), 'footer' => $aieo_lc_save('loyalty-classes-pricing-engine'), )); echo $aieo_lc_open; $pricing_mode = isset($settings['pricing_mode']) ? $settings['pricing_mode'] : 'reactive'; ob_start(); echo '
' . AIEO_Kit::row( __('Pricing mode', 'ai-eshop-optimizer'), AIEO_Kit::checks('pricing_mode', array( 'reactive' => __('Reactive', 'ai-eshop-optimizer'), 'precomputed' => __('Precomputed', 'ai-eshop-optimizer'), ), array((string) $pricing_mode), array( 'type' => 'radio', 'descriptions' => array( 'reactive' => __('walk active brand/category/schedule rules per request (cached via object cache). Same behaviour as Pass 1.', 'ai-eshop-optimizer'), 'precomputed' => __('read pre-stamped wp_aieo_dmm_product_fp / wp_aieo_dmm_user_fp rows. No taxonomy joins, no rule walks, no loyalty joins on the hot path. Required for future personalised / sequence-based discounts.', 'ai-eshop-optimizer'), ), )), __('Admin rule changes bump a single integer and never scan these tables; stale FP rows are recomputed one-at-a-time by the next reader.', 'ai-eshop-optimizer'), array('id' => 'aieo-lc-pricing-mode', 'group' => true) ) . '
'; echo $aieo_lc_form('loyalty-classes-pricing-engine'); echo $aieo_lc_close; if ($aieo_lc_bands) { rooster_admin_band_close(); } $aieo_lc_class_save = AIEO_Kit::button(__('Save class', 'ai-eshop-optimizer'), array('variant' => 'primary', 'type' => 'submit', 'class' => 'aieo-dmm-lc-save-btn', 'attrs' => array('data-action' => 'aieo_dmm_loyalty_class_save', 'form' => 'aieo-dmm-loyalty-class-form'))) . ' ' . AIEO_DMM_Offer_Forms::preview_button('aieo-dmm-loyalty-class-form', 'aieo_dmm_loyalty_class_save') . ' ' . AIEO_Kit::button(__('Cancel edit', 'ai-eshop-optimizer'), array('class' => 'aieo-dmm-lc-cancel-btn', 'attrs' => array('hidden' => true))); list($aieo_lc_open, $aieo_lc_close) = AIEO_DMM_UI::card(array( 'anchor' => 'loyalty-classes-new-class', 'icon' => 'plus', 'title' => __('New class', 'ai-eshop-optimizer'), 'description' => __('Create a discount class with its own on-top discount and points rate, then assign customers to it.', 'ai-eshop-optimizer'), 'footer' => $aieo_lc_class_save, )); echo $aieo_lc_open; ?>
0))), ENT_QUOTES | ENT_HTML5, 'UTF-8') : number_format_i18n(1) ); $aieo_lc_rows = \Rooster\Admin\Ui::field_row(array('id' => 'aieo-lc-class-slug', 'label' => __('Slug', 'ai-eshop-optimizer'), 'required' => true, 'control' => \Rooster\Admin\Ui::input('slug', '', array('id' => 'aieo-lc-class-slug', 'medium' => true, 'code' => true, 'required' => true, 'pattern' => '[a-z0-9_\-]+')))) . \Rooster\Admin\Ui::field_row(array('id' => 'aieo-lc-class-label', 'label' => __('Label', 'ai-eshop-optimizer'), 'required' => true, 'control' => \Rooster\Admin\Ui::input('label', '', array('id' => 'aieo-lc-class-label', 'medium' => true, 'required' => true)))) . \Rooster\Admin\Ui::field_row(array('id' => 'aieo-lc-class-extra', 'label' => __('Extra discount %', 'ai-eshop-optimizer'), 'required' => true, 'help' => __('On-top price discount for members in this class.', 'ai-eshop-optimizer'), 'control' => \Rooster\Admin\Ui::input('extra_percent', '', array('id' => 'aieo-lc-class-extra', 'type' => 'number', 'xs' => true, 'unit' => '%', 'step' => '0.01', 'min' => '0', 'max' => '99.99', 'required' => true, 'placeholder' => '5.00')))) . \Rooster\Admin\Ui::field_row(array('id' => 'aieo-lc-class-points', 'label' => __('Points per currency unit', 'ai-eshop-optimizer'), 'help' => $aieo_lc_points_help, 'control' => \Rooster\Admin\Ui::input('points_per_currency', '0', array('id' => 'aieo-lc-class-points', 'type' => 'number', 'xs' => true, 'step' => '0.0001', 'min' => '0', 'placeholder' => '1')))) . \Rooster\Admin\Ui::field_row(array( 'id' => 'aieo-lc-class-dates', 'label' => __('Schedule', 'ai-eshop-optimizer'), 'joiner' => '→', 'help' => __('The days the class counts, both included; leave a date empty for no limit on that side. Outside them the class gives no discount and no points, and its customers stay assigned.', 'ai-eshop-optimizer'), 'parts' => array( array('label' => __('From', 'ai-eshop-optimizer'), 'id' => 'aieo-lc-class-from', 'control' => AIEO_Kit::input('date_from', '', array('id' => 'aieo-lc-class-from', 'type' => 'date'))), array('label' => __('To', 'ai-eshop-optimizer'), 'id' => 'aieo-lc-class-to', 'control' => AIEO_Kit::input('date_to', '', array('id' => 'aieo-lc-class-to', 'type' => 'date'))), ), )) . \Rooster\Admin\Ui::field_row(array('id' => 'aieo-lc-class-enabled', 'label' => __('Enabled', 'ai-eshop-optimizer'), 'control' => AIEO_Kit::check('enabled', __('Enabled', 'ai-eshop-optimizer'), true, array('id' => 'aieo-lc-class-enabled')))) . (AIEO_DMM_Offer_Forms::shows_combine('customer_pricing') ? \Rooster\Admin\Ui::field_row(array('id' => 'aieo-lc-class-combinable', 'label' => AIEO_DMM_Offer_Forms::combine_row_label(), 'help' => AIEO_DMM_Offer_Forms::combine_help(), 'control' => AIEO_DMM_Offer_Forms::combine_control('aieo-lc-class-combinable'))) : '') . AIEO_DMM_Offer_Forms::campaign_row('aieo-lc-class-campaign') . \Rooster\Admin\Ui::field_row(array('id' => 'aieo-lc-class-description', 'label' => __('Description', 'ai-eshop-optimizer'), 'control' => \Rooster\Admin\Ui::textarea('description', '', array('id' => 'aieo-lc-class-description', 'rows' => 2)))); echo '
' . $aieo_lc_rows . '
'; echo AIEO_DMM_Offer_Forms::preview_area('aieo-dmm-loyalty-class-form'); ?>
0) : (array) $c, $aieo_lc_offer); $aieo_lc_kept = AIEO_DMM_Offer_Forms::kept_here($aieo_lc_offer); $aieo_lc_marked = $aieo_lc_marked || $aieo_lc_kept; $aieo_lc_rows[] = array( 'id' => (int) $c['id'], 'edit' => $aieo_lc_can_edit && ! $aieo_lc_here ? $module->edit_payload($c) + array('combinable' => AIEO_DMM_Offer_Forms::combinable($aieo_lc_offer), 'campaign_id' => AIEO_DMM_Offer_Forms::campaign_of($aieo_lc_offer)) : array(), 'slug' => (string) $c['slug'], 'label' => (string) $c['label'], 'extra' => (float) $c['extra_percent'], 'points' => (float) (isset($c['points_per_currency']) ? $c['points_per_currency'] : 0), 'window' => $aieo_lc_here ? AIEO_DMM_Schedule::window_label_for($aieo_lc_from, $aieo_lc_to, $aieo_lc_offer) : AIEO_DMM_Schedule::window_label($aieo_lc_from, $aieo_lc_to), 'state' => '' !== $aieo_lc_said ? $aieo_lc_said : ($aieo_lc_on ? ($aieo_lc_here ? AIEO_DMM_Schedule::state_for($aieo_lc_from, $aieo_lc_to, $aieo_lc_offer) : AIEO_DMM_Schedule::state($aieo_lc_from, $aieo_lc_to)) : 'off'), 'enabled' => $aieo_lc_on, ) + ($aieo_lc_kept ? array('kept' => AIEO_DMM_Offer_Forms::kept_here_label()) : array()) + ($aieo_lc_here ? array('one_table' => 1) + AIEO_DMM_Offer_Forms::one_table_row_actions($aieo_lc_offer) : array()); if ($aieo_lc_ask > 0 && is_array($aieo_lc_offer) && $aieo_lc_ask === (int) $aieo_lc_offer['id']) { $aieo_lc_asked = $aieo_lc_rows[count($aieo_lc_rows) - 1]['edit']; } } $aieo_lc_actions = array( array( 'id' => 'edit', 'label' => __('Edit', 'ai-eshop-optimizer'), 'class' => 'button button-small aieo-dmm-edit-loyalty-class', 'data' => array('class' => static function ($r) { return wp_json_encode($r['edit']); }), ), array( 'id' => 'aieo_dmm_loyalty_class_delete', 'label' => __('Delete', 'ai-eshop-optimizer'), 'class' => 'rooster-admin-button rooster-admin-button--sm aieo-dmm-delete-row', ), ); if ($aieo_lc_extra) { $aieo_lc_actions[0]['when'] = array('key' => 'one_table', 'not' => '1'); $aieo_lc_actions[1]['when'] = array('key' => 'one_table', 'not' => '1'); $aieo_lc_actions = array_merge($aieo_lc_actions, AIEO_DMM_Offer_Forms::one_table_actions()); } AIEO_Table::card(array( 'anchor' => 'loyalty-classes-customer-discount-classes', 'icon' => 'users', 'heading' => 'h2', 'title' => __('Customer discount classes', 'ai-eshop-optimizer'), 'description' => __('The classes you have created, with their discount and points rate; edit one or switch it off.', 'ai-eshop-optimizer'), 'page_id' => 'loyalty_classes', 'row_key' => 'id', 'rows' => $aieo_lc_rows, 'per_page' => 0, 'empty' => __('No classes yet. Add one above.', 'ai-eshop-optimizer'), 'columns' => array( array('key' => 'slug', 'label' => __('Slug', 'ai-eshop-optimizer'), 'type' => 'code'), array('key' => 'label', 'label' => __('Label', 'ai-eshop-optimizer')) + ($aieo_lc_marked ? array('subline' => 'kept') : array()), array('key' => 'extra', 'label' => __('Extra %', 'ai-eshop-optimizer'), 'type' => 'decimal', 'format' => array('precision' => 2)), array('key' => 'points', 'label' => __('Pts / unit', 'ai-eshop-optimizer'), 'type' => 'decimal', 'format' => array('precision' => 4)), array('key' => 'window', 'label' => __('Schedule', 'ai-eshop-optimizer'), 'nowrap' => true, 'sortable' => false), array( 'key' => 'state', 'label' => __('State', 'ai-eshop-optimizer'), 'type' => 'badge', 'format' => array( 'map' => array('active' => 'success', 'scheduled' => 'warning', 'ended' => 'muted', 'off' => 'muted', 'held' => 'warning', 'newer' => 'warning'), 'labels' => AIEO_DMM_Offer_Forms::list_state_labels() + array( 'active' => AIEO_DMM_Schedule::state_label('active'), 'scheduled' => AIEO_DMM_Schedule::state_label('scheduled'), 'ended' => AIEO_DMM_Schedule::state_label('ended'), 'off' => __('Disabled', 'ai-eshop-optimizer'), ), ), ), array('key' => 'enabled', 'label' => __('Enabled', 'ai-eshop-optimizer'), 'type' => 'boolean'), ), 'actions' => $aieo_lc_actions, )); if ($aieo_lc_extra && class_exists('AIEO_DMM_Offers')) { echo AIEO_DMM_Offers::archive_dialog(); } ?> 2)); } list($aieo_lc_open, $aieo_lc_close) = AIEO_DMM_UI::card(array( 'anchor' => 'loyalty-classes-assign-a-user', 'icon' => 'user-plus', 'title' => __('Assign a user', 'ai-eshop-optimizer'), 'description' => __('Put a customer in a discount class by hand, for example a member who joined in the shop.', 'ai-eshop-optimizer'), 'footer' => '', )); echo $aieo_lc_open; ?>

'loyalty-classes-bulk-assignment-by-csv', 'icon' => 'table', 'title' => __('Bulk assignment by CSV', 'ai-eshop-optimizer'), 'description' => __('CSV must include class_slug and one of user_email/user_login/user_id.', 'ai-eshop-optimizer'), )); echo $aieo_lc_open; ?>

'aieo-lc-csv-file', 'accept' => '.csv', 'required' => true, 'labelledby' => 'aieo-card-loyalty-classes-bulk-assignment-by-csv-title' ) ); ?>

'aieo-dmm-loyalty-job', 'state' => 'idle', 'run' => __('Upload & process', 'ai-eshop-optimizer'), 'primary' => false, 'run_attrs' => array('form' => 'aieo-dmm-loyalty-bulk-form', 'data-action' => 'aieo_dmm_loyalty_bulk_upload'), 'detail' => '', )); echo $aieo_lc_job; echo $aieo_lc_close; if ($aieo_lc_bands) { rooster_admin_band_close(); } list($aieo_lc_open, $aieo_lc_close) = AIEO_DMM_UI::card(array( 'anchor' => 'loyalty-classes-recent-assignments', 'icon' => 'clock', 'title' => __('Recent assignments', 'ai-eshop-optimizer'), 'description' => __('The latest customers placed in a class, by hand or automatically, and when it happened.', 'ai-eshop-optimizer'), 'flush' => true, )); echo $aieo_lc_open; ?> __('No assignments yet.', 'ai-eshop-optimizer'), 'compact' => true)); } else { echo '

' . esc_html__('No assignments yet.', 'ai-eshop-optimizer') . '

'; } ?> (int) $a['user_id'] . '-' . (int) $a['class_id'], '_name' => (string) $a['user_label'], 'user' => (string) $a['user_label'], 'class' => (string) $a['label'] . ' (' . number_format_i18n((float) $a['extra_percent'], 2) . '%)', 'assigned_at' => (string) $a['assigned_at'], 'actions' => array( array( 'label' => __('Remove', 'ai-eshop-optimizer'), 'destructive' => true, 'attrs' => array( 'data-aieo-unassign-loyalty' => '1', 'data-user-id' => (int) $a['user_id'], 'data-class-id' => (int) $a['class_id'], ), ), ), ); } echo \Rooster\Admin\Ui::table( array( array('key' => 'user', 'label' => __('User', 'ai-eshop-optimizer'), 'type' => 'text'), array('key' => 'class', 'label' => __('Class', 'ai-eshop-optimizer'), 'type' => 'text'), array('key' => 'assigned_at', 'label' => __('Assigned at', 'ai-eshop-optimizer'), 'type' => 'date'), array('key' => 'actions', 'label' => __('Actions', 'ai-eshop-optimizer'), 'type' => 'actions'), ), $aieo_lc_rows, array('id' => 'aieo-loyalty-assignments', 'caption' => esc_html__('Recent assignments', 'ai-eshop-optimizer')) ); ?> 'aieo-card-loyalty-classes-loyalty-points', 'title' => __('Loyalty points', 'ai-eshop-optimizer'), 'cols' => 3, )); } list($aieo_lc_open, $aieo_lc_close) = AIEO_DMM_UI::card(array( 'anchor' => 'loyalty-classes-how-points-work', 'icon' => 'circle-question-mark', 'title' => __('How points work', 'ai-eshop-optimizer'), 'description' => __('When customers earn points, how many they get and how their balance is kept.', 'ai-eshop-optimizer'), )); echo $aieo_lc_open; echo $aieo_lc_why(__('Customers earn points automatically when a WooCommerce order moves to "processing" or "completed". The rate is class.points_per_currency × order total, summed across the customer\'s enabled classes. All point events (earn, spend, ERP import, manual adjust) land in a ledger — the balance is always the running SUM(delta) per user, never a stored counter, so it can\'t drift.', 'ai-eshop-optimizer')); echo $aieo_lc_close; list($aieo_lc_open, $aieo_lc_close) = AIEO_DMM_UI::card(array( 'anchor' => 'loyalty-classes-erp-import-contract', 'icon' => 'plug', 'title' => __('ERP import contract', 'ai-eshop-optimizer'), 'description' => __('How the ERP connector sends back-office points balances to the shop, for whoever maintains the integration.', 'ai-eshop-optimizer'), )); echo $aieo_lc_open; $aieo_lc_erp_push = __('rooster-erp-connector\'s daily customer update brings over the back-office points balance. It should compute the delta it needs to push and call:', 'ai-eshop-optimizer'); echo class_exists('\Rooster\Admin\Guidance') ? \Rooster\Admin\Guidance::text($aieo_lc_erp_push, 'guidance', array('question' => __('How does the ERP push points?', 'ai-eshop-optimizer'))) : '

' . esc_html($aieo_lc_erp_push) . '

'; ?>
AIEO_DMM_Loyalty_Classes::add_points(
  $user_id,
  $delta_points,          // positive or negative
  'erp_import',
  'soft1:' . $erp_ref,    // idempotency key — duplicate refs are ignored
  $class_id = null,
  $notes = 'Daily SOFT1 sync'
);
__('What comes back to the ERP?', 'ai-eshop-optimizer'), 'html' => sprintf(esc_html($aieo_lc_emit), 'aieo_dmm_loyalty_points_added'))); } else { echo '

' . sprintf(esc_html($aieo_lc_emit), 'aieo_dmm_loyalty_points_added') . '

'; } echo $aieo_lc_close; list($aieo_lc_open, $aieo_lc_close) = AIEO_DMM_UI::card(array( 'anchor' => 'loyalty-classes-manual-adjustment', 'icon' => 'pencil-line', 'title' => __('Manual adjustment', 'ai-eshop-optimizer'), 'description' => __('Add or remove points for one customer by hand, with a note saying why.', 'ai-eshop-optimizer'), 'footer' => '', )); echo $aieo_lc_open; ?>