Support » Plugin: Advanced Woo Labels - Product Labels for WooCommerce » Changing position of the labels after price

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hello,

    Looks like I found the solution for you. Please use following code snippet

    add_filter( 'awl_labels_hooks', 'my_awl_labels_hooks' );
    function my_awl_labels_hooks( $hooks ) {
        $hooks['before_title']['archive'] = array( 'electro_price_html' => array( 'priority' => 10, 'type' => 'filter', 'before' => true ) );
        return $hooks;
    }

    You need to add it somewhere outside the plugins folder. For example, inside functions.php file of your theme or use some plugin for adding code snippets.

    Regards

    Hi @mihail-barinov !
    I’m looking for a way to move the label after Price. Just to the right after Price.
    Like this $10.99 Free Shipping Lable
    I have tried many ways. Nothing has worked.

    Theme – Porto.
    Example Product URL – https://www.amzsupply.com/product/100-pack-dark-purple-flat-poly-mailers-9-x-12-plastic-shipping-bags-2-5-mil-w-peel-seal/
    Thanks in advance

    Plugin Author ILLID

    (@mihail-barinov)

    @magnitu

    Please try to use following code snippets:

    add_filter( 'awl_labels_hooks', 'my_awl_labels_hooks' );
    function my_awl_labels_hooks( $hooks ) {
        $hooks['before_title']['single'] = array( 'woocommerce_single_product_summary' => array( 'priority' => 10 ) );
        return $hooks;
    }
    
    add_action( 'wp_head', 'awl_add_head_styles' );
    function awl_add_head_styles() { ?>
        <style>
            .single-product #content .summary .price {
                display: inline-block;
            }
            .single-product #content .summary .advanced-woo-labels {
                display: inline-flex !important;
                width: auto !important;
                margin: 0px 0 0 5px;
                top: -3px;
            }
        </style>
    <?php }

    You need to add it somewhere outside the plugins folder. For example, inside functions.php file of your theme or use some plugin for adding code snippets.

    Regards

    Hi!

    It worked. I’m very grateful to you.
    I would like to move the label to the right of the price. Screenshot Is this possible?

    And the same thing on the archive pages Screenshot
    Example archive URL https://www.amzsupply.com/brand/amz-supply/

    Appreciate your help.

    Plugin Author ILLID

    (@mihail-barinov)

    Please try to add this additional code:

    add_action( 'wp_head', 'awl_add_head_styles1' );
    function awl_add_head_styles1() { ?>
        <style>
            .single-product #content .entry-summary .price {
                display: inline-block;
            }
            .single-product #content .entry-summary .advanced-woo-labels {
                display: inline-flex !important;
                width: auto !important;
                margin: 0px 0 0 5px;
                top: -3px;
            }
        </style>
    <?php }

    Regards

    Hello!

    Thank you very much.

    Works great on the single product page. But on archive pages, still in before_title. Example Page
    I did try to move it myself, but I couldn’t.
    And yes, I realize it’s the little things and I really appreciate your help.

    Plugin Author ILLID

    (@mihail-barinov)

    For archive pages you will need to use a bit different code.
    Please add this additional code snippet:

    add_filter( 'awl_labels_hooks', 'my_awl_labels_hooks2' );
    function my_awl_labels_hooks2( $hooks ) {
        $hooks['before_title']['archive'] = array( 'woocommerce_after_shop_loop_item_title' => array( 'priority' => 10 ) );
        return $hooks;
    }
    add_action( 'wp_head', 'awl_add_head_styles2' );
    function awl_add_head_styles2() { ?>
        <style>
            ul.products .product-content .price {
                display: inline-block !important;
            }
            ul.products .product-content  .advanced-woo-labels {
                display: inline-flex !important;
                width: auto !important;
                margin: 0px 0 0 5px;
                top: -3px;
            }
        </style>
    <?php }

    Thank you so much!
    It works. I hope it will also be useful to someone

    Plugin Author ILLID

    (@mihail-barinov)

    Glad to help.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Changing position of the labels after price’ is closed to new replies.