Home Forums WoodMart support forum Functions priority backwards

Functions priority backwards

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #264576

    Panosgr
    Participant

    I have set the following to childs functions file to show the sku and the availability in the archive page

    /**  Show SKU in product loop below product thumbnail */
    function custom_after_title() {
    global $product;
    if ( $product->get_sku() ) {
    echo '<div class="sku-archive">Smart Code:'.$product->get_sku().'</div>';
    }
    	else 
    echo '<div class="sku-archive">Smart Code: N/A</div>';}
    add_action( 'woocommerce_after_shop_loop_item_title', 'custom_after_title',10 );
    
    //* Add stock status to archive pages
    function envy_stock_catalog() {
        global $product;
        if ( $product->is_in_stock() ) {
            echo '<div class="stock" >' . $product->get_stock_quantity() . __( ' in stock', 'envy' ) . '</div>';
        } else {
            echo '<div class="out-of-stock" >' . __( 'out of stock', 'envy' ) . '</div>';
        }
    }
    add_action( 'woocommerce_after_shop_loop_item_title', 'envy_stock_catalog',11 );

    It works fine except the priority.
    Upon the code i have inserted in functions it is supposed to show sku first and availability afterwards.
    In the live website it is shown the opposite (first show the availability and afterwards the sku!!!

    #264697

    Hello,

    Please provide your site admin access to the private area.

    Best Regards

    #264701

    Panosgr
    Participant

    Sure, no problem

    #264959

    Hello,

    Please add this code to the Theme Settings > Custom CSS > Global:

    .woodmart-hover-base .wrapp-product-price {
    	flex-direction: column;
    }

    Best Regards

    #264981

    Panosgr
    Participant

    Excellent.
    That did the trick, indeed.
    Thank you.

    #265153

    You are welcome! If you have any questions please feel free to contact us.

    Best Regards

    #367482

    razwan73
    Participant

    Thanks a lot… it helped me a lot…

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Functions priority backwards’ is closed to new replies.