Plugin Directory

Changeset 3443355


Ignore:
Timestamp:
01/20/2026 03:03:04 PM (7 weeks ago)
Author:
dansart
Message:

Update 1.4.1

Location:
super-easy-stock-manager/trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • super-easy-stock-manager/trunk/include/classes/sesm-admin.php

    r2827548 r3443355  
    11<?php
    22
    3 
    4 
    53/**
    6 
    74 * Plugin Name: Super Easy Stock Manager
    8 
    95 * Class description: Placeholder. For Options in the future.
    10 
    116 * Author: Dan's Art
    12 
    137 * Author URI: http://dev.dans-art.ch
    14 
    158 */
    16 
    179Class Super_Easy_Stock_Manager_Admin extends Super_Easy_Stock_Manager_Helper
    18 
    1910{
    2011
    2112
    22 
    23 
    24 
    2513    /**
    26 
    2714     * Does nothing so far... maybe there will be some Backend functionalities.
    28 
    2915     */
    30 
    3116    public function __construct()
    32 
    3317    {
    34 
    3518    }
    36 
    3719}
    38 
  • super-easy-stock-manager/trunk/include/classes/sesm-ajax.php

    r2837173 r3443355  
    4949            $result['description'] = substr($product->get_short_description(), 0, 250);
    5050            $result['image'] = $product->get_image('thumbnail');
    51             $result['weight'] = $product->get_weight() ?: 0;
     51            $result['weight'] = wc_format_weight( $product->get_weight());
    5252            $result['attributes'] = wc_get_formatted_variation($product, true);
    5353            $result['product_url'] = get_edit_post_link($product_parent_id);
     54            $result['product_variations'] = $this->load_product_variations($product);
    5455        }
    5556        return $result;
     
    126127        $result['manage_stock'] = $product->get_manage_stock();
    127128        $result['template'] = 'updateStock';
    128         $old_quant = $product->get_stock_quantity();
     129
    129130        $manage_stock = $product->get_manage_stock();
    130131        if ($manage_stock !== true) {
     
    132133            $old_quant = 0;
    133134        }
    134         $increase = ($quantity > 0) ? true : false;
    135135        $quant_positive = abs($quantity);
    136         $new_quant = ($increase) ? $old_quant + $quant_positive : $old_quant - $quant_positive;
    137         $result['from_quant'] = $old_quant;
    138         $result['to_quant'] = $new_quant;
    139         if ($increase) {
    140             $result['change_txt'] = sprintf(__('The stock has been increased by %d to %d', 'super-easy-stock-manager'), $quant_positive, $new_quant);
    141             $result['direction'] = 'increase';
    142         } else {
    143             $result['change_txt'] = sprintf(__('The stock has been decreased by %d to %d', 'super-easy-stock-manager'), $quant_positive, $new_quant);
    144             $result['direction'] = 'decrease';
    145         }
    146         $product->set_stock_quantity($new_quant);
     136
     137        $result['change_txt'] = sprintf(__('The stock has set to %d', 'super-easy-stock-manager'), $quant_positive);
     138
     139        $product->set_stock_quantity($quant_positive);
    147140        //Saves the changes to the product / variation
    148141        $result['save_status'] = $product->save();
     
    303296        }
    304297    }
     298
     299    /**
     300     * Loads the siblings of a product variation.
     301     *
     302     * @param WC_Product $product
     303     * @return array The Product variations with quantity and attributes
     304     */
     305    public function load_product_variations($product)
     306    {
     307        $children_arr = [];
     308        if($product -> get_type() === 'variation'){
     309            $parent_id = $product -> get_parent_id();
     310            $parent = wc_get_product($parent_id);
     311            $children = $parent -> get_children();
     312            foreach($children as $child_id){
     313                $child = wc_get_product( $child_id );
     314                $attributes = wc_get_formatted_variation($child, true);
     315
     316               
     317                $children_arr[$child -> get_id()] = array(
     318                    "stock" => $child -> get_stock_quantity() . '&nbsp;' . __('pcs','super-easy-stock-manager'),
     319                    "attributes" => $attributes
     320                );
     321            }
     322        }
     323        return $children_arr;
     324    }
    305325    /**
    306326     * Checks if SKU is found in PostMeta. If true, the user has to update the lookup-tables.
  • super-easy-stock-manager/trunk/include/classes/sesm.php

    r2827548 r3443355  
    3636        add_action('wp_enqueue_scripts', function () {
    3737            $script = (WP_DEBUG === true) ? 'sesm-app.js' : 'sesm-app.min.js';
     38            //$script = 'sesm-app.js'; //@todo: Change on production
    3839            $version = $this->load_version();
    3940            wp_enqueue_script('sesm-main-script', SESM_MAIN_URL . 'scripts/' . $script, ['jquery', 'wp-i18n'], $version, true);
     
    4344        //Add the styles
    4445        if ($use_style) {
    45             add_action('wp_head', function () {
    46                 $style = 'sesm-main.min.css';
     46            add_action('wp_enqueue_scripts', function () {
     47                $style = 'sesm-main.css';
    4748                $version = $this->load_version();
    4849                wp_enqueue_style('sesm-main-style', SESM_MAIN_URL . 'style/' . $style, [], $version);
  • super-easy-stock-manager/trunk/languages/sesm.pot

    r2827721 r3443355  
    44"Project-Id-Version: Super Easy Stock Manager\n"
    55"Report-Msgid-Bugs-To: \n"
    6 "POT-Creation-Date: 2022-12-02 13:52+0000\n"
     6"POT-Creation-Date: 2023-12-28 14:35+0000\n"
    77"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    88"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1717"X-Domain: sesm"
    1818
    19 #: include/classes/sesm-ajax.php:294
     19#: include/classes/sesm-ajax.php:289
    2020msgid ""
    2121"Could not load the Product. Please update the lookup tables. <br/>"
     
    3131msgstr ""
    3232
    33 #: include/classes/sesm-ajax.php:359
     33#: include/classes/sesm-ajax.php:381
    3434msgid "Error"
    3535msgstr ""
     
    3939msgstr ""
    4040
    41 #: include/classes/sesm-ajax.php:281
     41#: include/classes/sesm-ajax.php:276
    4242msgid "Info"
    4343msgstr ""
    4444
    45 #: include/classes/sesm-ajax.php:119 include/classes/sesm-ajax.php:237
     45#: include/classes/sesm-ajax.php:122 include/classes/sesm-ajax.php:232
    4646msgid "Input must be a number"
    4747msgstr ""
    4848
    49 #: scripts/sesm-app.js:171
     49#: scripts/sesm-app.js:184
    5050msgid "Input SKU"
    5151msgstr ""
    5252
    53 #: include/classes/sesm-ajax.php:286
     53#: include/classes/sesm-ajax.php:281
    5454msgid "No SKU provided"
    5555msgstr ""
    5656
    57 #: include/classes/sesm-ajax.php:361
     57#: include/classes/sesm-ajax.php:383
    5858msgid "No value set!"
    5959msgstr ""
    6060
    61 #: include/classes/sesm-ajax.php:205
     61#: include/classes/sesm-ajax.php:200
    6262msgid "Old and new prices are the same, nothing has been changed"
    6363msgstr ""
    6464
    65 #: scripts/sesm-app.js:49
     65#: scripts/sesm-app.js:388
     66msgid "Other variants of this product"
     67msgstr ""
     68
     69#: include/classes/sesm-ajax.php:318
     70msgid "pcs"
     71msgstr ""
     72
     73#: scripts/sesm-app.js:62
    6674msgid "Price"
    6775msgstr ""
     
    7583msgstr ""
    7684
    77 #: include/classes/sesm-ajax.php:296
     85#: include/classes/sesm-ajax.php:291
    7886#, php-format
    7987msgid "Product not found for SKU: %s"
    8088msgstr ""
    8189
    82 #: include/classes/sesm-ajax.php:337
     90#: include/classes/sesm-ajax.php:359
    8391msgid "Product with Variations"
    8492msgstr ""
    8593
    86 #: scripts/sesm-app.js:51
     94#: scripts/sesm-app.js:64
    8795msgid "Quantity"
    8896msgstr ""
    8997
    90 #: include/classes/sesm-ajax.php:197
     98#: include/classes/sesm-ajax.php:192
    9199msgid "Regular price set to 0"
    92100msgstr ""
    93101
    94 #: include/classes/sesm-ajax.php:185
     102#: include/classes/sesm-ajax.php:180
    95103msgid "Sale price has to be smaller than the regular price!"
    96104msgstr ""
    97105
    98 #: include/classes/sesm-ajax.php:200
     106#: include/classes/sesm-ajax.php:195
    99107msgid "Sale price set to 0"
    100108msgstr ""
     
    104112msgstr ""
    105113
    106 #: include/classes/sesm-ajax.php:333
     114#: include/classes/sesm-ajax.php:355
    107115msgid "Simple Product"
    108116msgstr ""
    109117
    110 #: scripts/sesm-app.js:52
     118#: scripts/sesm-app.js:65
    111119msgid "SKU"
    112120msgstr ""
    113121
    114 #: scripts/sesm-app.js:371
     122#: scripts/sesm-app.js:380
    115123msgid "Stock management got activated"
    116124msgstr ""
     
    124132msgstr ""
    125133
    126 #: scripts/sesm-app.js:483
     134#: scripts/sesm-app.js:513
    127135msgid ""
    128136"The Price contains invalid characters. Only 0-9, comma (,) and period (.) "
     
    130138msgstr ""
    131139
    132 #: scripts/sesm-app.js:479
     140#: scripts/sesm-app.js:509
    133141msgid ""
    134142"The Quantity contains invalid characters. Only 0-9, comma (,) and period (.) "
     
    136144msgstr ""
    137145
    138 #: include/classes/sesm-ajax.php:141
    139 #, php-format
    140 msgid "The stock has been decreased by %d to %d"
     146#: include/classes/sesm-ajax.php:137
     147msgid "The stock has set to %d"
    141148msgstr ""
    142149
    143 #: include/classes/sesm-ajax.php:138
    144 #, php-format
    145 msgid "The stock has been increased by %d to %d"
    146 msgstr ""
    147 
    148 #: include/classes/sesm-ajax.php:341
     150#: include/classes/sesm-ajax.php:363
    149151msgid "Variation of Product"
    150152msgstr ""
    151153
    152 #: include/classes/sesm-ajax.php:70 include/classes/sesm-ajax.php:184
     154#: include/classes/sesm-ajax.php:73 include/classes/sesm-ajax.php:179
    153155msgid "Warning"
    154156msgstr ""
    155157
    156 #: scripts/sesm-app.js:50
     158#: scripts/sesm-app.js:63
    157159msgid "Weight"
    158160msgstr ""
    159161
    160 #: include/classes/sesm.php:84 include/classes/sesm.php:102
     162#: include/classes/sesm.php:85 include/classes/sesm.php:103
    161163msgid ""
    162164"WooCommerce seems not to be installed. Please Install or activate "
     
    164166msgstr ""
    165167
    166 #: include/classes/sesm.php:106
     168#: include/classes/sesm.php:107
    167169msgid "You are not allowed to edit products!"
    168170msgstr ""
    169171
    170 #: include/classes/sesm.php:81
     172#: include/classes/sesm.php:82
    171173msgid ""
    172174"You are not allowed to edit products. Please contact the system "
     
    174176msgstr ""
    175177
    176 #: include/classes/sesm.php:98
     178#: include/classes/sesm.php:99
    177179msgid "You are not logged in. Please sign-in to use this function"
    178180msgstr ""
    179181
    180 #: include/classes/sesm-ajax.php:71
     182#: include/classes/sesm-ajax.php:74
    181183msgid ""
    182184"You can't change the values of that product, because it has variations. "
  • super-easy-stock-manager/trunk/languages/super-easy-stock-manager-de_DE-da4784d5d8d4d14c4e162b2d484bd899.json

    r2827721 r3443355  
    1 {"translation-revision-date":"2022-12-02 13:53+0000","generator":"Loco https:\/\/localise.biz\/","source":"scripts\/sesm-app.min.js","domain":"super-easy-stock-manager","locale_data":{"super-easy-stock-manager":{"":{"domain":"super-easy-stock-manager","lang":"de_DE","plural-forms":"nplurals=2; plural=n != 1;"},"Input SKU":["Artikelnummer eingeben"],"Price":["Preis"],"Quantity":["Anzahl"],"SKU":["Artikelnummer"],"Stock management got activated":["Lagerverwaltung wurde aktiviert"],"The Price contains invalid characters. Only 0-9, comma (,) and period (.) are allowed":["Der Preis enth\u00e4lt ung\u00fcltige Zeichen. Es sind nur die Zahlen von 0-9, Komma (,) und Punkt (.) erlaubt."],"The Quantity contains invalid characters. Only 0-9, comma (,) and period (.) are allowed":["Die Anzahl enth\u00e4lt ung\u00fcltige Zeichen. Es sind nur die Zahlen von 0-9, Komma (,) und Punkt (.) erlaubt."],"Weight":["Gewicht"]}}}
     1{"translation-revision-date":"2023-12-28 14:36+0000","generator":"Loco https:\/\/localise.biz\/","source":"scripts\/sesm-app.min.js","domain":"super-easy-stock-manager","locale_data":{"super-easy-stock-manager":{"":{"domain":"super-easy-stock-manager","lang":"de_DE","plural-forms":"nplurals=2; plural=n != 1;"},"Input SKU":["Artikelnummer eingeben"],"Other variants of this product":["Andere Varianten dieses Produkts"],"Price":["Preis"],"Quantity":["Anzahl"],"SKU":["Artikelnummer"],"Stock management got activated":["Lagerverwaltung wurde aktiviert"],"The Price contains invalid characters. Only 0-9, comma (,) and period (.) are allowed":["Der Preis enth\u00e4lt ung\u00fcltige Zeichen. Es sind nur die Zahlen von 0-9, Komma (,) und Punkt (.) erlaubt."],"The Quantity contains invalid characters. Only 0-9, comma (,) and period (.) are allowed":["Die Anzahl enth\u00e4lt ung\u00fcltige Zeichen. Es sind nur die Zahlen von 0-9, Komma (,) und Punkt (.) erlaubt."],"Weight":["Gewicht"]}}}
  • super-easy-stock-manager/trunk/languages/super-easy-stock-manager-de_DE.po

    r2827721 r3443355  
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2020-10-31 20:56+0000\n"
    6 "PO-Revision-Date: 2022-12-02 13:53+0000\n"
     6"PO-Revision-Date: 2023-12-28 14:36+0000\n"
    77"Last-Translator: \n"
    88"Language-Team: Deutsch\n"
     
    1515"X-Loco-Version: 2.6.3; wp-6.1.1"
    1616
    17 #: include/classes/sesm-ajax.php:294
     17#: include/classes/sesm-ajax.php:289
    1818msgid ""
    1919"Could not load the Product. Please update the lookup tables. <br/>"
     
    3131msgstr "Menge zum hinzufügen oder entfernen eingeben"
    3232
    33 #: include/classes/sesm-ajax.php:359
     33#: include/classes/sesm-ajax.php:381
    3434msgid "Error"
    3535msgstr "Fehler"
     
    3939msgstr "http://dev.dans-art.ch"
    4040
    41 #: include/classes/sesm-ajax.php:281
     41#: include/classes/sesm-ajax.php:276
    4242msgid "Info"
    4343msgstr "Info"
    4444
    45 #: include/classes/sesm-ajax.php:119 include/classes/sesm-ajax.php:237
     45#: include/classes/sesm-ajax.php:122 include/classes/sesm-ajax.php:232
    4646msgid "Input must be a number"
    4747msgstr "Eingabe muss eine Nummer sein"
    4848
    49 #: scripts/sesm-app.js:171
     49#: scripts/sesm-app.js:184
    5050msgid "Input SKU"
    5151msgstr "Artikelnummer eingeben"
    5252
    53 #: include/classes/sesm-ajax.php:286
     53#: include/classes/sesm-ajax.php:281
    5454msgid "No SKU provided"
    5555msgstr "Keine Artikelnummer übergeben."
    5656
    57 #: include/classes/sesm-ajax.php:361
     57#: include/classes/sesm-ajax.php:383
    5858msgid "No value set!"
    5959msgstr "Keinen Wert gesetzt!"
    6060
    61 #: include/classes/sesm-ajax.php:205
     61#: include/classes/sesm-ajax.php:200
    6262msgid "Old and new prices are the same, nothing has been changed"
    6363msgstr "Alter und neuer Preis haben sich nicht geändert."
    6464
    65 #: scripts/sesm-app.js:49
     65#: scripts/sesm-app.js:388
     66msgid "Other variants of this product"
     67msgstr "Andere Varianten dieses Produkts"
     68
     69#: include/classes/sesm-ajax.php:318
     70msgid "pcs"
     71msgstr "stk"
     72
     73#: scripts/sesm-app.js:62
    6674msgid "Price"
    6775msgstr "Preis"
     
    7583msgstr "Angebots Preis"
    7684
    77 #: include/classes/sesm-ajax.php:296
     85#: include/classes/sesm-ajax.php:291
    7886#, php-format
    7987msgid "Product not found for SKU: %s"
    8088msgstr "Kein Produkt für die Artikelnummer \"%s\" gefunden"
    8189
    82 #: include/classes/sesm-ajax.php:337
     90#: include/classes/sesm-ajax.php:359
    8391msgid "Product with Variations"
    8492msgstr "Produkt mit Varianten"
    8593
    86 #: scripts/sesm-app.js:51
     94#: scripts/sesm-app.js:64
    8795msgid "Quantity"
    8896msgstr "Anzahl"
    8997
    90 #: include/classes/sesm-ajax.php:197
     98#: include/classes/sesm-ajax.php:192
    9199msgid "Regular price set to 0"
    92100msgstr "Normalpreis auf 0 gesetzt"
    93101
    94 #: include/classes/sesm-ajax.php:185
     102#: include/classes/sesm-ajax.php:180
    95103msgid "Sale price has to be smaller than the regular price!"
    96104msgstr "Der Angebotspreis muss kleiner sein, als der normale Preis"
    97105
    98 #: include/classes/sesm-ajax.php:200
     106#: include/classes/sesm-ajax.php:195
    99107msgid "Sale price set to 0"
    100108msgstr "Angebotspreis auf 0 gesetzt"
     
    104112msgstr "Scanne einen Barcode oder gib die Artikelnummer ein und drücke Enter"
    105113
    106 #: include/classes/sesm-ajax.php:333
     114#: include/classes/sesm-ajax.php:355
    107115msgid "Simple Product"
    108116msgstr "Einfaches Produkt"
    109117
    110 #: scripts/sesm-app.js:52
     118#: scripts/sesm-app.js:65
    111119msgid "SKU"
    112120msgstr "Artikelnummer"
    113121
    114 #: scripts/sesm-app.js:371
     122#: scripts/sesm-app.js:380
    115123msgid "Stock management got activated"
    116124msgstr "Lagerverwaltung wurde aktiviert"
     
    124132msgstr "Super einfache Lagerverwaltung"
    125133
    126 #: scripts/sesm-app.js:483
     134#: scripts/sesm-app.js:513
    127135msgid ""
    128136"The Price contains invalid characters. Only 0-9, comma (,) and period (.) "
     
    132140") und Punkt (.) erlaubt."
    133141
    134 #: scripts/sesm-app.js:479
     142#: scripts/sesm-app.js:509
    135143msgid ""
    136144"The Quantity contains invalid characters. Only 0-9, comma (,) and period (.) "
     
    140148"(,) und Punkt (.) erlaubt."
    141149
    142 #: include/classes/sesm-ajax.php:141
    143 #, php-format
    144 msgid "The stock has been decreased by %d to %d"
    145 msgstr "Der Lagerbestand wurde um %d reduziert auf insgesamt %d Stück."
    146 
    147 #: include/classes/sesm-ajax.php:138
    148 #, php-format
    149 msgid "The stock has been increased by %d to %d"
    150 msgstr "Der Lagerbestand wurde um %d erhöht auf insgesamt %d Stück."
    151 
    152 #: include/classes/sesm-ajax.php:341
     150#: include/classes/sesm-ajax.php:137
     151msgid "The stock has set to %d"
     152msgstr "Die Anzahl wurde auf %d gesetzt"
     153
     154#: include/classes/sesm-ajax.php:363
    153155msgid "Variation of Product"
    154156msgstr "Variante eines Produkts"
    155157
    156 #: include/classes/sesm-ajax.php:70 include/classes/sesm-ajax.php:184
     158#: include/classes/sesm-ajax.php:73 include/classes/sesm-ajax.php:179
    157159msgid "Warning"
    158160msgstr "Warnung"
    159161
    160 #: scripts/sesm-app.js:50
     162#: scripts/sesm-app.js:63
    161163msgid "Weight"
    162164msgstr "Gewicht"
    163165
    164 #: include/classes/sesm.php:84 include/classes/sesm.php:102
     166#: include/classes/sesm.php:85 include/classes/sesm.php:103
    165167#| msgid ""
    166168#| "WooCommerce seems not to be installed. Please install or activate "
     
    173175"aktiviere WooCommerce um dieses Plugin zu nutzen."
    174176
    175 #: include/classes/sesm.php:106
     177#: include/classes/sesm.php:107
    176178msgid "You are not allowed to edit products!"
    177179msgstr "Du bist nicht berechtigt, Produkte zu bearbeiten!"
    178180
    179 #: include/classes/sesm.php:81
     181#: include/classes/sesm.php:82
    180182msgid ""
    181183"You are not allowed to edit products. Please contact the system "
     
    185187"System-Administrator, um die benötigten Rechte zu erhalten."
    186188
    187 #: include/classes/sesm.php:98
     189#: include/classes/sesm.php:99
    188190msgid "You are not logged in. Please sign-in to use this function"
    189191msgstr ""
    190192"Du bist nicht eingeloggt. Bitte melde dich an, um diese Funktion zu nutzen."
    191193
    192 #: include/classes/sesm-ajax.php:71
     194#: include/classes/sesm-ajax.php:74
    193195msgid ""
    194196"You can't change the values of that product, because it has variations. "
  • super-easy-stock-manager/trunk/license.txt

    r2827548 r3443355  
    11Super Easy Stock Manager
    22
    3 
    4 
    53Copyright 2020 by Dan's Art
    64
    7 
    8 
    95This program is free software; you can redistribute it and/or modify
    10 
    116it under the terms of the GNU General Public License as published by
    12 
    137the Free Software Foundation; either version 2 of the License, or
    14 
    158(at your option) any later version.
    169
    17 
    18 
    1910This program is distributed in the hope that it will be useful,
    20 
    2111but WITHOUT ANY WARRANTY; without even the implied warranty of
    22 
    2312MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    24 
    2513GNU General Public License for more details.
    2614
    27 
    28 
    2915You should have received a copy of the GNU General Public License
    30 
    3116along with this program; if not, write to the Free Software
    32 
    3317Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    3418
    35 
    36 
    3719This program incorporates work covered by the following copyright and
    38 
    3920permission notices:
    4021
    41 
    42 
    4322  WordPress - Web publishing software
    4423
    45 
    46 
    4724  Copyright 2003-2017 by the contributors
    4825
    49 
    50 
    5126  WordPress is released under the GPL
    5227
    53 
    54 
    5528=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    5629
    57 
    58 
    5930            GNU GENERAL PUBLIC LICENSE
    60 
    6131               Version 2, June 1991
    6232
    63 
    64 
    6533 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
    66 
    6734 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
    6835
    69 
    70 
    7136 Everyone is permitted to copy and distribute verbatim copies
    72 
    7337 of this license document, but changing it is not allowed.
    7438
    75 
    76 
    7739                Preamble
    7840
    79 
    80 
    8141  The licenses for most software are designed to take away your
    82 
    8342freedom to share and change it.  By contrast, the GNU General Public
    84 
    8543License is intended to guarantee your freedom to share and change free
    86 
    8744software--to make sure the software is free for all its users.  This
    88 
    8945General Public License applies to most of the Free Software
    90 
    9146Foundation's software and to any other program whose authors commit to
    92 
    9347using it.  (Some other Free Software Foundation software is covered by
    94 
    9548the GNU Library General Public License instead.)  You can apply it to
    96 
    9749your programs, too.
    9850
    99 
    100 
    10151  When we speak of free software, we are referring to freedom, not
    102 
    10352price.  Our General Public Licenses are designed to make sure that you
    104 
    10553have the freedom to distribute copies of free software (and charge for
    106 
    10754this service if you wish), that you receive source code or can get it
    108 
    10955if you want it, that you can change the software or use pieces of it
    110 
    11156in new free programs; and that you know you can do these things.
    11257
    113 
    114 
    11558  To protect your rights, we need to make restrictions that forbid
    116 
    11759anyone to deny you these rights or to ask you to surrender the rights.
    118 
    11960These restrictions translate to certain responsibilities for you if you
    120 
    12161distribute copies of the software, or if you modify it.
    12262
    123 
    124 
    12563  For example, if you distribute copies of such a program, whether
    126 
    12764gratis or for a fee, you must give the recipients all the rights that
    128 
    12965you have.  You must make sure that they, too, receive or can get the
    130 
    13166source code.  And you must show them these terms so they know their
    132 
    13367rights.
    13468
    135 
    136 
    13769  We protect your rights with two steps: (1) copyright the software, and
    138 
    13970(2) offer you this license which gives you legal permission to copy,
    140 
    14171distribute and/or modify the software.
    14272
    143 
    144 
    14573  Also, for each author's protection and ours, we want to make certain
    146 
    14774that everyone understands that there is no warranty for this free
    148 
    14975software.  If the software is modified by someone else and passed on, we
    150 
    15176want its recipients to know that what they have is not the original, so
    152 
    15377that any problems introduced by others will not reflect on the original
    154 
    15578authors' reputations.
    15679
    157 
    158 
    15980  Finally, any free program is threatened constantly by software
    160 
    16181patents.  We wish to avoid the danger that redistributors of a free
    162 
    16382program will individually obtain patent licenses, in effect making the
    164 
    16583program proprietary.  To prevent this, we have made it clear that any
    166 
    16784patent must be licensed for everyone's free use or not licensed at all.
    16885
    169 
    170 
    17186  The precise terms and conditions for copying, distribution and
    172 
    17387modification follow.
    17488
    175 
    176 
    17789            GNU GENERAL PUBLIC LICENSE
    178 
    17990   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    18091
    181 
    182 
    18392  0. This License applies to any program or other work which contains
    184 
    18593a notice placed by the copyright holder saying it may be distributed
    186 
    18794under the terms of this General Public License.  The "Program", below,
    188 
    18995refers to any such program or work, and a "work based on the Program"
    190 
    19196means either the Program or any derivative work under copyright law:
    192 
    19397that is to say, a work containing the Program or a portion of it,
    194 
    19598either verbatim or with modifications and/or translated into another
    196 
    19799language.  (Hereinafter, translation is included without limitation in
    198 
    199100the term "modification".)  Each licensee is addressed as "you".
    200101
    201 
    202 
    203102Activities other than copying, distribution and modification are not
    204 
    205103covered by this License; they are outside its scope.  The act of
    206 
    207104running the Program is not restricted, and the output from the Program
    208 
    209105is covered only if its contents constitute a work based on the
    210 
    211106Program (independent of having been made by running the Program).
    212 
    213107Whether that is true depends on what the Program does.
    214108
    215 
    216 
    217109  1. You may copy and distribute verbatim copies of the Program's
    218 
    219110source code as you receive it, in any medium, provided that you
    220 
    221111conspicuously and appropriately publish on each copy an appropriate
    222 
    223112copyright notice and disclaimer of warranty; keep intact all the
    224 
    225113notices that refer to this License and to the absence of any warranty;
    226 
    227114and give any other recipients of the Program a copy of this License
    228 
    229115along with the Program.
    230116
    231 
    232 
    233117You may charge a fee for the physical act of transferring a copy, and
    234 
    235118you may at your option offer warranty protection in exchange for a fee.
    236119
    237 
    238 
    239120  2. You may modify your copy or copies of the Program or any portion
    240 
    241121of it, thus forming a work based on the Program, and copy and
    242 
    243122distribute such modifications or work under the terms of Section 1
    244 
    245123above, provided that you also meet all of these conditions:
    246124
    247 
    248 
    249125    a) You must cause the modified files to carry prominent notices
    250 
    251126    stating that you changed the files and the date of any change.
    252127
    253 
    254 
    255128    b) You must cause any work that you distribute or publish, that in
    256 
    257129    whole or in part contains or is derived from the Program or any
    258 
    259130    part thereof, to be licensed as a whole at no charge to all third
    260 
    261131    parties under the terms of this License.
    262132
    263 
    264 
    265133    c) If the modified program normally reads commands interactively
    266 
    267134    when run, you must cause it, when started running for such
    268 
    269135    interactive use in the most ordinary way, to print or display an
    270 
    271136    announcement including an appropriate copyright notice and a
    272 
    273137    notice that there is no warranty (or else, saying that you provide
    274 
    275138    a warranty) and that users may redistribute the program under
    276 
    277139    these conditions, and telling the user how to view a copy of this
    278 
    279140    License.  (Exception: if the Program itself is interactive but
    280 
    281141    does not normally print such an announcement, your work based on
    282 
    283142    the Program is not required to print an announcement.)
    284143
    285 
    286 
    287144These requirements apply to the modified work as a whole.  If
    288 
    289145identifiable sections of that work are not derived from the Program,
    290 
    291146and can be reasonably considered independent and separate works in
    292 
    293147themselves, then this License, and its terms, do not apply to those
    294 
    295148sections when you distribute them as separate works.  But when you
    296 
    297149distribute the same sections as part of a whole which is a work based
    298 
    299150on the Program, the distribution of the whole must be on the terms of
    300 
    301151this License, whose permissions for other licensees extend to the
    302 
    303152entire whole, and thus to each and every part regardless of who wrote it.
    304 
    305153Thus, it is not the intent of this section to claim rights or contest
    306 
    307154your rights to work written entirely by you; rather, the intent is to
    308 
    309155exercise the right to control the distribution of derivative or
    310 
    311156collective works based on the Program.
    312157
    313 
    314 
    315158In addition, mere aggregation of another work not based on the Program
    316 
    317159with the Program (or with a work based on the Program) on a volume of
    318 
    319160a storage or distribution medium does not bring the other work under
    320 
    321161the scope of this License.
    322162
    323 
    324 
    325163  3. You may copy and distribute the Program (or a work based on it,
    326 
    327164under Section 2) in object code or executable form under the terms of
    328 
    329165Sections 1 and 2 above provided that you also do one of the following:
    330166
    331 
    332 
    333167    a) Accompany it with the complete corresponding machine-readable
    334 
    335168    source code, which must be distributed under the terms of Sections
    336 
    337169    1 and 2 above on a medium customarily used for software interchange; or,
    338170
    339 
    340 
    341171    b) Accompany it with a written offer, valid for at least three
    342 
    343172    years, to give any third party, for a charge no more than your
    344 
    345173    cost of physically performing source distribution, a complete
    346 
    347174    machine-readable copy of the corresponding source code, to be
    348 
    349175    distributed under the terms of Sections 1 and 2 above on a medium
    350 
    351176    customarily used for software interchange; or,
    352177
    353 
    354 
    355178    c) Accompany it with the information you received as to the offer
    356 
    357179    to distribute corresponding source code.  (This alternative is
    358 
    359180    allowed only for noncommercial distribution and only if you
    360 
    361181    received the program in object code or executable form with such
    362 
    363182    an offer, in accord with Subsection b above.)
    364183
    365 
    366 
    367184The source code for a work means the preferred form of the work for
    368 
    369185making modifications to it.  For an executable work, complete source
    370 
    371186code means all the source code for all modules it contains, plus any
    372 
    373187associated interface definition files, plus the scripts used to
    374 
    375188control compilation and installation of the executable.  However, as a
    376 
    377189special exception, the source code distributed need not include
    378 
    379190anything that is normally distributed (in either source or binary
    380 
    381191form) with the major components (compiler, kernel, and so on) of the
    382 
    383192operating system on which the executable runs, unless that component
    384 
    385193itself accompanies the executable.
    386194
    387 
    388 
    389195If distribution of executable or object code is made by offering
    390 
    391196access to copy from a designated place, then offering equivalent
    392 
    393197access to copy the source code from the same place counts as
    394 
    395198distribution of the source code, even though third parties are not
    396 
    397199compelled to copy the source along with the object code.
    398200
    399 
    400 
    401201  4. You may not copy, modify, sublicense, or distribute the Program
    402 
    403202except as expressly provided under this License.  Any attempt
    404 
    405203otherwise to copy, modify, sublicense or distribute the Program is
    406 
    407204void, and will automatically terminate your rights under this License.
    408 
    409205However, parties who have received copies, or rights, from you under
    410 
    411206this License will not have their licenses terminated so long as such
    412 
    413207parties remain in full compliance.
    414208
    415 
    416 
    417209  5. You are not required to accept this License, since you have not
    418 
    419210signed it.  However, nothing else grants you permission to modify or
    420 
    421211distribute the Program or its derivative works.  These actions are
    422 
    423212prohibited by law if you do not accept this License.  Therefore, by
    424 
    425213modifying or distributing the Program (or any work based on the
    426 
    427214Program), you indicate your acceptance of this License to do so, and
    428 
    429215all its terms and conditions for copying, distributing or modifying
    430 
    431216the Program or works based on it.
    432217
    433 
    434 
    435218  6. Each time you redistribute the Program (or any work based on the
    436 
    437219Program), the recipient automatically receives a license from the
    438 
    439220original licensor to copy, distribute or modify the Program subject to
    440 
    441221these terms and conditions.  You may not impose any further
    442 
    443222restrictions on the recipients' exercise of the rights granted herein.
    444 
    445223You are not responsible for enforcing compliance by third parties to
    446 
    447224this License.
    448225
    449 
    450 
    451226  7. If, as a consequence of a court judgment or allegation of patent
    452 
    453227infringement or for any other reason (not limited to patent issues),
    454 
    455228conditions are imposed on you (whether by court order, agreement or
    456 
    457229otherwise) that contradict the conditions of this License, they do not
    458 
    459230excuse you from the conditions of this License.  If you cannot
    460 
    461231distribute so as to satisfy simultaneously your obligations under this
    462 
    463232License and any other pertinent obligations, then as a consequence you
    464 
    465233may not distribute the Program at all.  For example, if a patent
    466 
    467234license would not permit royalty-free redistribution of the Program by
    468 
    469235all those who receive copies directly or indirectly through you, then
    470 
    471236the only way you could satisfy both it and this License would be to
    472 
    473237refrain entirely from distribution of the Program.
    474238
    475 
    476 
    477239If any portion of this section is held invalid or unenforceable under
    478 
    479240any particular circumstance, the balance of the section is intended to
    480 
    481241apply and the section as a whole is intended to apply in other
    482 
    483242circumstances.
    484243
    485 
    486 
    487244It is not the purpose of this section to induce you to infringe any
    488 
    489245patents or other property right claims or to contest validity of any
    490 
    491246such claims; this section has the sole purpose of protecting the
    492 
    493247integrity of the free software distribution system, which is
    494 
    495248implemented by public license practices.  Many people have made
    496 
    497249generous contributions to the wide range of software distributed
    498 
    499250through that system in reliance on consistent application of that
    500 
    501251system; it is up to the author/donor to decide if he or she is willing
    502 
    503252to distribute software through any other system and a licensee cannot
    504 
    505253impose that choice.
    506254
    507 
    508 
    509255This section is intended to make thoroughly clear what is believed to
    510 
    511256be a consequence of the rest of this License.
    512257
    513 
    514 
    515258  8. If the distribution and/or use of the Program is restricted in
    516 
    517259certain countries either by patents or by copyrighted interfaces, the
    518 
    519260original copyright holder who places the Program under this License
    520 
    521261may add an explicit geographical distribution limitation excluding
    522 
    523262those countries, so that distribution is permitted only in or among
    524 
    525263countries not thus excluded.  In such case, this License incorporates
    526 
    527264the limitation as if written in the body of this License.
    528265
    529 
    530 
    531266  9. The Free Software Foundation may publish revised and/or new versions
    532 
    533267of the General Public License from time to time.  Such new versions will
    534 
    535268be similar in spirit to the present version, but may differ in detail to
    536 
    537269address new problems or concerns.
    538270
    539 
    540 
    541271Each version is given a distinguishing version number.  If the Program
    542 
    543272specifies a version number of this License which applies to it and "any
    544 
    545273later version", you have the option of following the terms and conditions
    546 
    547274either of that version or of any later version published by the Free
    548 
    549275Software Foundation.  If the Program does not specify a version number of
    550 
    551276this License, you may choose any version ever published by the Free Software
    552 
    553277Foundation.
    554278
    555 
    556 
    557279  10. If you wish to incorporate parts of the Program into other free
    558 
    559280programs whose distribution conditions are different, write to the author
    560 
    561281to ask for permission.  For software which is copyrighted by the Free
    562 
    563282Software Foundation, write to the Free Software Foundation; we sometimes
    564 
    565283make exceptions for this.  Our decision will be guided by the two goals
    566 
    567284of preserving the free status of all derivatives of our free software and
    568 
    569285of promoting the sharing and reuse of software generally.
    570286
    571 
    572 
    573287                NO WARRANTY
    574288
    575 
    576 
    577289  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
    578 
    579290FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
    580 
    581291OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
    582 
    583292PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
    584 
    585293OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    586 
    587294MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
    588 
    589295TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
    590 
    591296PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
    592 
    593297REPAIR OR CORRECTION.
    594298
    595 
    596 
    597299  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
    598 
    599300WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
    600 
    601301REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
    602 
    603302INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
    604 
    605303OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
    606 
    607304TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
    608 
    609305YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
    610 
    611306PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
    612 
    613307POSSIBILITY OF SUCH DAMAGES.
    614308
    615 
    616 
    617309             END OF TERMS AND CONDITIONS
    618 
  • super-easy-stock-manager/trunk/readme.txt

    r2837173 r3443355  
    77Tested up to: 6.1.1
    88Requires PHP: 7.4
    9 Stable tag: 1.3.6
     9Stable tag: 1.4.1
     10
     11Requires Plugins: woocommerce
    1012WC requires at least: 4.7.0
    11 WC tested up to: 7.1.0
     13WC tested up to: 10.4.3
    1214License: GPLv3 or later
    1315License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5658
    5759== Changelog ==
     60= [1.4.1] 2026-01-20 =
     61- Fixed: Style was not correctly enqueued
     62- Tested up to WP 6.9
     63
     64= [1.4] 2023-12-28 =
     65- Update stock sets the given amount instead of updating it
     66- Style improvements
     67
    5868= [1.3.6] 2022-12-21 =
    5969- Added numeric keyboard input for mobile devices
  • super-easy-stock-manager/trunk/scripts/sesm-app.js

    r2837173 r3443355  
    1717   */
    1818  construct() {
    19     jQuery(document).ready(async function() {
     19    jQuery(document).ready(async function () {
    2020      // Check if the container for the plugin exists. If not, it skips the rest
    2121      if (jQuery('#sesm_container').length !== 1) {
     
    4040      sesmScripts.activate_sesm();
    4141
    42       sesmScripts.is_mobile();
     42
     43      if (!sesmScripts.is_mobile()) {
     44        // Re-focus to the input field every 2 seconds
     45        let autofocus = setInterval(function () {
     46          if (
     47            document.activeElement.id !== 'sesm_quant' &&
     48            document.activeElement.id !== 'sesm_price_reg' &&
     49            document.activeElement.id !== 'sesm_price_sale'
     50          ) {
     51            jQuery('#sesm_sku_input').focus();
     52          }
     53        }, 2000);
     54      }
    4355    });
    4456  }
     
    7284     */
    7385  add_event_listener() {
    74     jQuery('#sesm_buttons button').click(function(item) {
     86    jQuery('#sesm_buttons button').click(function (item) {
    7587      sesmScripts.sesm_do = jQuery(item.currentTarget).data('do');
    7688
     
    115127      // Open scan application
    116128      sesmScripts.scanner = new Html5QrcodeScanner(
    117           'scanner-container',
    118           {
    119             fps: 10,
    120             qrbox: {width: 250, height: 250},
    121             useBarCodeDetectorIfSupported: true,
    122             rememberLastUsedCamera: true,
    123             showTorchButtonIfSupported: true,
    124             defaultZoomValueIfSupported: 2,
    125           });
     129        'scanner-container',
     130        {
     131          fps: 10,
     132          qrbox: { width: 250, height: 250 },
     133          useBarCodeDetectorIfSupported: true,
     134          rememberLastUsedCamera: true,
     135          showTorchButtonIfSupported: true,
     136          defaultZoomValueIfSupported: 2,
     137        });
    126138
    127139      sesmScripts.scanner.render(sesmScripts.onScanSuccess, sesmScripts.onScanFailure);
     
    136148    });
    137149
    138     jQuery(document).on('keyup', async function(s) {
     150    jQuery(document).on('keyup', async function (s) {
    139151      if (s.which == 13) {
    140152        sesmScripts.fire_ajax();
    141153      }
    142154    }),
    143     jQuery('#add_quant_btn').click(function() {
    144       sesmScripts.changeQuantity(true);
    145     }),
    146     jQuery('#remove_quant_btn').click(function() {
    147       sesmScripts.changeQuantity(false);
    148     });
     155      jQuery('#add_quant_btn').click(function () {
     156        sesmScripts.changeQuantity(true);
     157      }),
     158      jQuery('#remove_quant_btn').click(function () {
     159        sesmScripts.changeQuantity(false);
     160      });
    149161
    150162    /**
     
    226238    jQuery('#mobile-scan-container').css('display', 'flex');
    227239    jQuery('#mobile-scan-container').css('bottom', -jQuery('#mobile-scan-container').height());
    228     jQuery('#mobile-scan-container').animate({'bottom': 0}, 200);
     240    jQuery('#mobile-scan-container').animate({ 'bottom': 0 }, 200);
    229241  }
    230242
     
    253265    if (jQuery('#selection-indicator')[0].offsetLeft === padding) {
    254266      animationDuration = 0; // Move instantly if not in position yet
    255       jQuery('#selection-indicator').animate({opacity: 1}, animationDuration);
     267      jQuery('#selection-indicator').animate({ opacity: 1 }, animationDuration);
    256268    }
    257269    jQuery('#selection-indicator').animate({
    258270      left: finalLeft,
    259271    },
    260     animationDuration);
     272      animationDuration);
    261273  }
    262274
     
    278290    }
    279291
    280     jQuery.each(jsonData, function(key, value) {
     292    jQuery.each(jsonData, function (key, value) {
    281293      value = sesmScripts.format_value(key, value, jsonData);
    282294      template = template.replaceAll('{{' + key + '}}', value);
    283295    });
    284296
    285     jQuery.each(this.field_names, function(key, value) {
     297    jQuery.each(this.field_names, function (key, value) {
    286298      value = sesmScripts.format_value(key, value);
    287299      template = template.replaceAll('{{' + key + '}}', value);
     
    290302    jQuery('#sesm_history').addClass('active');
    291303    jQuery('#sesm_history').prepend(template);
    292     jQuery('#sesm_history article').first().animate({opacity: 1, height: '100%'}, 500);
     304    jQuery('#sesm_history article').first().animate({ opacity: 1, height: '100%' }, 500);
    293305  }
    294306
     
    363375      case 'regular_price':
    364376        return (!jsonData.sale_price) ? value + ' ' + jsonData.currency : '<span class="strikethrough">' + value + ' ' + jsonData.currency + '</span>';
    365 
    366       case 'weight':
    367         return value + ' kg';
    368 
    369377      case 'sale_price':
    370378        return (!jsonData.sale_price) ? '' : value + ' ' + jsonData.currency;
     
    376384      case 'to_sale':
    377385        return sesmScripts.format_price_change(jsonData.from_sale, jsonData.to_sale, jsonData, fieldName);
     386      case 'product_variations':
     387        const list = sesmScripts.format_product_variations(jsonData.product_variations);
     388        const title = __('Other variants of this product', 'super-easy-stock-manager');
     389        return (!this.empty(list)) ? `<details><summary>${title}</summary><ul>${list}</ul></details>` : '';
    378390      default:
    379391        return value;
     
    392404    const priceLength = (jsonData.from_regular + jsonData.to_regular + jsonData.currency).length;
    393405    const priceLengthSale = (jsonData.from_sale + jsonData.to_sale + jsonData.currency).length;
    394     const priceNotice = (fieldName === 'to_regular') ?jsonData.regular_notice:jsonData.sale_notice;
     406    const priceNotice = (fieldName === 'to_regular') ? jsonData.regular_notice : jsonData.sale_notice;
    395407
    396408    if (!sesmScripts.empty(priceNotice)) {
     
    411423    if (fieldName === 'to_regular') {
    412424      return '<div class="' + classLongContent + ' ' +
    413       isSingleRegularClass + '"><span class="from_price strikethrough">' + fromPrice + ' ' +
    414       jsonData.currency + '</span><span class="to_price">' + toPrice + ' ' + jsonData.currency + '</span></div>';
     425        isSingleRegularClass + '"><span class="from_price strikethrough">' + fromPrice + ' ' +
     426        jsonData.currency + '</span><span class="to_price">' + toPrice + ' ' + jsonData.currency + '</span></div>';
    415427    } else {
    416428      return '<div class="' + classLongContent + ' ' +
    417       isSingleSaleClass + '"><span class="from_price strikethrough">' + fromPrice+ ' ' +
    418       jsonData.currency + '</span><span class="to_price">' + toPrice + ' ' + jsonData.currency + '</span></div>';
    419     }
     429        isSingleSaleClass + '"><span class="from_price strikethrough">' + fromPrice + ' ' +
     430        jsonData.currency + '</span><span class="to_price">' + toPrice + ' ' + jsonData.currency + '</span></div>';
     431    }
     432  }
     433
     434  /**
     435   *
     436   * @param {object} variations The variations as an object
     437   * @return {string}
     438   */
     439  format_product_variations(variations) {
     440    let variationsList = '';
     441    for (let key in variations) {
     442      if (variations.hasOwnProperty(key)) { // Check if the property is part of the object and not its prototype chain
     443        const attributes = sesmScripts.format_attributes(variations[key]);
     444        const stock = variations[key].stock;
     445        variationsList += `<li><span>${attributes}</span><span>${stock}</span></li>`;
     446      }
     447    }
     448    return variationsList;
    420449  }
    421450
     
    491520      return false;
    492521    }
    493     const tooltip = sesmScripts.template.apply_template(sesmScripts.template.loaded_templates.errortooltip, {error: message, id: id});
     522    const tooltip = sesmScripts.template.apply_template(sesmScripts.template.loaded_templates.errortooltip, { error: message, id: id });
    494523    if (jQuery('#input-error-' + id).length === 0) {
    495524      jQuery('#' + id).before(tooltip);
     
    528557  }
    529558}
    530 const {__, _x, _n, _nx} = wp.i18n; // Map the functions to the wp translation script
     559const { __, _x, _n, _nx } = wp.i18n; // Map the functions to the wp translation script
    531560
    532561const sesmScripts = new SesmMain;
  • super-easy-stock-manager/trunk/scripts/sesm-app.min.js

    r2837173 r3443355  
    1 "use strict";class SesmMain{sesm_do="";field_names={};scanner={};version="1.3.6";construct(){jQuery(document).ready((async function(){if(1!==jQuery("#sesm_container").length)return!1;await import("./modules/ajax.js").then(module=>{sesmScripts.ajax=new module.SesmAjax}),await import("./modules/template.js").then(module=>{sesmScripts.template=new module.SesmTemplate}),await sesmScripts.template.load_default_templates(),sesmScripts.load_field_names(),sesmScripts.add_event_listener(),sesmScripts.activate_sesm(),sesmScripts.is_mobile()}))}load_field_names(){this.field_names.price_title=__("Price","super-easy-stock-manager"),this.field_names.weight_title=__("Weight","super-easy-stock-manager"),this.field_names.quantity_title=__("Quantity","super-easy-stock-manager"),this.field_names.sku_title=__("SKU","super-easy-stock-manager"),this.field_names.iconclass=""}is_mobile(){return jQuery(window).width()<500||!!/Mobi|Android/i.test(navigator.userAgent)}add_event_listener(){jQuery("#sesm_buttons button").click((function(item){switch(sesmScripts.sesm_do=jQuery(item.currentTarget).data("do"),jQuery("#sesm_input .quant_flex_group").hide(),jQuery("#sesm_input .price_flex_group").hide(),jQuery("#sesm_buttons button.button-active").removeClass("button-active"),jQuery("#sesm_sku_input").slideDown("fast"),jQuery("#sesm_container #selection-indicator").slideDown("fast"),jQuery(item.currentTarget).addClass("button-active"),sesmScripts.is_mobile()?sesmScripts.show_scan_container():jQuery("#sesm_sku_input").focus(),sesmScripts.move_selection_indicator(),sesmScripts.sesm_do){case"add_quantities":jQuery(".sesm_options .quant_flex_group").slideDown("fast");break;case"update_price":jQuery(".sesm_options .price_flex_group").slideDown("fast")}})),jQuery("#scan-button").click(()=>{jQuery("#scan-button").hide(),jQuery("#scan-button-active").show(),sesmScripts.scanner=new Html5QrcodeScanner("scanner-container",{fps:10,qrbox:{width:250,height:250},useBarCodeDetectorIfSupported:!0,rememberLastUsedCamera:!0,showTorchButtonIfSupported:!0,defaultZoomValueIfSupported:2}),sesmScripts.scanner.render(sesmScripts.onScanSuccess,sesmScripts.onScanFailure)}),jQuery("#scan-button-active").click(()=>{jQuery("#scan-button").show(),jQuery("#scan-button-active").hide(),sesmScripts.scanner.clear()}),jQuery(document).on("keyup",(async function(s){13==s.which&&sesmScripts.fire_ajax()})),jQuery("#add_quant_btn").click((function(){sesmScripts.changeQuantity(!0)})),jQuery("#remove_quant_btn").click((function(){sesmScripts.changeQuantity(!1)})),jQuery("#sesm_container input").keyup(e=>{if(9===e.which||16===e.which||17===e.which)return;const value=e.currentTarget.value,id=e.currentTarget.id;sesmScripts.validate_input(value,id)?sesmScripts.remove_input_errors("#input-error-"+id):sesmScripts.show_input_error(id)}),jQuery(window).resize(()=>{sesmScripts.move_selection_indicator(0),sesmScripts.is_mobile()&&jQuery("#sesm_sku_input").attr("placeholder",__("Input SKU","super-easy-stock-manager"))})}async fire_ajax(){const ajaxResult=await sesmScripts.ajax.do_ajax();sesmScripts.empty(ajaxResult)?console.log("Failed to add to history: "+ajaxResult):sesmScripts.addToHistory(jQuery.parseJSON(ajaxResult))}onScanSuccess(code){if(sesmScripts.empty(code))return!1;jQuery("#sesm_sku_input").val(code),sesmScripts.scanner.clear(),jQuery("#scan-button").show(),jQuery("#scan-button-active").hide(),sesmScripts.fire_ajax(),console.log(code)}onScanFailure(message){console.log(message)}show_scan_container(){"flex"!==jQuery("#mobile-scan-container").css("display")&&(jQuery("#mobile-scan-container").css("display","flex"),jQuery("#mobile-scan-container").css("bottom",-jQuery("#mobile-scan-container").height()),jQuery("#mobile-scan-container").animate({bottom:0},200))}activate_sesm(){jQuery("#sesm_buttons").slideDown("fast")}move_selection_indicator(animationDuration=200){if(0===jQuery("#sesm_buttons .button-active").length)return;const activePosition=jQuery("#sesm_buttons .button-active")[0].offsetLeft,activeCenter=jQuery("#sesm_buttons .button-active").width()/2,padding=Number.parseInt(jQuery("#sesm_container").css("padding-left")),finalLeft=activePosition-padding+activeCenter;jQuery("#selection-indicator")[0].offsetLeft===padding&&(animationDuration=0,jQuery("#selection-indicator").animate({opacity:1},animationDuration)),jQuery("#selection-indicator").animate({left:finalLeft},animationDuration)}addToHistory(jsonData){let template=this.get_template_by_state(jsonData.template);this.empty(template)&&jQuery("#sesm_history").prepend(__(`Template "${jsonData.template}" not loaded`,"super-easy-stock-manager")),this.set_icon_class(jsonData.template);const attr=this.format_attributes(jsonData);this.empty(attr)||(jsonData.attributes=attr),jQuery.each(jsonData,(function(key,value){value=sesmScripts.format_value(key,value,jsonData),template=template.replaceAll("{{"+key+"}}",value)})),jQuery.each(this.field_names,(function(key,value){value=sesmScripts.format_value(key,value),template=template.replaceAll("{{"+key+"}}",value)})),jQuery("#sesm_history").addClass("active"),jQuery("#sesm_history").prepend(template),jQuery("#sesm_history article").first().animate({opacity:1,height:"100%"},500)}get_template_by_state(template){switch(template){case"error":return sesmScripts.template.loaded_templates.error;case"updateStock":return sesmScripts.template.loaded_templates.updatestock;case"updatePrice":return sesmScripts.template.loaded_templates.updateprice;default:return sesmScripts.template.loaded_templates.item}}set_icon_class(template){let classname="";switch(template){case"get":classname="fas fa-question";break;case"updateStock":classname="fas fa-box-open";break;case"updatePrice":classname="far fa-money-bill-alt"}this.field_names.iconclass=classname}format_attributes(jsonData){return this.empty(jsonData.attributes)?"":jsonData.attributes.replace(", ","<br/>")}format_value(fieldName,value,jsonData){switch(fieldName){case"stock_quantity":const number=parseInt(value);return number<1?"<span class='red'>"+number+"</span>":value;case"regular_price":return jsonData.sale_price?'<span class="strikethrough">'+value+" "+jsonData.currency+"</span>":value+" "+jsonData.currency;case"weight":return value+" kg";case"sale_price":return jsonData.sale_price?value+" "+jsonData.currency:"";case"manage_stock":return!1!==value?"":__("Stock management got activated","super-easy-stock-manager");case"to_regular":return sesmScripts.format_price_change(jsonData.from_regular,jsonData.to_regular,jsonData,fieldName);case"to_sale":return sesmScripts.format_price_change(jsonData.from_sale,jsonData.to_sale,jsonData,fieldName);default:return value}}format_price_change(fromPrice,toPrice,jsonData,fieldName){const priceLength=(jsonData.from_regular+jsonData.to_regular+jsonData.currency).length,priceLengthSale=(jsonData.from_sale+jsonData.to_sale+jsonData.currency).length,priceNotice="to_regular"===fieldName?jsonData.regular_notice:jsonData.sale_notice;if(!sesmScripts.empty(priceNotice))return'<div class="info-text">'+priceNotice+"</div>";if(fromPrice===toPrice)return"";if(sesmScripts.empty(toPrice))return"";const classLongContent=priceLength+priceLengthSale>7||jsonData.to_sale>0?"content-long":"",isSingleRegularClass=0===jsonData.to_sale?"single":"",isSingleSaleClass=0===jsonData.to_regular?"single":"";return"to_regular"===fieldName?'<div class="'+classLongContent+" "+isSingleRegularClass+'"><span class="from_price strikethrough">'+fromPrice+" "+jsonData.currency+'</span><span class="to_price">'+toPrice+" "+jsonData.currency+"</span></div>":'<div class="'+classLongContent+" "+isSingleSaleClass+'"><span class="from_price strikethrough">'+fromPrice+" "+jsonData.currency+'</span><span class="to_price">'+toPrice+" "+jsonData.currency+"</span></div>"}changeQuantity(add){const quant=this.empty(jQuery("#sesm_quant").val())?0:parseInt(jQuery("#sesm_quant").val());let newQuant=0;newQuant=!0===add?quant+1==0?1:quant+1:quant-1==0?-1:quant-1,newQuant=Number.isInteger(newQuant)?newQuant:0,jQuery("#sesm_quant").val(newQuant),jQuery("#sesm_sku_input").focus()}validate_input(value,type){let regex="";const allowEmpty=!0;switch(type){case"sesm_quant":regex=/^[0-9\.,]{1,}$/g;break;case"sesm_price_reg":case"sesm_price_sale":regex=/^[0-9\.,]{1,}$/g}return!!sesmScripts.empty(value)||!sesmScripts.empty(regex)&&null!==regex.exec(value)}show_input_error(id){let message="";switch(id){case"sesm_quant":message=__("The Quantity contains invalid characters. Only 0-9, comma (,) and period (.) are allowed","super-easy-stock-manager");break;case"sesm_price_reg":case"sesm_price_sale":message=__("The Price contains invalid characters. Only 0-9, comma (,) and period (.) are allowed","super-easy-stock-manager")}if(sesmScripts.empty(message))return!1;const tooltip=sesmScripts.template.apply_template(sesmScripts.template.loaded_templates.errortooltip,{error:message,id:id});0===jQuery("#input-error-"+id).length&&jQuery("#"+id).before(tooltip)}remove_input_errors(item=".input-error-field"){jQuery("#sesm_container "+item).remove()}empty(value){return null===value||(void 0===value||0===value.length)}}const{__:__,_x:_x,_n:_n,_nx:_nx}=wp.i18n,sesmScripts=new SesmMain;sesmScripts.construct();
     1"use strict";class SesmMain{sesm_do="";field_names={};scanner={};version="1.3.6";construct(){jQuery(document).ready((async function(){if(1!==jQuery("#sesm_container").length)return!1;if(await import("./modules/ajax.js").then(module=>{sesmScripts.ajax=new module.SesmAjax}),await import("./modules/template.js").then(module=>{sesmScripts.template=new module.SesmTemplate}),await sesmScripts.template.load_default_templates(),sesmScripts.load_field_names(),sesmScripts.add_event_listener(),sesmScripts.activate_sesm(),!sesmScripts.is_mobile()){let autofocus=setInterval((function(){"sesm_quant"!==document.activeElement.id&&"sesm_price_reg"!==document.activeElement.id&&"sesm_price_sale"!==document.activeElement.id&&jQuery("#sesm_sku_input").focus()}),2e3)}}))}load_field_names(){this.field_names.price_title=__("Price","super-easy-stock-manager"),this.field_names.weight_title=__("Weight","super-easy-stock-manager"),this.field_names.quantity_title=__("Quantity","super-easy-stock-manager"),this.field_names.sku_title=__("SKU","super-easy-stock-manager"),this.field_names.iconclass=""}is_mobile(){return jQuery(window).width()<500||!!/Mobi|Android/i.test(navigator.userAgent)}add_event_listener(){jQuery("#sesm_buttons button").click((function(item){switch(sesmScripts.sesm_do=jQuery(item.currentTarget).data("do"),jQuery("#sesm_input .quant_flex_group").hide(),jQuery("#sesm_input .price_flex_group").hide(),jQuery("#sesm_buttons button.button-active").removeClass("button-active"),jQuery("#sesm_sku_input").slideDown("fast"),jQuery("#sesm_container #selection-indicator").slideDown("fast"),jQuery(item.currentTarget).addClass("button-active"),sesmScripts.is_mobile()?sesmScripts.show_scan_container():jQuery("#sesm_sku_input").focus(),sesmScripts.move_selection_indicator(),sesmScripts.sesm_do){case"add_quantities":jQuery(".sesm_options .quant_flex_group").slideDown("fast");break;case"update_price":jQuery(".sesm_options .price_flex_group").slideDown("fast")}})),jQuery("#scan-button").click(()=>{jQuery("#scan-button").hide(),jQuery("#scan-button-active").show(),sesmScripts.scanner=new Html5QrcodeScanner("scanner-container",{fps:10,qrbox:{width:250,height:250},useBarCodeDetectorIfSupported:!0,rememberLastUsedCamera:!0,showTorchButtonIfSupported:!0,defaultZoomValueIfSupported:2}),sesmScripts.scanner.render(sesmScripts.onScanSuccess,sesmScripts.onScanFailure)}),jQuery("#scan-button-active").click(()=>{jQuery("#scan-button").show(),jQuery("#scan-button-active").hide(),sesmScripts.scanner.clear()}),jQuery(document).on("keyup",(async function(s){13==s.which&&sesmScripts.fire_ajax()})),jQuery("#add_quant_btn").click((function(){sesmScripts.changeQuantity(!0)})),jQuery("#remove_quant_btn").click((function(){sesmScripts.changeQuantity(!1)})),jQuery("#sesm_container input").keyup(e=>{if(9===e.which||16===e.which||17===e.which)return;const value=e.currentTarget.value,id=e.currentTarget.id;sesmScripts.validate_input(value,id)?sesmScripts.remove_input_errors("#input-error-"+id):sesmScripts.show_input_error(id)}),jQuery(window).resize(()=>{sesmScripts.move_selection_indicator(0),sesmScripts.is_mobile()&&jQuery("#sesm_sku_input").attr("placeholder",__("Input SKU","super-easy-stock-manager"))})}async fire_ajax(){const ajaxResult=await sesmScripts.ajax.do_ajax();sesmScripts.empty(ajaxResult)?console.log("Failed to add to history: "+ajaxResult):sesmScripts.addToHistory(jQuery.parseJSON(ajaxResult))}onScanSuccess(code){if(sesmScripts.empty(code))return!1;jQuery("#sesm_sku_input").val(code),sesmScripts.scanner.clear(),jQuery("#scan-button").show(),jQuery("#scan-button-active").hide(),sesmScripts.fire_ajax(),console.log(code)}onScanFailure(message){console.log(message)}show_scan_container(){"flex"!==jQuery("#mobile-scan-container").css("display")&&(jQuery("#mobile-scan-container").css("display","flex"),jQuery("#mobile-scan-container").css("bottom",-jQuery("#mobile-scan-container").height()),jQuery("#mobile-scan-container").animate({bottom:0},200))}activate_sesm(){jQuery("#sesm_buttons").slideDown("fast")}move_selection_indicator(animationDuration=200){if(0===jQuery("#sesm_buttons .button-active").length)return;const activePosition=jQuery("#sesm_buttons .button-active")[0].offsetLeft,activeCenter=jQuery("#sesm_buttons .button-active").width()/2,padding=Number.parseInt(jQuery("#sesm_container").css("padding-left")),finalLeft=activePosition-padding+activeCenter;jQuery("#selection-indicator")[0].offsetLeft===padding&&(animationDuration=0,jQuery("#selection-indicator").animate({opacity:1},animationDuration)),jQuery("#selection-indicator").animate({left:finalLeft},animationDuration)}addToHistory(jsonData){let template=this.get_template_by_state(jsonData.template);this.empty(template)&&jQuery("#sesm_history").prepend(__(`Template "${jsonData.template}" not loaded`,"super-easy-stock-manager")),this.set_icon_class(jsonData.template);const attr=this.format_attributes(jsonData);this.empty(attr)||(jsonData.attributes=attr),jQuery.each(jsonData,(function(key,value){value=sesmScripts.format_value(key,value,jsonData),template=template.replaceAll("{{"+key+"}}",value)})),jQuery.each(this.field_names,(function(key,value){value=sesmScripts.format_value(key,value),template=template.replaceAll("{{"+key+"}}",value)})),jQuery("#sesm_history").addClass("active"),jQuery("#sesm_history").prepend(template),jQuery("#sesm_history article").first().animate({opacity:1,height:"100%"},500)}get_template_by_state(template){switch(template){case"error":return sesmScripts.template.loaded_templates.error;case"updateStock":return sesmScripts.template.loaded_templates.updatestock;case"updatePrice":return sesmScripts.template.loaded_templates.updateprice;default:return sesmScripts.template.loaded_templates.item}}set_icon_class(template){let classname="";switch(template){case"get":classname="fas fa-question";break;case"updateStock":classname="fas fa-box-open";break;case"updatePrice":classname="far fa-money-bill-alt"}this.field_names.iconclass=classname}format_attributes(jsonData){return this.empty(jsonData.attributes)?"":jsonData.attributes.replace(", ","<br/>")}format_value(fieldName,value,jsonData){switch(fieldName){case"stock_quantity":const number=parseInt(value);return number<1?"<span class='red'>"+number+"</span>":value;case"regular_price":return jsonData.sale_price?'<span class="strikethrough">'+value+" "+jsonData.currency+"</span>":value+" "+jsonData.currency;case"sale_price":return jsonData.sale_price?value+" "+jsonData.currency:"";case"manage_stock":return!1!==value?"":__("Stock management got activated","super-easy-stock-manager");case"to_regular":return sesmScripts.format_price_change(jsonData.from_regular,jsonData.to_regular,jsonData,fieldName);case"to_sale":return sesmScripts.format_price_change(jsonData.from_sale,jsonData.to_sale,jsonData,fieldName);case"product_variations":const list=sesmScripts.format_product_variations(jsonData.product_variations),title=__("Other variants of this product","super-easy-stock-manager");return this.empty(list)?"":`<details><summary>${title}</summary><ul>${list}</ul></details>`;default:return value}}format_price_change(fromPrice,toPrice,jsonData,fieldName){const priceLength=(jsonData.from_regular+jsonData.to_regular+jsonData.currency).length,priceLengthSale=(jsonData.from_sale+jsonData.to_sale+jsonData.currency).length,priceNotice="to_regular"===fieldName?jsonData.regular_notice:jsonData.sale_notice;if(!sesmScripts.empty(priceNotice))return'<div class="info-text">'+priceNotice+"</div>";if(fromPrice===toPrice)return"";if(sesmScripts.empty(toPrice))return"";const classLongContent=priceLength+priceLengthSale>7||jsonData.to_sale>0?"content-long":"",isSingleRegularClass=0===jsonData.to_sale?"single":"",isSingleSaleClass=0===jsonData.to_regular?"single":"";return"to_regular"===fieldName?'<div class="'+classLongContent+" "+isSingleRegularClass+'"><span class="from_price strikethrough">'+fromPrice+" "+jsonData.currency+'</span><span class="to_price">'+toPrice+" "+jsonData.currency+"</span></div>":'<div class="'+classLongContent+" "+isSingleSaleClass+'"><span class="from_price strikethrough">'+fromPrice+" "+jsonData.currency+'</span><span class="to_price">'+toPrice+" "+jsonData.currency+"</span></div>"}format_product_variations(variations){let variationsList="";for(let key in variations)if(variations.hasOwnProperty(key)){const attributes=sesmScripts.format_attributes(variations[key]),stock=variations[key].stock;variationsList+=`<li><span>${attributes}</span><span>${stock}</span></li>`}return variationsList}changeQuantity(add){const quant=this.empty(jQuery("#sesm_quant").val())?0:parseInt(jQuery("#sesm_quant").val());let newQuant=0;newQuant=!0===add?quant+1==0?1:quant+1:quant-1==0?-1:quant-1,newQuant=Number.isInteger(newQuant)?newQuant:0,jQuery("#sesm_quant").val(newQuant),jQuery("#sesm_sku_input").focus()}validate_input(value,type){let regex="";const allowEmpty=!0;switch(type){case"sesm_quant":regex=/^[0-9\.,]{1,}$/g;break;case"sesm_price_reg":case"sesm_price_sale":regex=/^[0-9\.,]{1,}$/g}return!!sesmScripts.empty(value)||!sesmScripts.empty(regex)&&null!==regex.exec(value)}show_input_error(id){let message="";switch(id){case"sesm_quant":message=__("The Quantity contains invalid characters. Only 0-9, comma (,) and period (.) are allowed","super-easy-stock-manager");break;case"sesm_price_reg":case"sesm_price_sale":message=__("The Price contains invalid characters. Only 0-9, comma (,) and period (.) are allowed","super-easy-stock-manager")}if(sesmScripts.empty(message))return!1;const tooltip=sesmScripts.template.apply_template(sesmScripts.template.loaded_templates.errortooltip,{error:message,id:id});0===jQuery("#input-error-"+id).length&&jQuery("#"+id).before(tooltip)}remove_input_errors(item=".input-error-field"){jQuery("#sesm_container "+item).remove()}empty(value){return null===value||(void 0===value||0===value.length)}}const{__:__,_x:_x,_n:_n,_nx:_nx}=wp.i18n,sesmScripts=new SesmMain;sesmScripts.construct();
  • super-easy-stock-manager/trunk/style/sesm-main.css

    r2827548 r3443355  
    77  --sesm-button-color: rgb(255, 182, 0);
    88  --sesm-button-text-color: rgb(0, 0, 0);
     9  --sesm-button-text-color-disabled: rgb(117, 117, 117);
    910  --sesm-button-border: rgb(0 0 0);
    1011  --sesm-box-border: rgb(189, 189, 189);
     
    1213  --sesm-border-radius: 5px;
    1314  --sesm-error-color: rgb(255, 0, 0);
     15  --sesm-scan-container-height: 80px;
     16  --sesm-white: white;
    1417}
    1518
     
    3639  }
    3740}
    38 
    39 #sesm_container {
    40   padding: 1rem;
     41body main #sesm_container {
     42  padding: 1em;
     43  font-size: 16px;
     44  color: var(--sesm-button-text-color);
     45  position: relative;
     46  margin-bottom: calc(var(--sesm-scan-container-height) + 2rem);
     47}
     48body main #sesm_container #selection-indicator {
     49  display: block;
     50  width: 4px;
     51  height: 1.55em;
     52  background-color: var(--sesm-button-border);
     53  left: 0;
     54  top: 0;
     55  opacity: 0;
     56  position: relative;
     57}
     58body main #sesm_container #mobile-scan-container {
     59  width: 100%;
     60  height: var(--sesm-scan-container-height);
     61  position: fixed;
     62  bottom: 0;
     63  left: 0;
     64  display: flex;
     65  justify-content: center;
     66  align-items: center;
     67  background-color: var(--sesm-button-color);
     68  display: none;
     69}
     70body main #sesm_container #mobile-scan-container #scan-button-active {
     71  display: none;
     72}
     73body main #sesm_container #mobile-scan-container .scan-button-style {
     74  display: flex;
     75  justify-content: center;
     76  align-items: center;
     77  flex-direction: row;
     78  border: 1px solid var(--sesm-button-border);
     79  cursor: pointer;
     80  width: 4em;
     81  height: 1.5em;
     82  font-size: 2em;
     83  gap: 0.25em;
     84  background-color: var(--sesm-button-color);
     85  border-radius: 1em;
     86}
     87body main #sesm_container #mobile-scan-container #scanner-container {
     88  position: absolute !important;
     89  left: 0;
     90  display: block;
     91  width: 100%;
     92  bottom: var(--sesm-scan-container-height);
     93  background-color: var(--sesm-button-color);
     94  border: none !important;
     95  /* Style of the camera interface*/
     96}
     97body main #sesm_container #mobile-scan-container #scanner-container #scanner-container__dashboard_section_csr {
     98  height: 2.5em;
     99  color: transparent;
     100  /* Workaround to hide the camera count*/
     101}
     102body main #sesm_container #mobile-scan-container #scanner-container #html5-qrcode-anchor-scan-type-change {
     103  display: none !important;
     104}
     105body main #sesm_container #mobile-scan-container #scanner-container #html5-qrcode-button-camera-start,
     106body main #sesm_container #mobile-scan-container #scanner-container #html5-qrcode-button-camera-stop {
     107  position: absolute;
     108  right: 4%;
     109  width: 45%;
     110  height: 3em;
     111  border-radius: 2em;
     112  background-color: var(--sesm-button-color);
     113  border: solid 1px var(--sesm-button-border);
     114  color: var(--sesm-button-text-color);
     115  font-size: 1.2em;
     116}
     117body main #sesm_container #mobile-scan-container #scanner-container #html5-qrcode-select-camera {
     118  position: absolute;
     119  left: 4%;
     120  width: 45%;
     121  height: 3em;
     122  border-radius: 2em;
     123  background-color: var(--sesm-button-color);
     124  border: solid 1px var(--sesm-button-border);
     125  color: var(--sesm-button-text-color);
     126  font-size: 1.2em;
     127  padding-left: 1em;
     128}
     129body main #sesm_container #mobile-scan-container #scanner-container #html5-qrcode-select-camera:disabled {
     130  color: var(--sesm-button-text-color-disabled);
     131  border: solid 1px var(--sesm-button-text-color-disabled);
    41132}
    42133
     
    44135  display: grid;
    45136  grid-template-columns: auto auto auto;
    46   column-gap: 3em;
    47   justify-content: center;
    48   padding-bottom: 1.5rem;
    49 }
    50 
     137  -moz-column-gap: 3em;
     138       column-gap: 3em;
     139  justify-content: center;
     140  padding-bottom: 0;
     141}
    51142#sesm_buttons > button {
    52   font-size: 3rem;
    53   width: 6.5rem;
    54   height: 6.5rem;
     143  font-size: 2em;
     144  width: 3em;
     145  height: 3em;
    55146  border-radius: 50%;
    56147  background-color: var(--sesm-button-color);
    57   border: solid 1px var(--sesm-button-border);
     148  border: solid 2px var(--sesm-button-border);
    58149  position: relative;
    59150  cursor: pointer;
    60 }
    61 
    62 #sesm_buttons #selection-indicator {
    63   display: none;
    64   width: 0.2rem;
    65   height: 2rem;
    66   position: absolute;
    67   background-color: var(--sesm-button-border);
    68   left: 2.9rem;
    69   top: 6.2rem;
    70   z-index: -1;
     151  padding: 0;
    71152}
    72153
     
    75156  margin: 0 auto;
    76157}
    77 
    78158#sesm_input .sesm_options > div {
    79   margin-bottom: 1rem;
    80 }
    81 
     159  margin-bottom: 1em;
     160}
     161#sesm_input .sesm_options .input-error-field {
     162  position: absolute;
     163  width: 100%;
     164  bottom: 4em;
     165  display: flex;
     166  align-items: center;
     167  justify-content: center;
     168  font-size: 1em;
     169  color: black;
     170}
     171#sesm_input .sesm_options .input-error-field .error-message {
     172  background-color: var(--sesm-white);
     173  border: 2px solid var(--sesm-error-color);
     174  padding: 1em;
     175  border-radius: var(--sesm-border-radius);
     176  text-align: center;
     177  width: 80%;
     178}
     179#sesm_input .sesm_options .input-error-field::after {
     180  content: "";
     181  background-color: var(--sesm-error-color);
     182  rotate: 45deg;
     183  width: 1em;
     184  height: 1em;
     185  display: block;
     186  position: absolute;
     187  bottom: -0.5em;
     188  z-index: -1;
     189  left: 50%;
     190}
    82191#sesm_input .price_flex_group > div {
    83192  display: flex;
     
    85194  text-align: center;
    86195  width: 50%;
    87 }
    88 
     196  position: relative;
     197}
    89198#sesm_input .price_flex_group {
    90199  display: flex;
    91   gap: 1rem;
     200  gap: 1em;
    92201  justify-content: space-between;
    93 }
    94 
     202  position: relative;
     203}
    95204#sesm_input input {
    96205  width: 99%;
    97   height: 2rem;
     206  height: 2.5em;
    98207  border-radius: var(--sesm-border-radius);
    99208  text-align: center;
    100   font-size: 1.2rem;
    101 }
    102 
     209  font-size: 1.2em;
     210  border: 1px solid var(--sesm-button-border);
     211  box-shadow: inset 1px 2px 7px rgba(0, 0, 0, 0.167);
     212}
    103213#sesm_input input:focus-visible {
    104214  outline-color: var(--sesm-button-color);
    105215  outline-style: solid;
    106   outline-width: 0.2rem;
     216  outline-width: 0.2em;
    107217  outline-offset: -3px;
    108218}
    109 
    110219#sesm_input #sesm_sku_input {
    111   margin-bottom: 1rem;
    112 }
    113 
     220  margin-bottom: 1em;
     221  width: 100%;
     222}
    114223#sesm_input #sesm_sku_input_loader.active {
    115224  display: block;
    116225  background-color: var(--sesm-button-color);
    117   height: 0.5rem;
     226  height: 0.5em;
    118227  width: 0%;
    119228  left: 0%;
    120229  position: relative;
    121   top: -1.3rem;
     230  top: -1.3em;
    122231  animation: bounce 3s;
    123 }
    124 
     232  animation-iteration-count: 100;
     233}
    125234#sesm_input .quant_flex_group {
    126235  display: flex;
    127236  justify-content: space-between;
    128   gap: 0.5rem;
    129 }
    130 
     237  gap: 0.5em;
     238  position: relative;
     239}
    131240#sesm_input .quant_flex_group .options_button {
    132   font-size: 1rem;
    133   width: 3em;
     241  font-size: 1em;
     242  min-width: 3em;
     243  min-height: 3em;
     244  padding: 0;
    134245  border-radius: var(--sesm-border-radius);
    135246  background-color: var(--sesm-button-color);
    136247  border: solid 1px var(--sesm-button-border);
    137 }
    138 
     248  cursor: pointer;
     249}
    139250#sesm_input .sesm_label.add_quantities {
    140251  display: block;
     
    148259  gap: 1em;
    149260}
    150 
    151261#sesm_history dl {
    152262  margin: 0;
     
    154264  flex-direction: column;
    155265}
    156 
    157266#sesm_history dt {
    158267  font-weight: bold;
    159268}
    160 
    161269#sesm_history .content > dl:first-child() {
    162270  margin-bottom: 0;
    163271}
    164 
    165272#sesm_history .content > dl:last-child() {
    166273  margin-top: 0;
    167274}
    168 
    169275#sesm_history dd {
    170   margin-left: 0;
    171 }
    172 
     276  margin: 0;
     277}
     278#sesm_history .meta-block > * {
     279  margin-bottom: 0.25em;
     280}
    173281#sesm_history .content .two-column-grid {
    174282  display: grid;
    175283  grid-template-columns: 1fr 1fr;
    176284}
    177 
    178285#sesm_history .content .two-column-grid dl:last-child {
    179286  text-align: right;
    180287}
    181 
    182 #sesm_history h2 {
    183   font-size: 1.5rem;
     288#sesm_history .content {
     289  min-height: 19em;
     290  display: flex;
     291  flex-direction: column;
     292  justify-content: space-between;
     293}
     294#sesm_history .content h2 {
     295  font-size: 1.5em;
     296  min-height: 3em;
     297  font-weight: bold;
    184298  margin-top: 0;
    185299  margin-bottom: 0;
    186 }
    187 
    188 #sesm_history h3 {
    189   margin-top: 0.2rem;
    190   margin-bottom: 0.1rem;
    191   font-size: 1rem;
    192 }
    193 
    194 #sesm_history h4 {
    195   font-size: 1.1rem;
    196 }
    197 
    198 #sesm_history h4.attr {
    199   font-size: 1rem;
    200   min-height: 3.5rem;
    201 }
    202 
     300  color: var(--sesm-button-text-color);
     301  word-break: break-word;
     302}
     303#sesm_history .content h3 {
     304  margin-top: 0.2em;
     305  margin-bottom: 0.1em;
     306  font-size: 1em;
     307  font-weight: bold;
     308  color: var(--sesm-button-text-color);
     309  word-break: break-word;
     310}
     311#sesm_history .content h4 {
     312  font-size: 1.1em;
     313  color: var(--sesm-button-text-color);
     314  word-break: break-word;
     315}
     316#sesm_history .content h4.attr {
     317  font-size: 1em;
     318  font-weight: normal;
     319  margin: 0;
     320}
     321#sesm_history .content h4.description {
     322  margin: 0;
     323}
    203324#sesm_history article {
    204   padding: 0 1.3rem;
     325  padding: 0 1.3em 1.3em 1.3em;
    205326  max-width: 100%;
    206327  position: relative;
     
    209330  background-color: var(--sesm-background);
    210331}
    211 
    212332#sesm_history article.item {
    213333  opacity: 0;
    214334  height: 0%;
    215335}
    216 
    217336#sesm_history article.item .image-con {
    218   height: 5rem;
     337  height: 5em;
    219338  border-radius: var(--sesm-border-radius);
    220339  overflow: hidden;
     
    222341  align-items: center;
    223342  justify-content: center;
    224   margin-top: 1.3rem;
    225 }
    226 
     343  margin-top: 1.3em;
     344}
    227345#sesm_history article.item .image-con img {
    228346  height: 100%;
     
    230348  border-radius: var(--sesm-border-radius);
    231349}
    232 
    233350#sesm_history article.item .strikethrough {
    234351  text-decoration: line-through;
    235   padding-right: 0.5rem;
    236 }
    237 
     352  padding-right: 0.5em;
     353}
    238354#sesm_history article.item.update .text-con {
    239355  display: flex;
     
    242358  text-align: center;
    243359  flex-direction: column;
    244   width: 100%;
     360  width: 60%;
    245361  border-radius: var(--sesm-border-radius);
    246362  border: 1px solid var(--sesm-button-border);
    247   height: 5rem;
    248   margin-top: 1.3rem;
    249 }
    250 
     363  height: 5em;
     364  margin-top: 1.3em;
     365  padding: 0 20%;
     366}
    251367#sesm_history article.item.update.price .big-text {
    252   font-size: 1.5rem;
     368  font-size: 1.5em;
    253369  display: flex;
    254370  flex-direction: column;
    255371  font-weight: bold;
    256372}
    257 
     373#sesm_history article.item.update.price .info-text {
     374  font-size: 0.7em;
     375  font-weight: normal;
     376}
    258377#sesm_history article.item.update.stock .big-text {
    259   font-size: 1.5rem;
    260 }
    261 
    262 #sesm_history article.item.update.price .big-text .content-long,
    263 #sesm_history article.item.update.stock .big-text .content-long {
    264   font-size: 1.2rem;
    265 }
    266 
    267 #sesm_history article.item.update .big-text .single {
    268   display: flex;
    269   flex-direction: column;
    270 }
    271 
    272 #sesm_history article.item.update .big-text .single .strikethrough {
     378  font-size: 1.5em;
     379}
     380#sesm_history article.item.update.price .big-text .content-long, #sesm_history article.item.update.stock .big-text .content-long {
     381  font-size: 0.8em;
     382}
     383#sesm_history article.item.update.price .big-text .single, #sesm_history article.item.update.stock .big-text .single {
     384  display: flex;
     385  flex-direction: column;
     386  font-size: 1.2em;
     387}
     388#sesm_history article.item.update.price .big-text .single .strikethrough, #sesm_history article.item.update.stock .big-text .single .strikethrough {
    273389  padding-right: 0;
    274390}
    275 
    276391#sesm_history article.item.error .text-con {
    277392  width: 90%;
    278393  border-radius: var(--sesm-border-radius);
    279394  border: 1px solid var(--sesm-button-border);
    280   height: 5rem;
    281   display: flex;
    282   justify-content: center;
    283   align-items: center;
    284   margin-bottom: 1rem;
     395  height: 5em;
     396  display: flex;
     397  justify-content: center;
     398  align-items: center;
     399  margin-bottom: 1em;
    285400  margin-left: 5%;
    286401  margin-right: 5%;
    287   margin-top: 5%;
    288 }
    289 
     402  margin-top: 1em;
     403}
    290404#sesm_history article.item.error .title {
    291   font-size: 2rem;
    292 }
    293 
    294 #sesm_history article .content {
    295   min-height: 19rem;
    296 }
    297 
     405  font-size: 2em;
     406}
     407#sesm_history article .children-block summary {
     408  font-weight: bold;
     409  font-size: 1rem;
     410  cursor: pointer;
     411}
     412#sesm_history article .children-block ul {
     413  list-style-type: disc;
     414}
     415#sesm_history article .children-block li {
     416  display: flex;
     417  justify-content: space-between;
     418  margin-bottom: 0.5em;
     419  align-items: end;
     420  border-bottom: 1px solid var(--sesm-button-color);
     421}
     422#sesm_history article:not(.error) .icon i:hover::before {
     423  content: "\f044";
     424  font-weight: 700;
     425}
    298426#sesm_history .icon {
    299427  display: flex;
    300428  justify-content: center;
     429  align-items: center;
    301430  position: absolute;
    302   right: 0.5rem;
    303   top: 0.5rem;
    304   padding: 0.5rem;
    305   height: 2rem;
    306   width: 2rem;
    307   font-size: 2rem;
    308   border-radius: var(--sesm-border-radius);
    309   background-color: var(--sesm-button-color);
     431  right: 0.2em;
     432  top: 0.2em;
     433  padding: 0.25em;
     434  height: 2em;
     435  width: 2em;
     436  font-size: 2em;
     437  border-radius: var(--sesm-border-radius);
     438  background-color: var(--sesm-button-color);
     439  height: 1.5em;
     440  width: 1.5em;
     441}
     442#sesm_history .icon i {
     443  font-size: 1em;
     444  color: var(--sesm-button-text-color);
    310445}
    311446
     
    316451  }
    317452  #sesm_buttons {
    318     gap: 1.5rem;
     453    gap: 1.5em;
    319454  }
    320455  #sesm_buttons > button {
    321     width: 4rem;
    322     height: 4rem;
    323     font-size: 2rem;
     456    width: 2em;
     457    height: 2em;
     458    font-size: 2em;
     459    border-width: 1px;
     460  }
     461  #sesm_input input {
     462    height: 2em;
    324463  }
    325464  #sesm_input .sesm_options {
    326465    width: 100%;
    327466  }
    328   #sesm_buttons #selection-indicator {
    329     left: 1.7rem;
    330     top: 3.5rem;
    331   }
    332 }
    333 
     467  #sesm_input .sesm_options .quant_flex_group .options_button {
     468    min-width: 2.5em;
     469    min-height: 2.5em;
     470  }
     471  #sesm_container #selection-indicator {
     472    height: 1em;
     473  }
     474}
    334475@media screen and (min-width: 501px) and (max-width: 850px) {
    335476  #sesm_history {
     
    337478    grid-template-columns: 1fr 1fr;
    338479  }
    339 }
    340 /*# sourceMappingURL=sesm-main.css.map */
     480}/*# sourceMappingURL=sesm-main.css.map */
  • super-easy-stock-manager/trunk/style/sesm-main.css.map

    r2827548 r3443355  
    1 {
    2     "version": 3,
    3     "mappings": "AAAA;;;;EAIE;AAEF,AAAA,IAAI,CAAC;EAED,mBAAmB,CAAA,iBAAC;EACpB,wBAAwB,CAAA,aAAC;EACzB,oBAAoB,CAAA,WAAC;EACrB,iBAAiB,CAAA,mBAAC;EAClB,iBAAiB,CAAA,wBAAC;EAClB,oBAAoB,CAAA,IAAC;EACrB,kBAAkB,CAAA,eAAC;CACtB;;AAED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AAE;EAChB,UAAU,EAAE,EAAE;CACjB;;AApJb,AAsJY,aAtJC,CA6DT,OAAO,AA0EF,KAAK,AAAA,MAAM,CAeR,MAAM,CAAC;EACH,SAAS,EAAE,IAAI;CAClB;;AAxJb,AA2JQ,aA3JK,CA6DT,OAAO,CA8FH,QAAQ,CAAC;EACL,UAAU,EAAE,KAAK;CACpB;;AA7JT,AAkKI,aAlKS,CAkKT,KAAK,CAAC;EACF,OAAO,EAAE,IAAI;EACb,eAAe,EAAE,MAAM;EACvB,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,MAAM;EACb,GAAG,EAAE,MAAM;EACX,OAAO,EAAE,MAAM;EACf,MAAM,EAAE,IAAI;EACZ,KAAK,EAAE,IAAI;EACX,SAAS,EAAE,IAAI;EACf,aAAa,EAAE,yBAAyB;EACxC,gBAAgB,EAAE,wBAAwB;CAC7C;;AAGL,MAAM,CAAC,MAAM,MAAM,SAAS,EAAE,KAAK;EAC/B,AAAA,aAAa,CAAC;IACV,OAAO,EAAE,IAAI;IACb,qBAAqB,EAAE,GAAG;GAC7B;EAED,AAAA,aAAa,CAAC;IACV,GAAG,EAAE,MAAM;GACd;EAED,AAAA,aAAa,GAAC,MAAM,CAAC;IACjB,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,IAAI;GAClB;EAED,AAAA,WAAW,CAAC,aAAa,CAAC;IACtB,KAAK,EAAE,IAAI;GACd;EAED,AAAA,aAAa,CAAC,oBAAoB,CAAC;IAC/B,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,MAAM;GACd;;;AAIL,MAAM,CAAC,MAAM,MAAM,SAAS,EAAE,KAAK,OAAO,SAAS,EAAE,KAAK;EACtD,AAAA,aAAa,CAAC;IACV,OAAO,EAAE,IAAI;IACb,qBAAqB,EAAE,OAAO;GACjC",
    4     "sources": [
    5         "sesm-main.scss"
    6     ],
    7     "names": [],
    8     "file": "sesm-main.css"
    9 }
     1{"version":3,"sources":["sesm-main.scss","sesm-main.css"],"names":[],"mappings":"AAAA;;;;CAAA;AAMA;EAEI,qCAAA;EACA,sCAAA;EACA,qDAAA;EACA,gCAAA;EACA,qCAAA;EACA,0CAAA;EACA,yBAAA;EACA,kCAAA;EACA,kCAAA;EACA,mBAAA;ACDJ;;ADMA;EACI;IACI,SAAA;IACA,OAAA;ECHN;EDME;IACI,WAAA;IACA,OAAA;ECJN;EDOE;IACI,SAAA;IACA,UAAA;ECLN;EDQE;IACI,WAAA;IACA,QAAA;ECNN;EDSE;IACI,SAAA;IACA,QAAA;ECPN;AACF;ADWA;EACI,YAAA;EACA,eAAA;EACA,oCAAA;EACA,kBAAA;EACA,6DAAA;ACTJ;ADWI;EACI,cAAA;EACA,UAAA;EACA,cAAA;EACA,2CAAA;EACA,OAAA;EACA,MAAA;EACA,UAAA;EACA,kBAAA;ACTR;ADYI;EACI,WAAA;EACA,yCAAA;EACA,eAAA;EACA,SAAA;EACA,OAAA;EACA,aAAA;EACA,uBAAA;EACA,mBAAA;EACA,0CAAA;EACA,aAAA;ACVR;ADcQ;EACI,aAAA;ACZZ;ADeQ;EACI,aAAA;EACA,uBAAA;EACA,mBAAA;EACA,mBAAA;EACA,2CAAA;EACA,eAAA;EACA,UAAA;EACA,aAAA;EACA,cAAA;EACA,WAAA;EACA,0CAAA;EACA,kBAAA;ACbZ;ADgBQ;EACI,6BAAA;EACA,OAAA;EACA,cAAA;EACA,WAAA;EACA,yCAAA;EACA,0CAAA;EAGA,uBAAA;EAEA,iCAAA;ACjBZ;ADkBY;EACI,aAAA;EACA,kBAAA;EACA,uCAAA;AChBhB;ADoBY;EACI,wBAAA;AClBhB;ADqBY;;EAEI,kBAAA;EACA,SAAA;EACA,UAAA;EACA,WAAA;EACA,kBAAA;EACA,0CAAA;EACA,2CAAA;EACA,oCAAA;EACA,gBAAA;ACnBhB;ADsBY;EACI,kBAAA;EACA,QAAA;EACA,UAAA;EACA,WAAA;EACA,kBAAA;EACA,0CAAA;EACA,2CA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;ADyEQ;EACI,gBAAA;EACA,aAAA;EACA,sBAAA;EACA,iBAAA;ACvEZ;AD0EQ;EACI,gBAAA;EACA,mBAAA;ACxEZ;AD2EQ;EACI,gBAAA;ACzEZ;AD4EQ;EAEI,gBAAA;AC3EZ;AD8EQ;EAEI,aAAA;EACA,sBAAA;EACA,gBAAA;AC7EZ;AD+EY;EACI,gBAAA;AC7EhB;ADkFY;EACI,UAAA;EACA,wCAAA;EACA,2CAAA;EACA,WAAA;EACA,aAAA;EACA,uBAAA;EACA,mBAAA;EACA,kBAAA;EACA,eAAA;EACA,gBAAA;EACA,eAAA;AChFhB;ADmFY;EACI,cAAA;ACjFhB;ADsFY;EACI,iBAAA;EACA,eAAA;EACA,eAAA;ACpFhB;ADsFY;EACI,qBAAA;ACpFhB;ADsFY;EACI,aAAA;EACA,8BAAA;EACA,oBAAA;EACA,gBAAA;EACA,iDAAA;ACpFhB;AD2FQ;EACI,gBAAA;EACA,gBAAA;ACzFZ;AD6FI;EACI,aAAA;EACA,uBAAA;EACA,mBAAA;EACA,kBAAA;EACA,YAAA;EACA,UAAA;EACA,eAAA;EACA,WAAA;EACA,UAAA;EACA,cAAA;EACA,wCAAA;EACA,0CAAA;EACA,aAAA;EACA,YAAA;AC3FR;AD6FQ;EACI,cAAA;EACA,oCAAA;AC3FZ;;ADoGA;EACI;IACI,aAAA;IACA,0BAAA;ECjGN;EDoGE;IACI,UAAA;EClGN;EDqGE;IACI,UAAA;IACA,WAAA;IACA,cAAA;IACA,iBAAA;ECnGN;EDsGE;IACI,WAAA;ECpGN;EDuGE;IACI,WAAA;ECrGN;EDyGU;IACI,gBAAA;IACA,iBAAA;ECvGd;ED6GE;IACI,WAAA;EC3GN;AACF;AD+GA;EACI;IACI,aAAA;IACA,8BAAA;EC7GN;AACF","file":"sesm-main.css"}
  • super-easy-stock-manager/trunk/style/sesm-main.scss

    r2837173 r3443355  
    4949
    5050
    51 #sesm_container {
     51body main #sesm_container {
    5252    padding: 1em;
    5353    font-size: 16px;
    5454    color: var(--sesm-button-text-color);
    5555    position: relative;
    56     margin-bottom: 3em;
     56    margin-bottom: calc(var(--sesm-scan-container-height) + 2rem);
    5757
    5858    #selection-indicator {
     
    352352        h2 {
    353353            font-size: 1.5em;
    354             height: 3em;
     354            min-height: 3em;
    355355            font-weight: bold;
    356356            margin-top: 0;
     
    364364            margin-bottom: 0.1em;
    365365            font-size: 1em;
    366             font-weight: normal;
     366            font-weight: bold;
    367367            color: var(--sesm-button-text-color);
    368368            word-break: break-word;
     
    387387
    388388    article {
    389         padding: 0 1.3em;
     389        padding: 0 1.3em 1.3em 1.3em;
    390390        max-width: 100%;
    391391        position: relative;
     
    488488        }
    489489
     490        .children-block{
     491            summary{
     492                font-weight: bold;
     493                font-size: 1rem;
     494                cursor: pointer;
     495            }
     496            ul{
     497                list-style-type: disc;
     498            }
     499            li{
     500                display: flex;
     501                justify-content: space-between;
     502                margin-bottom: 0.5em;
     503                align-items: end;
     504                border-bottom: 1px solid var(--sesm-button-color);
     505            }
     506        }
     507
    490508    }
    491509
  • super-easy-stock-manager/trunk/super-easy-stock-manager.php

    r2837173 r3443355  
    44 * Plugin Name: Super Easy Stock Manager
    55 * Description: Stock Management with ease!
    6  * Version: 1.3.6
    7  * Stable tag: 1.3.6
     6 * Version: 1.4.1
     7 * Stable tag: 1.4.1
    88 * Author: Dan's Art
    99 * Author URI: http://dev.dans-art.ch
     
    1717 *
    1818 * Requires at least: 5.4.0
    19  * Tested up to: 6.1.1
     19 * Tested up to: 6.9
     20 * WC requires at least: 4.7.0
     21 * WC tested up to: 10.4.3
     22 * Requires Plugins: woocommerce
    2023 *
    2124 * Text Domain: super-easy-stock-manager
     
    4447define('SESM_MAIN_URL', plugin_dir_url(__FILE__));
    4548
    46 $sesm = new Super_Easy_Stock_Manager();
     49add_action('init', function () {
     50    $sesm = new Super_Easy_Stock_Manager();
     51});
  • super-easy-stock-manager/trunk/templates/frontend/item-update-stock.html

    r2837173 r3443355  
    55    <div class="text-con">
    66        <div class="big-text">
    7             {{from_quant}} <i class="fa-solid fa-arrow-right"></i> {{to_quant}}
     7            {{stock_quantity}}
    88        </div>
    99        <div class="info-text">
  • super-easy-stock-manager/trunk/templates/frontend/item.html

    r2837173 r3443355  
    3232            </dl>
    3333        </div>
     34        <div class="children-block">
     35                {{product_variations}}
     36        </div>
    3437    </div>
    3538
Note: See TracChangeset for help on using the changeset viewer.