Plugin Directory

Changeset 3233853


Ignore:
Timestamp:
02/03/2025 10:33:59 AM (12 months ago)
Author:
bandido
Message:

Version 0.1.1

Location:
morkva-flatsome-button-translation
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • morkva-flatsome-button-translation/trunk/mrkv-flatsome-button.php

    r3171805 r3233853  
    44 * Plugin URI: https://morkva.co.ua/
    55 * Description: Enables header buttons string translation. Need flatsome customization services? [email protected]
    6  * Version: 0.1.0
     6 * Version: 0.1.1
    77 * Author: MORKVA
    88 * Text Domain: morkva-flatsome-button-translation
     
    2929        $btn_text_2 = get_theme_mod( 'header_button_2', 'Button 2' );
    3030        pll_register_string('flatsome_button2', $btn_text_2, 'flatsome');
     31        $sale_text = get_theme_mod( 'sale_bubble_text', 'Знижка' );
     32        pll_register_string('sale_bubble_text', $sale_text, 'flatsome');
    3133    }
    3234}
    3335add_action('init', 'mrkv_flatsome_button_for_polylang');
     36
     37add_filter('woocommerce_sale_flash', function($html, $post, $product) {
     38    if (!get_theme_mod('sale_bubble', 1) || !$product->is_on_sale()) {
     39        return $html;
     40    }
     41
     42    $custom_text = pll__( get_theme_mod('sale_bubble_text', 'Sale!') );
     43    $text        = $custom_text ? $custom_text : __( 'Sale!', 'woocommerce' );
     44
     45    if (get_theme_mod('sale_bubble_percentage')) {
     46        $text = flatsome_presentage_bubble($product, $text);
     47    }
     48
     49    $badge_style = get_theme_mod('badge_style', 'default');
     50
     51    return '<div class="callout badge badge-' . esc_attr($badge_style) . '">
     52                <div class="badge-inner secondary on-sale">
     53                    <span class="onsale">' . esc_html($text) . '</span>
     54                </div>
     55            </div>';
     56}, 10, 3);
  • morkva-flatsome-button-translation/trunk/readme.txt

    r3171805 r3233853  
    55Tested up to: 6.6
    66Requires PHP: 7.4
    7 Stable tag: 0.1.0
     7Stable tag: 0.1.1
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1515
    1616Need flatsome customization services? [email protected]
     17
     18= 0.1.1 =
     19* [new] додали можливість перекладу Sale bubble
Note: See TracChangeset for help on using the changeset viewer.