The team is now working on the WordPress Interactivity API. This unblocks the same UX Frontity framework enabled but directly in WordPress Core, fully compatible with the new Site Editor.
I am trying to use the standard Woo API in Frontity.
I realize that the Custom Post Type in Frontity (product in WC) require of type “type” field fixed to “product” and the “link” field must be included in the response.
both things can be done using the following snippet:
That’s great! I think you don’t need anything else because the WooCommerce API already includes the id and the slug. Just be careful because I think that WC API use type field to store the product type, you may want to store this in other field if you need it.
vscopise3
Hi @SantosGuillamot
I think it’s not enough …
The data is not as it should be:
You’re totally right! Right now @frontity/wp-source is assuming that if the field name exists in the REST API, it’s considered and author, that’s why you were having that problem.
If If that solution works for you it seems totally fine, I’m glad you made it work Btw, we are working on a new version of source in order to make easier and prevent these problems, we’ll keep you posted about that .
luisherranz10
Yes, this scenario will be handled in the new version
vscopise12
Now, the final part is the correct configuration of taxonomies, this is my settings:
I don’t know if that’s going to work because those options expect regular postTypes/taxonomies from /wp/v2. But let us know what you find out
vscopise14
what are the fields that frontity expects?
In the same way that i can modify the product endpoint (woocommerce_rest_prepare_product_object), I can modify the taxonomies endpoint (woocommerce_rest_prepare_product_cat)
Thanks !
luisherranz15
I wouldn’t mind on doing that to be honest because we are going to fix that in Source v2 and then you’ll be able to use any normalization that you want.