Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    If the product is hidden from the catalog it won’t appear in upsell/crosssell lists either currently. Maybe it needs a new option – vote for it on ideas.woothemes.com

    Thread Starter sagormax

    (@sagortouch)

    @mike,

    Fortunately today i have done this by passing a value on meta query.

    Template : up-sells.php
    Link No: 22
    $meta_query = WC()->query->get_meta_query();

    Add Extra Line under this:
    $meta_query[0][‘value’] = ‘hidden’;

    That’s it.

    Thanks for your response.

    @sagor:

    Thank you for posting your solution. If I add this extra line, the upsell section with its headline will be visible, but without any products. Can you imagine a reason for this?

    This had no effect, for me, on the display of upsells for the product that is hidden from the catalog. Am I missing something?

    sammiefields2512gmailcom

    (@sammiefields2512gmailcom)

    Ah! I found the solution.

    This is what you need to do:

    1. go to cart.php and add this at the bottom:

    <?php
    add_filter( ‘woocommerce_product_is_visible’, ‘__return_true’ );
    ?>

    2. from cross-sells.php, remove the following line:

    ‘meta_query’ => WC()->query->get_meta_query()

    And hey presto! Your hidden products will now show up as cross-sells!

    sammiefields2512gmailcom

    (@sammiefields2512gmailcom)

    Update:

    I found that my above advice worked for one website (using Thesis theme), but not for another (using Genesis theme), but I managed to find the solution for my second website by doing the following:

    With step #1, I took the code,

    <?php
    add_filter( ‘woocommerce_product_is_visible’, ‘__return_true’ );
    ?>

    and instead of placing it right at the bottom of cart.php, I placed it just above the following existing code:

    <?php do_action( ‘woocommerce_after_cart_table’ ); ?>

    Hope this helps someone ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Show hidded product as upsell’ is closed to new replies.