Uname:Linux antigravity-cli 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64

Base Dir : /var/www/moonbloom

User : wp-moonbloom


403WebShell
403Webshell
Server IP : 85.155.190.233  /  Your IP : 216.73.216.103
Web Server : nginx/1.24.0
System : Linux antigravity-cli 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User : wp-moonbloom ( 1001)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/moonbloom/wp-content/themes/kadence-child/woocommerce/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/moonbloom/wp-content/themes/kadence-child/woocommerce/functions.php
<?php
// Disable Kadence built-in "Free shipping / Satisfaction Guaranteed / Safe Checkout" blocks
add_filter('theme_mod_product_content_element_extras', function ($value) {
    return ['enabled' => false];
});
add_filter('theme_mod_product_content_element_payments', function ($value) {
    return ['enabled' => false];
});

// Hide SKU / Category / Tags clutter from product summary
remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40);

// Translate WooCommerce UI strings to German (supplement for missing de_DE language pack)
add_filter('gettext', function ($t, $text) {
    static $map = [
        'Add to cart'      => 'In den Warenkorb',
        'Select options'   => 'Optionen wählen',
        'Choose an option' => 'Bitte wählen',
        'Sale!'            => 'Angebot!',
        'Out of stock'     => 'Nicht vorrätig',
        'In stock'         => 'Auf Lager',
    ];
    return $map[$text] ?? $t;
}, 20, 2);

