• Resolved TC.K

    (@wp_dummy)


    My problem is same as this one, The solution there not helping, and since that thread is closed. So, I open another one here.

    I have a product where added multiple attributes. I delete one of it (not the attribute values, it’s the whole attribute) , but in the frontend it is till appeared.
    I tried ‘clear_transients’, ‘clear_expired_transients’, ‘delete_orphaned_variations’ in the woocommerce->status->tools page. But it’s not working.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi there @wp_dummy.

    1. Do you have any sort of caching on your site? I would try resetting this cache if so.

    2. Can you link to an example where this is happening and an explanation of which attribute in the example is not supposed to be there?

    3. Can you also send a screenshot of the attributes for that product?

    4. Can you post your system status report? You can find that by going to WooCommerce > Status in your dashboard, then clicking “Get system report,” then “Copy for support.”

    Thread Starter TC.K

    (@wp_dummy)

    I currently figure out a way to solve this.

    Previously I use wp_get_post_terms() to get the term, and this will caused this problem.

    And then I found that the attribute has been removed in product object $product->get_attributes(), hence I use this to check if the attribute there before display the term name in frontend.

    something like this:
    $atts = $product->get_attributes();`
    $origin = $atts[‘pa_%e7%94%a2%e5%9c%b0’] ? wp_get_post_terms( $post->ID, ‘pa_產地’, array( ‘fields’ => ‘all’ ) ) : array();
    echo $origin[0];`

    It is weird it did removed from the product object but still exist in wp term.

    • This reply was modified 4 years, 4 months ago by TC.K.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Deleted attribute still appearing’ is closed to new replies.