Daniel Godoi Wagner
Forum Replies Created
-
@priyankajagtap trying to improve the function, I tryed with chat gpt and got it bellow, but still not working. any ideas, pleasseee?
function modify_customer_note_title( $translated_text, $text ) {
// Log detalhado para depura??o
error_log( sprintf(‘Text: %s, Translated: %s’, $text, $translated_text) );// Modifica o texto "Quantidade" if ( 'Quantidade' === $text ) { $translated_text = 'Qtde'; } return $translated_text;
}
// Aplica o filtro ‘gettext’ e ‘ngettext’ sem a verifica??o de domínio
add_filter( ‘gettext’, ‘modify_customer_note_title’, 20, 2 );
add_filter( ‘ngettext’, ‘modify_customer_note_title’, 20, 2 );Forum: Plugins
In reply to: [WPC Fly Cart for WooCommerce] fly cart with too many items alone@janilyn409 thanks a lot for the response! I made other tests and compared the configs for https://www.telecris.app also https://www.telecristofoli.com which I assure you is with the very same configs of the first. Checked all kinds of problems and have not detected whats could it be. I discovered that at each time I reload the site, the items improves at the flkycart. See this capture please https://pasteboard.co/LHfLdQvhzUKG.png – Hope you can help me a litle more. Best regards!
Forum: Plugins
In reply to: [WooCommerce] change title of ENTREGA (see image)Thanks a lot, I was thinking about change it with a code snippet instead of using more a plugin because the aplication is already very heavy.
I’m proud to share that the owner of the plugin pizza builder already made a properly function to integrate both (pizza builder plus print invoice for woocommerce) and it really working. It can be seen at th pizza builder forum. Thanks for trying!
@wsjrcatarri man I dont have sufficient words to tell you how happy I am to see this working!!! Thanks a lot! God bless you, dude! The client is happy also, for sure. I’m going forward to send it to google play store. Will be glad to make you a donation if you could inform me your paypal. Thanks so, so much! You have coinstrutucted the better plugin ever to pizza businesses! Congrats, man, you are a relly great on your work! Thank you!!!
@wsjrcatarri sorry to hear that! I just approved an android app with the cliente, can you please call me at [email protected] to us arrive in some deal to make that. I’m available to pay you for that. Please don’t leave me alone on that, really need your help!
@priyankajagtap can you, please, help me here?
@wsjrcatarri dear friend, any ideas please?
any ideas, dear friend? @wsjrcatarri
Hi there @wsjrcatarri ! Thanks a lot again. The function is running, but the data isnt showing up at the print invoice yet. I’ve sended the wp admin password by e-mail recently, the funcionation is the number 02 at the code snippets plugin (trechos de código in portuguese). Can you check it out, please? Excuse me by bothering you, man! Thanks a lot!
This is the original function, man, plus some adjustment chat-gpt did. It is running at https://www.pizzavenus.com.br/loja – already sended to you the wp access to see it at code snippets (trechos de código plugin) – is the newest code there. It is not working yet, but I think must be few details about…
add_filter( ‘wcdn_order_info_fields’, ‘custom_order_fields_example’, 10, 2 );
function custom_order_fields_example( $fields, $order ) {
$new_fields = array();$order_items = $order->get_items(array('line_item')); error_log('Order items: ' . print_r($order_items, true)); foreach ( $order_items as $item_id => $item ) { $pizza_product = get_post_meta( $item->get_data()['product_id'], '_ev_pizza', true ) === 'yes' ? true : false; error_log('Pizza product: ' . $pizza_product); if ( ! $pizza_product ) continue; $item_data = $item->get_meta_data(); error_log('Item data: ' . print_r($item_data, true)); $index = 0; foreach ( $item_data as $meta ) { if ( $meta->key !== '_ev_pizza_config' ) { continue; } if ( ! isset( $meta->value['extra']['components'] ) ) { continue; } $index++; $new_fields['ev_component' . $index ] = array( 'label' => $meta->key, 'value' => $meta->value, ); error_log('New field added: ' . print_r($new_fields['ev_component' . $index], true)); } } return array_merge( $fields, $new_fields );
}
- This reply was modified 7 months ago by Daniel Godoi Wagner.
Could you adapt this function bellow with this variable/field, please? I tryied several times with chat gpt but it never works… this function bellow does exacly the same, call a variable and shows at the print invoice…
function example_custom_order_fields( $fields, $order ) {
$new_fields = array();if( get_post_meta( $order->id, 'billing_order-info', true ) ) { $new_fields['billing_order-info'] = array( 'label' => 'ID:', 'value' => get_post_meta( $order->id, 'billing_order-info', true ) ); } return array_merge( $fields, $new_fields );
}
add_filter( ‘wcdn_order_info_fields’, ‘example_custom_order_fields’, 10, 2 );Thanks for respondind! Can you specify better which filed contains the EXTRA COMPONENTS, please?
@priyankajagtap Talking to the creator of the plugin Pizza Builder, he could identify the fields that I need to show at the print invoice. Can you help me now with the function. I did one with chat gpt but is not working:
FIELDS TO SHOW: display_meta_thankyou_main($item_id, $item, $order) from includes/pizza-checkout.php
FUNCTION CREATED WITH CHAT GPT:
function custom_order_meta_fields( $fields, $order ) {
$new_fields = array();// Verifique se a fun??o display_meta_thankyou_main existe if ( ! function_exists( 'display_meta_thankyou_main' ) ) { error_log( 'A fun??o display_meta_thankyou_main n?o está definida.' ); return $fields; } foreach ( $order->get_items() as $item_id => $item ) { // Verifique se $item_id e $item s?o válidos if ( ! $item_id || ! $item ) { error_log( 'Item inválido encontrado no pedido.' ); continue; } $meta_value = display_meta_thankyou_main($item_id, $item, $order); if ( $meta_value ) { $new_fields['meta_thankyou_main_' . $item_id] = array( 'label' => 'Sabores escolhidos:', 'value' => $meta_value ); } else { error_log( 'Nenhum valor meta encontrado para o item ' . $item_id ); } } return array_merge( $fields, $new_fields );
}
add_filter( ‘wcdn_order_info_fields’, ‘custom_order_meta_fields’, 10, 2 );dearest friend I just need the name of the filed which contains de flavours choosed by the customer, and will try to make a new function, ok? can you just tell which it is, please? thank a lot!