Your cart is currently empty!
term_exists not finding restricted categories
—
by
We are running an automated import to add/update products on our site regularly.
When the product is in a restricted category, our code to check if the category already exists is returning false:
$subcat = term_exists( $level2,'product_cat', $catid);
Please advise ASAP
Posted in Groups Restrict Categories
Comments
2 responses to “term_exists not finding restricted categories”
Hi Gitty,
Thanks for sharing your code with us, I’ve made some tests using it and have recorded my results. Please make sure to check your email for my reply and the test results I got.
I think it would be better if you run a debug on your code, the issue apparently resides elsewhere. If further assistance is needed, you are more than welcome to follow-up here.
Kind regards,
George
Hi Gitty,
Many thanks for using our plugin on your site, we appreciate it!
I think it would be better if you could share some more context of the code you’re running.
The function alone, term_exists(), is not affected by the restrictions applied by Groups or Groups Restrict Categories. If your implementation is private, then you are more than welcome to share it via a private repository( ie via Bitbucket), or directly by email, using my personal address, george at itthinx dot com.
We are willing to review your code and if needed, obviously we will take your use case into account and update Groups accordingly.
Kind regards,
George