Support » Plugin: WooCommerce » Help – To Capture Link for Compare

  • Hello,

    I have a catalog page with three different types of categories.
    1) Registration internal Service
    2) Shop to purchase goods
    3) Registration to external service

    Using the template to change messages for products to be more specific for the category. I am using the template in the theme. Works nice as ONE message but I need to have three custom messages.

    I have code that will look at the categories coming in and send the message to the screen except it posts all three messages for each category because of loop. If I use exit instead of break – it works but destroys the screen menu and other end of loop functions.

    How can I get the right message when a user logins and see the category on the shop but the registration is closed, a message should tell them that it is closed for that category.

    Can I pass a specific link from the shop page to trap it before I loop through the categories to check if it is a match?

    any suggestion would be nice.

    Here is some of the code:

    global $woocommerce;
    $term_taxonomy = ‘product_cat’;
    $args = array(
    ‘hide_empty’ => 0
    $categories = get_terms( $term_taxonomy, $args );
    if( $categories ) {
    foreach( $categories as $category ) {

    switch( $category->name ) {
    case ‘Registration 1’:
    show message

Viewing 1 replies (of 1 total)
  • I wanted to add this too.

    If I need to work with the template content-product_cat.php

    Can this information be passed in a global variable?

    $global_var = get_term_link( $category->slug, ‘product_cat’ );

    Use $global_var in message are to see which one the user choose?

Viewing 1 replies (of 1 total)
  • The topic ‘Help – To Capture Link for Compare’ is closed to new replies.