Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter dfcdev

    (@dfcdev)

    Hi again, i was able to revert my website back to WP 5.9.3 (the previous version that was installed) and all seems to be running ok now!

    I thought i would share this link which shows you a step-by-step process on how to re-vert back to a previous WP version, using a couple of plugins, see below:

    https://blogvault.net/downgrade-wordpress-to-previous-version-quickly/

    • This reply was modified 2 years, 6 months ago by dfcdev.
    Thread Starter dfcdev

    (@dfcdev)

    I have already reviewed and have tested per the “WordPress 6.0 Master List” and to no avail! Pls advise, thank you!

    Thread Starter dfcdev

    (@dfcdev)

    ok i found a workaround and actually MORE than a workaround for this topic, so i thought i would share this with the community in case anyone needs help with this!

    So basically the following code, when added to your child theme functions.php file, passes the parameter of the product category slug onto the <body> tags of your theme template, what this allows you to do is to uniquely style any of your .css components per product/blog/page categories, pretty cool too! see code below and feel free to email me for any clarification:

    function woo_custom_taxonomy_in_body_class( $classes ){
    $custom_terms = get_the_terms(0, ‘product_cat’);
    if ($custom_terms) {
    foreach ($custom_terms as $custom_term) {

    // Check if the parent category exists:
    if( $custom_term->parent > 0 ) {
    // Get the parent product category:
    $parent = get_term( $custom_term->parent, ‘product_cat’ );
    // Append the parent class:
    if ( ! is_wp_error( $parent ) )
    $classes[] = ‘product_parent_cat_’ . $parent->slug;
    }

    $classes[] = ‘product_cat_’ . $custom_term->slug;
    }
    }
    return $classes;
    }

    add_filter( ‘body_class’, ‘woo_custom_taxonomy_in_body_class’ );

    Thread Starter dfcdev

    (@dfcdev)

    there is no option for a custom header, anyway of coding this?

    Thread Starter dfcdev

    (@dfcdev)

    I figured this out! See “echo ‘<span style=”color:#ffffff”;>Style#: ‘. $product->get_sku() . ‘</span>’;” below located on the “content-product.php” file, I hope this is of help to anyone looking to make this customization:

    <li <?php wc_product_class( ”, $product ); ?>>
    <?php
    /**
    * Hook: woocommerce_before_shop_loop_item.
    *
    * @hooked woocommerce_template_loop_product_link_open – 10
    */
    do_action( ‘woocommerce_before_shop_loop_item’ );

    /**
    * Hook: woocommerce_before_shop_loop_item_title.
    *
    * @hooked woocommerce_show_product_loop_sale_flash – 10
    * @hooked woocommerce_template_loop_product_thumbnail – 10
    */
    do_action( ‘woocommerce_before_shop_loop_item_title’ );

    /**
    * Hook: woocommerce_shop_loop_item_title.
    *
    * @hooked woocommerce_template_loop_product_title – 10
    */
    do_action( ‘woocommerce_shop_loop_item_title’ );

    echo ‘<span style=”color:#ffffff”;>Style#: ‘. $product->get_sku() . ‘</span>’;

    /**
    * Hook: woocommerce_after_shop_loop_item_title.
    *
    * @hooked woocommerce_template_loop_rating – 5
    * @hooked woocommerce_template_loop_price – 10
    */
    do_action( ‘woocommerce_after_shop_loop_item_title’);

    /**
    * Hook: woocommerce_after_shop_loop_item.
    *
    * @hooked woocommerce_template_loop_product_link_close – 5
    * @hooked woocommerce_template_loop_add_to_cart – 10
    */
    do_action( ‘woocommerce_after_shop_loop_item’ );
    ?>

    Thread Starter dfcdev

    (@dfcdev)

    in other words, the “log in for pricing” link has now disappeared from all of my products…

    Thread Starter dfcdev

    (@dfcdev)

    thanks Con! however I already have this functionality hard-coded and implemented onto my child theme see below:

    // * BEGIN Hide prices

    add_action(‘after_setup_theme’,’activate_filter’) ;
    function activate_filter(){
    add_filter(‘woocommerce_get_price_html’, ‘show_price_logged’);
    }
    function show_price_logged($price){
    if(is_user_logged_in() ){
    return $price;
    }
    else
    {

    remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’ );
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_price’, 10 );
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_add_to_cart’, 30 );
    return ‘Login for Pricing‘;
    remove_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_price’, 10 );

    }
    }
    // * END Hide prices

    I basically just need to hide all add to cart functionality to certain users can someone else take a stab at this and help me hard code this?

    Thread Starter dfcdev

    (@dfcdev)

    got it will do and thanks for your reply

    Thread Starter dfcdev

    (@dfcdev)

    ok great! thanks will do just that! i hope i can get an answer!

Viewing 9 replies - 1 through 9 (of 9 total)