Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #479145

    Hi,

    I’d like to put the related products and “You may also like” section above the tab section. Is there any way to do that in the functions.php of the child theme, so that it is update secure?

    BTW: I use a sidebar on the right.

    Thank you
    Wolfram

    #479494

    Hey gagern!

    Could you provide us with a link to the site in question so that we can take a closer look please?

    Cheers!
    Rikard

    #479519

    Ok, I provide the link in the private content…

    #479737

    Just to make it clear: I have no tabs on my product page. But nevertheless the “You may also like”/Upsells section should be above the position where the tabs normally are ;-) It should be on the left of the sidebar, not under the sidebar.

    Thank you ;-)

    #481739

    Hey!

    Can you post a screenshot/mockup of what would you want to achieve?

    Best regards,
    Josue

    #482045

    Hi Josue,

    now it’s like this: now

    And that’s how it should look like: then

    Any help appreciated ;-)

    Best regards
    Wolfram

    #482354

    Hi,

    Can you please create us a WordPress administrator account? post it here as a private reply.

    Regards,
    Josue

    #482660

    Hi Josue,

    pls. see private content

    Regards
    Wolfram

    #483747

    Any idea?

    #483781

    I solved it with this code in the functions.php. The upsells/”you may also like” section than is in a tab:

    /* Upsell Hook */
    
    // Remove the WooCommerce Upsell hook
    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
    
    // Add a custom action to display Upsells
    add_action( 'growdev_after_single_product_summary', 'woocommerce_upsell_display', 15 );
    
    if ( ! function_exists( 'woocommerce_output_upsells' ) ) {
    	function woocommerce_output_upsells() {
    	    woocommerce_upsell_display( 10,5 ); // Display 10 products in rows of 5
    	}
    }
    
    // A filter to add a custom tab
    add_filter('woocommerce_product_tabs','growdev_add_tab');
    
    // Callback for add_filter that defines the filter. You can change 'New tab' to the desired
    // tab title
    // growdev_custom_tab is the function callback
    function growdev_add_tab( $tabs ) {
    	$tabs['upsell_tab'] = array( 'title' => 'Passende Produkte:', 'priority' => 29,
    								 'callback' => 'growdev_custom_tab');
    	return $tabs;
    }
    
    // The function callback for the custom tab.
    // This does the display upsells action inside of the tab
    function growdev_custom_tab( $key, $tab ) {
    
    	do_action('growdev_after_single_product_summary');
    
    }

    Little problem: the tab title stays there even if there is no upsell product. Do you have a solution for that?

    #484243

    Hey!

    Can you post a link to a Product where this (no upsell product) occurs?

    Cheers!
    Josue

    #496370

    Hi Josue,

    sorry for the late answer. You’ll find the link in the private content.

    Regards
    Wolfram

    #496767

    Hey!

    Try adding this code to the Quick CSS:

    #tab-upsell_tab:empty {
        background-color: white;
        height: 30px;
        position: relative;
        z-index: 10;
        top: 0;
    }

    Cheers! 
    Josue

    #496935

    Hi Josue,
    thank you, worked for all browsers but FF. But I could resolve it this way:

    #tab-upsell_tab:empty, #tab-upsell_tab:-moz-only-whitespace {
    background: white none repeat scroll 0% 0% !important;
    height: 30px !important;
    position: relative !important;
    top: 0px !important;
    z-index: 10 !important;
    }

    Regards
    Wolfram

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Woo: Related products .. above tabs’ is closed to new replies.