Skip to content

JetEngine extra Macros

Soczó edited this page Apr 16, 2024 · 9 revisions

WC Current User Purchased Products

Returns the ID of the products that the currently logged in user has purchased. Only calculates from completed orders. (With comma separation.)

Use in the Query Builder: Create a new Query in the Query builder. The Query Type should be Wc Product Query. In the general section, in Includes, select this macro: WC Current User Purchased Products

image

WC Membership Access Posts

(Only if you have Woo Membership plugin installed) https://woo.com/products/woocommerce-memberships/ Returns the ID of the posts to which the user has access. These are retrieved via the Woo Membership API. (With comma separation.)

Use in the Query Builder: Create a new Query in the Query builder. The Query Type should be Post Query. Navigate to the Post & Page section. In the Post In input, select this macro: WC Membership Access Posts In this Macro, you have to choose from which Membership you want the user to retrieve the available posts. image

WC Current User Active Memberships

(Only if you have Woo Membership plugin installed)

Returns the membership plans of the currently logged in user. You can choose to include all or a specific status. It will only not add plans that it does not have. If you choose Any status it doesn't matter if it's expired or suspended, it will return the ID.

How to use and combine with the Query builder and listing grid?

  • 1, Create a new Query. Query type: Post
  • 2, In the general section Post type selection choose Members (this is the name of one of woocommerce's membership CPTs.)
  • 3, In the general section, Post status select: Any. (Since there are special statuses here, the macro will filter it.)
  • 4, In the Post & page section the Post In input select the WC Current User Active Memberships macro, and choose the membership status.
  • 5, Done!

image image

How to build a listing with the memberhsip with current user membership details

Go to the JetEngine Listing - and create a new listing, you can use for the source Post, or Query builder (With the previously created Query with query builder.) It's funny, because actually whatever you choose the data comes out fine, the preview can be a problem, but it's safest either if the source is the query builder, but if post then Members (as set in the query builder)

image You may not see some data correctly in the preview, but don't be scared. To retrieve the data, use the Current membership Data dynamic tag.

image The data that can be retrieved using the dynamic tag: Plan name, Next bill (if use subscriptions), status, member since, Expires, remaning time

If you want to hide a piece of data from the current membership data when the memberhsip has expired, you can use our extra jetengine dynamic visibility condition : Current Membership Expired

Clone this wiki locally