how can show products in map after I added them in cart?
Hello,
Please elaborate the questions with more details:
Are you going to use Views to query product posts which are in user's cart?
If it is, there isn't such kind of built-in feature within Toolset plugins, you might consider custom codes, for example:
https://stackoverflow.com/questions/28576667/get-cart-item-name-quantity-all-details-woocommerce
For your reference.
hi, thanks for you time,
I am not sure if i will go to use Views to query product posts which are in user's cart, but if with views I can show on a map to my user all products he added to cart it is ok for me.
I want give you more details:
the products are locations, for example restaurant, museums, hotel, so the user can customize his itinerary and can watch on the cart whole itinerary he has decided himself.
regards
Marco
As I mentioned above, you can consider custom codes, for example:
1) Create a post view, query all product posts, display the result in a map
2) Use filter hook wpv_filter_query to trigger a PHP function:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
3) In this PHP function, get the product IDs in user's cart:
https://stackoverflow.com/questions/28576667/get-cart-item-name-quantity-all-details-woocommerce
and apply those product IDs into view's query:
https://developer.wordpress.org/reference/classes/wp_query/#post-page-parameters
post__in (array) – use post ids. Specify posts to retrieve.