I used ChatGPT to create iMember360 conditionals to only show a pop up on the cart page when certain products are in the cart. Here’s that whole task from start to finish: https://wiki.trueproductions.com/article/show-elementor-pop-up-for-only-certain-products-based-on-imember360-conditionals/
Here’s the prompt I used (You can see the original ChatGPT convo here, but I’m not sure if those stay forever, so I’m pasting it too):
I am working on a WooCommece storefront built with iMember360 and Elementor. I need to create a new iMember360 conditional that evaluates as TRUE when the following conditions are met: Product ID 9192 is in the cart.
The response from ChatGPT is pasted below:
Here’s the PHP conditional you can use in iMember360 that will evaluate to TRUE if product ID 9192 is in the WooCommerce cart:
If you need to place this directly into an iMember360 conditional field (rather than adding a function to your theme), you can use the inline version:
✅ How it works:
-
WC()->cart->get_cart()returns all cart items. -
array_column(..., 'product_id')extracts all product IDs. -
array_search(9192, ...) !== falsechecks if 9192 exists in that list.
Example Usage in iMember360
If you’re using this as a PHP conditional in an Elementor visibility or shortcode condition (for example, in iMember360’s conditional logic area):
That statement will return TRUE when the cart contains product ID 9192.
