• Resolved shopratnaonline

    (@shopratnaonline)


    Hello,


    We love your plugin!

    We are checking to see the possibility with additional php code/css to hide the Wishlist button for a specific product id, product category.

    Your help will be greatly appreciated.


    Regards,

    Shop Ratna Online

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Sanesh Acowebs

    (@saneshacodez)

    Hi, thank you for contacting us. You can achieve this by using custom code. To do this, update the plugin to the latest version.Use the sample code below. This will hide the wishlist option from a particular category.

    add_filter( 'awcdp_disable_wishlist_condition', 'aco_category_wishlist_condition' );
    function aco_category_wishlist_condition() {
    $category_exclude = 22; // term ID of the CD category
    global $post;
    $product_categories = array();
    ? ? $product_categories_raw = get_the_terms( $post->ID, 'product_cat' );
    ? ? if ( ! empty( $product_categories_raw ) ) {
    foreach ( $product_categories_raw as $term ) {
    $product_categories[] = $term->term_id;
    }
    }
    if( in_array($category_exclude, $product_categories) ){
    return false;
    } else {
    return true;
    }
    }

    I hope you can update the category number according to your needs. You can also update this sample custom code for particular products.

    Thread Starter shopratnaonline

    (@shopratnaonline)

    Thanks, worked like a charm!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.