Forum Replies Created

Viewing 31 post (of 31 total)
  • Author
    Posts
  • in reply to: WooCommerce Single Product Page Description below #697831

    http://www.anedis.de/cms2/produkt/dsam-2000/

    By now i use the following functions to show the sidebar in woocommerce single-page (code from your support)

    #
    # wrap single product image in an extra div
    #
    
    function avia_add_image_div() {
     echo "<div class='single-product-main-image alpha'>";
    }
    
    function avia_close_image_div() {
     echo "</div>";
    }
    
    #
    # wrap single product summary in an extra div
    #
    
    function avia_add_summary_div() {
     echo "<div class='single-product-summary'>";
    }
    
    function avia_close_summary_div() {
     echo "</div>"; //close out the summary
     get_sidebar();
    }
    
    function avf_product_sidebar_layout_mod($layout){
     if( is_single() )$layout = "sidebar_right";
     return $layout;
    }
    
    add_action('init', 'ava_product_sidebar_mod');
    function ava_product_sidebar_mod() {
     add_action( 'woocommerce_before_single_product_summary', 'avia_add_image_div', 2 );
     add_action( 'woocommerce_before_single_product_summary', 'avia_close_image_div', 20 );
     add_action( 'woocommerce_before_single_product_summary', 'avia_add_summary_div', 25 );
     add_action( 'woocommerce_after_single_product_summary', 'avia_close_summary_div', 3 );
     add_filter( 'avf_product_sidebar_layout', 'avf_product_sidebar_layout_mod', 5);
    }
    • This reply was modified 8 years, 1 month ago by langnaese.
Viewing 31 post (of 31 total)