Reflection
-
I studied how the order item meta and order meta of woocommerce works and I understood how it works. As previously proposed, my problem was for a buyer user to pass the id of a seller user via meta order item at the time of purchase, if the wp automator managed to use the order item meta in the automations I could create just a simple automation that regardless of how many products the buyer user tries to buy at the same time would be able to make the necessary validations even if each product had a different seller id the automation would be the following example: user buys any product > action creates a post > post author > seller id – Remarks : look how easy it would be to validate products sold to several sellers. Final considerations, as it is still not possible to use the order item goals for the automations, I had to do the following, it is ugly and not smart but for the moment it solves.
AUTOMATION: 1
buyer user create a post “comments even send to cart button” > update user profile > seller id saved within current user >
AUTOMATION: 2
user completes a purchase > updates multiple > filters by post from author post with a meta field equal to seller id and a meta field price equal to total order price > auterates the post author to seller id.
To make this work I had to create a custom field inside the order meta woocommerce inside the user and put this function to force the user to buy only one product at a time in the cart.
add_filter( ‘woocommerce_add_cart_item_data’, ‘woo_custom_add_to_cart’ );
function woo_custom_add_to_cart( $cart_item_data ) {
global $woocommerce;
$woocommerce->cart->empty_cart();// Do nothing with the data and return
return $cart_item_data;
}If you can carefully analyze an update to be able to use the meta item order, it would add a lot to the plugin. Thank you again for the great work and plugin, soon I will be purchasing the paid version from you because today without the automator there is no way to create sites
- The topic ‘Reflection’ is closed to new replies.