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

    Hello,
    since the latest update, the following function no longer works and creates empty single product pages.

    function bt_woocommerce_overview_banner_image()
    {
    global $avia_config;
    if(avia_is_dynamic_template() || is_paged() || is_search() ) return false;

    $image_size = “entry_with_sidebar”;
    $layout = avia_layout_class( ‘main’ , false );
    if($layout == ‘fullsize’) $image_size = ‘entry_without_sidebar’;

    if(is_shop())
    {
    $shop_id = function_exists( ‘wc_get_page_id’ ) ? wc_get_page_id( ‘shop’ ) : woocommerce_get_page_id( ‘shop’ );
    if($shop_id != -1)
    {
    $image = get_the_post_thumbnail($shop_id, $image_size);
    if($image) echo “<div class=’page-thumb’>{$image}</div>”;
    }
    }

    if(is_product_category())
    {
    global $wp_query;
    $image = “”;
    if(isset($wp_query->query_vars[‘taxonomy’]))
    {
    $term = get_term_by( ‘slug’, get_query_var($wp_query->query_vars[‘taxonomy’]), $wp_query->query_vars[‘taxonomy’]);

    if(!empty($term->term_id))
    {
    $attachment_id = get_woocommerce_term_meta($term->term_id, ‘thumbnail_id’);
    $style = get_woocommerce_term_meta($term->term_id, ‘av_cat_styling’);

    if(!empty($attachment_id) && empty($style))
    {
    $image = wp_get_attachment_image( $attachment_id, ‘full’, false, array(‘class’=>’category_thumb’));
    if($image) echo “{$image}”;
    }

    }
    }
    }

    }

    What can we use instead of this function?
    Many greetings

    #1419572

    Please allways use the code tag here on board to post code snippets!
    It is hard to read and to inspect only from text input.
    Often errors occur if wrong quotation marks are set – but with text mode these are transfrered to slanted one – This particular source of error cannot therefore be properly assessed. etc.

    #1419574

    Hi,

    Thank you for the inquiry.

    Would you mind posting the code again on pastebin.com so that we can read it clearly, and provide a link to a product page? Looks like this is a modification for the shop or product banner. Do you remember what was added or modified in the function?

    Best regards,
    Ismael

    #1419680

    Hi Ismael,
    thank you for your answer.
    I posted the function on pastebin.com and sent you the link to the Singple Product Page.
    The function should change the order of the banner, category text and the products.
    Best regards

    • This reply was modified 1 year ago by marcfrey.
    #1419820

    Hi,

    Thank you for the info.

    The code in the pastebin.com looks incomplete, but we managed to find the error in the following line.

    if(avia_is_dynamic_template() || is_paged() || is_search() ) return false;
    

    The function avia_is_dynamic_template is no longer used in the theme. Please try to replace it with:

    if(is_paged() || is_search() ) return false;
    

    Best regards,
    Ismael

    #1419856

    Works great, thank you!

    #1419883

    Hi,
    Glad Ismael could help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Function creates error after update’ is closed to new replies.