PageSourceSearch

https://www.gnhm.gr/wp-content/themes/vg-twig/assets/js/cart-translations.js?ver=1790273615

js gnhm.gr collected 2026-09-24 18:14:59 UTC 1,699 bytes, 52 lines download raw bytes

1(function(wp) {
2    const { select, subscribe } = wp.data;
3    const STORE_MAIN = 'wc/store';
4    const CART_STORE_OLD = 'wc/store/cart';
5    const CHECKOUT_STORE_OLD = 'wc/store/checkout';
6
7    function getCartData() {
8        const storeMain = select(STORE_MAIN);
9        const storeCart = select(CART_STORE_OLD);
10
11        if (storeMain && typeof storeMain.getCart === 'function') {
12            return storeMain.getCart();
13        }
14        if (storeCart && typeof storeCart.getCartData === 'function') {
15            return storeCart.getCartData();
16        }
17        return null;
18    }
19
20    function getCheckoutData() {
21        const storeMain = select(STORE_MAIN);
22        const storeCheckout = select(CHECKOUT_STORE_OLD);
23
24        if (storeMain && typeof storeMain.getCheckout === 'function') {
25            return storeMain.getCheckout();
26        }
27        if (storeCheckout && typeof storeCheckout.getCheckoutData === 'function') {
28            return storeCheckout.getCheckoutData();
29        }
30        return null;
31    }
32
33    function updateLabels() {
34        document.querySelectorAll('.wc-block-components-totals-coupon > .wc-block-components-panel__button').forEach(el => {
35            if (el.textContent.trim() === 'Add coupons') {
36                el.textContent = 'Προσθήκη κουπονιού';
37            }
38        });
39    }
40
41    // Run once on page load
42    document.addEventListener('DOMContentLoaded', updateLabels);
43
44    // Watch for cart or checkout updates
45    // subscribe(() => {
46    //     const cart = getCartData();
47    //     const checkout = getCheckoutData();
48    //     if (cart || checkout) {
49    //         updateLabels();
50    //     }
51    // });
52})(window.wp);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.