eephyne
Forum Replies Created
-
vous avez trouvé des points communs sur les profils qui échouent?
recevez vous aussi un mail d’erreur code http 500 de la part de etransaction a chaque fois ?
ouais bizarre quand même c’est pas up2pay qui gère le forum (ils sont peut-être modo cela dit).
Pour faire avancer le truc, j’ai eu le souci avec une cliente qui utilisait virtualis, j’ai eu aucun souci avec les ‘utres paiements pour l’instant.
pourquoi toutes les réponses ont elles été effacé?
Forum: Plugins
In reply to: [WooCommerce] automatically add metadata on manual orderhello again.
the SO thread was about how to populate not about adding new metadata.
I posting my solution here in case someone search something similar.
Its probably not ideal in all case but seem to work fine for my case.function add_custom_metada_to_gift_card($item_id, $item, $product ) { //list of meta_data to add $meta_key_list = [ 'pw_gift_card_amount', 'pw_gift_card_to', 'pw_gift_card_recipient_name', 'pw_gift_card_from', 'pw_gift_card_message', 'pw_gift_card_email_design_id' ]; if ($item['product_id'] == 1677) { //only add for specific product_id, chang it to yours foreach ($meta_key_list as $metakey) { if (!$item->meta_exists($metakey)) { $item->add_meta_data($metakey,' '); $item->save_meta_data(); } } } } add_filter('woocommerce_before_order_itemmeta','add_custom_metada_to_gift_card',10,3);
hope it’ll help someone.
Forum: Plugins
In reply to: [WooCommerce] automatically add metadata on manual orderNo problem for the delay, thanks for your time.
You did understand exactly my need.
I know that this is for a third party plugin but it seem to use core-parts of woocommerce and my question was mainly about woocommerce behavior (at least it seems so).
I could ask how to do that with a normal product and not with a product linked to a plugin.
I don’t mind modifying the code, I’ll do it all the time to bend the plugins to my needs.
maybe I could add the metadata field using a WC hook ?