• Resolved John Kostly

    (@johnkostly1)


    Assigning the Taxonomy to WooCommerce Products breaks the Taxonomy Listing page

    The taxonomy works, until I assign it to woocommerce. It appears it is then adding a sort and other elements to the taxonomy page and it lists out all the content but it shows none.

    I’m trying to have a taxonomy that is used on multiple content types, then show links that match between woocommerce and this custom taxonomy. But I’m having a number of issues with it, this is the first issue.

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Not sure what to suggest for this overall. WooCommerce and their post type/taxonomy setup is kind of unique in my view, but I know people have tried various things in the past to I’m sure various levels of success. Nothing that’s necessarily specific to CPTUI, as I suspect the same issues would be happening if you used register_taxonomy() directly.

    That said, if you can provide the taxonomy configuration/setting for the taxonomy you’re trying to assign to WooCommerce’ product post type, I can import and see if there’s anything obvious that could be done to help. I can’t promise anything though.

    Thread Starter John Kostly

    (@johnkostly1)

    Yea, its happening in all of the CPT plugins. woo Commerce isn’t playing by the wordpress rules.

    I’m about to use a different platform as they’re giving me the “Custom Code is beyond this forums capabilities”

    I’m amazed more people are not complaining about this. I see a lot of people doing this in the past, and it worked. But now its failing, and they’re abandoning these customers.

    function cptui_register_my_taxes() {

    /**
    * Taxonomy: Toy Types.
    */

    $labels = [
    “name” => esc_html__( “Toy Types”, “pricelesssgemstone” ),
    “singular_name” => esc_html__( “Toy Type”, “pricelesssgemstone” ),
    ];


    $args = [
    “label” => esc_html__( “Toy Types”, “pricelesssgemstone” ),
    “labels” => $labels,
    “public” => true,
    “publicly_queryable” => true,
    “hierarchical” => true,
    “show_ui” => true,
    “show_in_menu” => true,
    “show_in_nav_menus” => true,
    “query_var” => true,
    “rewrite” => [ ‘slug’ => ‘toy-types’, ‘with_front’ => true, ‘hierarchical’ => true, ],
    “show_admin_column” => true,
    “show_in_rest” => true,
    “show_tagcloud” => true,
    “rest_base” => “toy-types”,
    “rest_controller_class” => “WP_REST_Terms_Controller”,
    “rest_namespace” => “wp/v2”,
    “show_in_quick_edit” => true,
    “sort” => false,
    “show_in_graphql” => false,
    ];
    register_taxonomy( “toy-types”, [ “post”, “kinky_activities” ], $args );

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Are you sure this is the correct taxonomy? I see it as assigned to post post type, but not product. That said, I am not necessarily seeing any issues when I change the post type either.

    Screenshots of what you’re seeing vs expected to see would be beneficial as well.

    Thread Starter John Kostly

    (@johnkostly1)

    I turn it off because it breaks it, sorry. It was on. Here, I can leave it on and provide a link.

    NSFW when its working: https://pricelessgemstone.com/toy-types/all-toy-types/ (Its not)

    Let me know when you see it, it just doesn’t list anything but products. It clearly has spaces, but its either a templating problem or another issue.

    Honestly, I don’t care if products show up on this at all on this taxonomy. I only want to reference them for showing on other content types.

    • This reply was modified 6 months, 3 weeks ago by John Kostly.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    You can send screenshots and links you want to keep private enough via https://pluginize.com/contact/ and I’ll be able to receive the information.

    It’s definitely something at the template/theme level more than settings with the taxonomy. The query seems to be finding zero items and giving an empty <ul> list with zero items.

    Thread Starter John Kostly

    (@johnkostly1)

    Its with Woo Commerce, as you said. I tried multiple themes, including wordpresses default ones.

    WooCommerce is about to deny the issue entirely and not provide support. Which is crushing.

    I may have to hack something to add the category manual as an extra field

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Have you checked error logs at all in case something is going wrong in that area?

    It could also just be the query being made not finding anything for results to show.

    Thread Starter John Kostly

    (@johnkostly1)

    No errors are in the logs.

    As far as I’m concerned, they probably just have to fix it so there is an if statement in there, and that if statement loads the post template when it comes accross a post type it doesn’t know. If I could find the hook, I could probably do it myself.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    For what it’s worth, something like https://www.ads-software.com/plugins/query-monitor/ could help see what query is being made with what arguments for it, and the results.

    As is at the time of this reply, it looks like you put things back in a working state for the moment, or perhaps got things fixed?

    Thread Starter John Kostly

    (@johnkostly1)

    I created a custom control for the woocommerce products instead. I store it with the taxonomy, but I am keeping the taxonomy unregistered for now. Once I can tap into Spectra better, I will use that to display them with a custom modification to their query. That will give me products on the pages that match my categories. Thank you for your time and help.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hopefully a solution for all your needs gets found, we’re definitely rooting for you.

    Thread Starter John Kostly

    (@johnkostly1)

    I’m now having problems with the join beign ignored, I believe its because the taxonomy isn’t registered, so the join is getting removed by wordpress or ignored. Ommph.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    You’re going to need to dig in to the code that’s meant to be creating and populating the frontend listings. I’m not sure what you’re working with so I’m not able to help much any more. CPTUI itself is meant to get the content types registered for users, but we don’t interject with how they’re used or where, outside of what gets wired up to do via the register_post_type() and register_taxonomy() functions do. At which point, it’s handed off to the themes and WP core.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Assigning the Taxonomy to WooCommerce Products breaks the Taxonomy Listing page’ is closed to new replies.