Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1041301
    Laurent Ferrer
    Participant

    Hi,

    This the report of the WP installation :

    WP : 4.5.2
    WooCommerce : 2.5.5
    X-Theme : 4.5.2
    Cornerstone : 1.2.4

    Customize > WooCommerce > upsells (on – four columns)
    Sample product set with three ‘upsells’ product with the same category.

    In the product page only one product is displayed instead of three and the product is displayed in a random way ?! To verify, you can go to : http://pid-5ei32utf-kkl.ovh/k-shop/t-shirts-hommes/chillizain-chillida-zamalzain . You just need to refresh a few times !

    Thank you.

    Laurent.

    #1041570
    Christian
    Moderator

    Hey Laurent,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thanks.

    #1041591
    Laurent Ferrer
    Participant
    This reply has been marked as private.
    #1042059
    Darshana
    Moderator

    Hi there,

    Thanks for writing in! Could you please try adding the following code into your child theme’s functions.php file.

    
    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
    add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_upsells', 15 );
    
    if ( ! function_exists( 'woocommerce_output_upsells' ) ) {
    	function woocommerce_output_upsells() {
    	    woocommerce_upsell_display( 4,4 );
    	}
    }
    

    Hope that helps.

    #1042565
    Laurent Ferrer
    Participant

    Hi,

    Thank you for the help Darshana.

    If you check the generated code (http://pid-5ei32utf-kkl.ovh/k-shop/t-shirts-hommes/chillizain-chillida-zamalzain/), we have now two ‘<div class=”upsells products cols-4″>‘. The first one is OK with the three upsell products but the second one still displaying one random product based on the three upsells products ?

    Thank you.

    Laurent.

    #1043050
    Lely
    Moderator

    Hi There,

    I tried to login to your server via FTP but the credentials is not working. See attached screenshot for the issue I am having. You could try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time. If the issue still exist after this, please try switching from your child theme to main X theme. This is just to make sure that this is not a result of any custom codes. Then check again. Do let us know how this goes.

    #1043177
    Laurent Ferrer
    Participant
    This reply has been marked as private.
    #1043877
    Rad
    Moderator

    Hi there,

    Upsells are generated by Woocommerce and we don’t have control over it. It’s just embedded to X theme template but it’s alone a feature of Woocommerce. And it’s actually random because it is upsells’ default option.

    If you just wish to change its order, then please remove the above code, and just add this code to your child theme’s functions.php

    add_filter ('woocommerce_upsells_orderby', 'change_upsells_order') 
    
    function change_upsells_order ($order) {
    
    //can be title, date, rand, not sure with other options
    
    return 'rand';
    
    }

    Woocommerce source code is also available here https://docs.woothemes.com/wc-apidocs/source-function-woocommerce_upsell_display.html#1277-1292

    Thanks!

  • <script> jQuery(function($){ $("#no-reply-1041301 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>