// Demo variants — Lumina Nordic design tokens applied to description blocks.
add_action('wp_enqueue_scripts', function () {
    if (is_product()) {
        wp_enqueue_style(
            'ln-fonts',
            'https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500&family=Be+Vietnam+Pro:wght@400;500;600&display=swap',
            [],
            null
        );
        wp_enqueue_style(
            'mb-demo-variants',
            get_stylesheet_directory_uri() . '/templates/demo-variants.css',
            ['ln-fonts'],
            '1.4.0'
        );
        wp_enqueue_style(
            'mb-related-and-description',
            get_stylesheet_directory_uri() . '/templates/related-and-description.css',
            ['ln-fonts'],
            '1.4.0'
        );
        wp_add_inline_script('jquery', '
            document.addEventListener("DOMContentLoaded", function() {
                document.querySelectorAll(".mb-acc-toggle").forEach(function(btn) {
                    btn.addEventListener("click", function() {
                        var body = btn.nextElementSibling;
                        btn.classList.toggle("open");
                        body.classList.toggle("open");
                    });
                });
            });
        ');
    }
});

// Lumina Nordic product page customization — disabled for factory-default rollback.
// Re-enable layer by layer per site/templates/single-product.php.bak rebuild plan.
// add_action('wp_enqueue_scripts', function () {
//     if (is_product()) {
//         wp_enqueue_style(
//             'mb-product-page',
//             get_stylesheet_directory_uri() . '/templates/product-page.css',
//             [],
//             '1.0.0'
//         );
//         wp_enqueue_style(
//             'be-vietnam-pro',
//             'https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600&display=swap',
//             [],
//             null
//         );
//         wp_enqueue_style(
//             'material-symbols',
//             'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200',
//             [],
//             null
//         );
//     }
// });

// Trust badges — под кнопкой "In den Warenkorb"
add_action('woocommerce_single_product_summary', function () {
    ?>
<div class="mb-trust-wrap">
  <div class="mb-trust-item">
    <svg width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>
    <span><strong>Greenguard Gold</strong> — Schadstoffgepr&uuml;ft &amp; kindersicher</span>
  </div>
  <div class="mb-trust-item">
    <svg width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><rect x="1" y="3" width="15" height="13" rx="1"/><path d="M16 8h4l3 5v3h-7V8z"/><circle cx="5.5" cy="18.5" r="2.5"/><circle cx="18.5" cy="18.5" r="2.5"/></svg>
    <span><strong>Kostenloser Versand</strong> — Innerhalb Deutschlands</span>
  </div>
  <div class="mb-trust-item">
    <svg width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
    <span><strong>Druck &amp; Versand</strong> — Innerhalb von 48 Stunden</span>
  </div>
  <a href="#mb-kalk" class="mb-trust-sample">
    <svg width="15" height="15" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18M9 21V9"/></svg>
    DIN A4 Muster bestellen — Farbe &amp; Material vorab pr&uuml;fen
  </a>
</div>
    <?php
}, 35);

// Wandflächen-Konfigurator — direkt in der Produkt-Summary, unter den Trust Badges
add_action('woocommerce_single_product_summary', function () {
    ?>
<div class="mb-kalk" id="mb-kalk">
  <div class="mb-kalk__header">
    <h4 class="mb-kalk__title">
      <svg width="14" height="14" fill="none" stroke="#B4A68D" stroke-width="2" viewBox="0 0 24 24"><rect x="4" y="2" width="16" height="20" rx="2"/><line x1="8" y1="6" x2="16" y2="6"/><line x1="8" y1="10" x2="16" y2="10"/><line x1="8" y1="14" x2="12" y2="14"/></svg>
      Wandfl&auml;chen- &amp; Gr&ouml;&szlig;enkonfigurator
    </h4>
    <span class="mb-kalk__badge">Rapport: Sto&szlig;-auf-Sto&szlig;</span>
  </div>

  <div class="mb-kalk__inputs">
    <div class="mb-kalk__field">
      <label for="mb-kalk-w">Wandbreite (cm)</label>
      <input type="number" id="mb-kalk-w" min="30" max="2000" value="300">
    </div>
    <div class="mb-kalk__field">
      <label for="mb-kalk-h">Wandh&ouml;he (cm)</label>
      <input type="number" id="mb-kalk-h" min="20" max="600" value="250">
    </div>
  </div>

  <div class="mb-kalk__stats">
    <div>
      <span class="mb-kalk__stat-label">Gesamtfl&auml;che</span>
      <span class="mb-kalk__stat-value" id="mb-k-area">7.50 m&sup2;</span>
    </div>
    <div>
      <span class="mb-kalk__stat-label">Rollenbreite</span>
      <span class="mb-kalk__stat-value">50 cm</span>
    </div>
    <div>
      <span class="mb-kalk__stat-label">Empfohlene Gr&ouml;&szlig;e</span>
      <span class="mb-kalk__stat-value mb-kalk__stat-value--accent" id="mb-k-strips">300&times;250 cm</span>
    </div>
    <div>
      <span class="mb-kalk__stat-label">Format im Shop</span>
      <span class="mb-kalk__stat-value" id="mb-k-rolls">300&times;250 cm</span>
    </div>
  </div>

  <div class="mb-kalk__result">
    <div class="mb-kalk__result-left">
      <span class="mb-kalk__result-label">Endpreis f&uuml;r Ihre Wand</span>
      <span class="mb-kalk__result-sub">Inkl. Zuschnitt &amp; Motiv-Anpassung</span>
      <span class="mb-kalk__result-sub">Inkl. 5&nbsp;cm Sicherheitsmarge f&uuml;r saubere Wandkanten</span>
    </div>
    <div>
      <span class="mb-kalk__price" id="mb-k-price">&euro;219.00</span>
      <span class="mb-kalk__price-ok">&#10003; Gratis Vorab-Layout-Pr&uuml;fung</span>
    </div>
  </div>

  <div class="mb-kalk__note">
    <svg width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><circle cx="12" cy="16" r="1" fill="currentColor"/></svg>
    <span>Alle Bahnen werden nummeriert geliefert. W&auml;hlen Sie im Dropdown die passende Gr&ouml;&szlig;e &mdash; Motive werden auf Bestellung gedruckt.</span>
  </div>
</div>
<script>
(function () {
    var SIZES = [
        [30,  20,  16.50, 'Sampler 30×20 cm'],
        [150, 250, 129.00, '150×250 cm'],
        [200, 250, 159.00, '200×250 cm'],
        [250, 250, 189.00, '250×250 cm'],
        [300, 250, 219.00, '300×250 cm'],
        [350, 250, 249.00, '350×250 cm'],
        [400, 250, 279.00, '400×250 cm'],
        [200, 200, 149.00, '200×200 cm'],
        [300, 300, 239.00, '300×300 cm']
    ];
    function calc() {
        var w = Math.max(1, parseInt(document.getElementById('mb-kalk-w').value) || 300);
        var h = Math.max(1, parseInt(document.getElementById('mb-kalk-h').value) || 250);
        var fits = SIZES.filter(function (s) { return s[0] >= w && s[1] >= h; });
        fits.sort(function (a, b) { return a[2] - b[2]; });
        var m = fits.length ? fits[0] : null;
        document.getElementById('mb-k-area').textContent = ((w * h) / 10000).toFixed(2) + ' m²';
        if (m) {
            document.getElementById('mb-k-strips').textContent = m[3];
            document.getElementById('mb-k-rolls').textContent  = m[0] + '×' + m[1] + ' cm';
            document.getElementById('mb-k-price').textContent  = '€' + m[2].toFixed(2);
            document.getElementById('mb-k-price').style.color  = '';
        } else {
            document.getElementById('mb-k-strips').textContent = 'Sonderanfertigung';
            document.getElementById('mb-k-rolls').textContent  = 'Anfrage nötig';
            document.getElementById('mb-k-price').textContent  = 'Auf Anfrage';
            document.getElementById('mb-k-price').style.color  = '#B4A68D';
        }
    }
    function init() {
        var wEl = document.getElementById('mb-kalk-w');
        var hEl = document.getElementById('mb-kalk-h');
        if (!wEl || !hEl) return;
        wEl.addEventListener('input', calc);
        hEl.addEventListener('input', calc);
        calc();
    }
    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', init);
    } else {
        init();
    }
})();
</script>
    <?php
}, 40);

// Ähnliche Produkte — unter den Tabs, für interne Verlinkung
add_action('woocommerce_after_single_product_summary', function () {
    echo '<div class="mb-related">';
    woocommerce_related_products([
        'posts_per_page' => 3,
        'columns'        => 3,
    ]);
    echo '</div>';
}, 20);

Youez - 2016 - github.com/yon3zu
LinuXploit