Here is what I have/kind of the components for this:
1. User with various "location" cpts
2. WooCommerce Subscriptions
3. Two CRED Commerce forms in each "location" cpt allowing to select one of two products/subscriptions
I have been reading over the WooSubscription action/filter reference and it seems like $product_id is used for the subscriptions just as for normal products which h´should hopefully make things easier.
Now here is what I want to achieve:
1. User goes into one of his "location" cpts
2. User selects one of two products
3. Location cpt has a custom field showing the $product_id of the ordered product
4. The custom field also has a link like this: hidden link
See the screenshot attached to see that that link is already generated by WooSubscriptions in the Subsciptions overview. I just need to also show it in the location cpt. A user may have 80 locations so he needs to be able to go into one and find that direct link to the subscription he bought for that location.
regarding point 2. I followed the instructions but now in the "Control Post Fields" I can't see any product fields, please see the screenshot attached.
The following code is what I used to de-register the woo-products before readding them using types using the same slug
function delete_post_type(){
unregister_post_type( 'product' );
}
add_action('init','delete_post_type');
Also I have tried anyway to try to understand the process and now I am even more confused 😉 If I am to query the orders, that means I need to de-register and re-register with types the cpt "orders" correct? I tried for products and subscriptions and nothing was found.
I know the documentation isnt online yet and still being revised but please could you help me with the steps to query either orders or even better, active subscriptions whose author is current logged in user and parent is the post in which the view is being shown. Thanks a lot in advance 🙂
The code you are using to unregister is not needed. You can just deactivate WooCommerce plugin to link it with Types using the steps mentioned (same for products and orders CPT).
And this is needed only if you want to create relationship between Location CPT and Products or Orders.
For “Post Field Control” you don’t need to unregister CPT, that was a separate thing in that doc.
Please could you help me with the steps to query either orders
==> The process for this is not small, it takes many things to setup this properly. I am also not clear on this until doc is out and I can see how it works (since this feature is very new). So not possible at moment to outline the steps.
One thing I forgot to mention that you will be using Toolset WooCommerce Views plugin in this process.
So you mean to simply deactivate for example woocommerce, create the "products" cpt and then activate woocommerce?
The "orders" cpt doesnt not really seem to be a cpt since I it doesnt really show anywhere, its just a part of woocommerce so I am a little confused here.
Is there any ETA on the docs? I mean I know you probably can't do that but even an unofficial unfinished version would be really helpful to wrap my head around this 😉
About Post control fields.. Ok so I dont need to un-register anything but how do I get for example the "products" fields to show up in there?
1. So you mean to simply deactivate for example woocommerce, create the "products" cpt and then activate woocommerce?
==> Yes, right and make sure to use same slug name as Products post type has.
Orders is basically a special CPT, as is shown under WP Dashboard >> WooCommerce >> Orders section. Its url is like: hidden link
-- Please note, there may be some updates added to it and we cannot guarantee this yet since this doc is not officially released at moment. I am just sharing this because you have insisted for this doc.
3. Post Field Control is a separate topic. Please kindly open a new ticket if you need help with this. This will help other users with similar problems to find solutions when searching the forum, I am not allowed to handle multiple issues in the same ticket as per support policy. https://toolset.com/toolset-support-policy/