Greasy Fork is available in English.

Shoptet "Zvetseni fontu mnozstvi produktu"

Na stránce s kompletací objednávky zvětší čísla množství produktů a podbarví pole, když je víc než 1ks

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Shoptet "Zvetseni fontu mnozstvi produktu"
// @namespace    mailto:[email protected]
// @version      0.33
// @description  Na stránce s kompletací objednávky zvětší čísla množství produktů a podbarví pole, když je víc než 1ks
// @author       Zuzana Nyiri
// @match        */admin/objednavky-detail/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Najdeme tabulku podle ID
    var table = document.getElementById("orderCompletionTable");
    if (!table) {
        return; // Pokud tabulka neexistuje, nic neděláme
    }

    // Projdeme všechny řádky v těle tabulky (tbody)
    var rows = table.querySelectorAll("tbody tr");
    rows.forEach(function(row) {
        // Zkusíme najít buňku s atributem data-testid="cellCompletionItemAmount"
        var quantityCell = row.querySelector("[data-testid='cellCompletionItemAmount']");
        if (!quantityCell) {
            return;
        }

        var quantityText = quantityCell.innerText.trim();
        var quantity = parseInt(quantityText, 10);

        // Zvýrazníme, pokud je počet větší než 1
        if (quantity > 1) {
            quantityCell.style.backgroundColor = "greenyellow";
        }

        // A nastavíme, aby byl font vždy velký a tučný
        quantityCell.style.fontSize = "large";
        quantityCell.style.fontWeight = "bold";
    });
})();