brasofilo
Forum Replies Created
-
Much appreciated, @georgestathopouloswpmedia and BackWPup Team, thanks for all your work!
Forum: Plugins
In reply to: [Admin Tweaks] Option to show/edit user_nicenameHi, joxyzan, thanks for your feed and sorry for the delay, I just realized I’m not being notified of forum threads…
It is possible to do it, but as it’s considered a bad idea by people more knowledgeable than me, I’m not inclined to implement it, see: https://wordpress.stackexchange.com/questions/321794/changing-user-nicename
This snippet allows you to do that when you load the user with the query “change-nice”:
https://example.com/wp-admin/user-edit.php?user_id=2&change-nice=NewNiceName
Then remove the query from the URL and reload the page. There is a row at the end of the page to show the current value.I use this plugin to manage my snippets: https://www.ads-software.com/plugins/code-snippets/
add_action( 'edit_user_profile', function ( $user ) { if( !empty( $_GET['change-nice']) ) { wp_update_user([ 'ID' => $user->ID, 'user_nicename' => strip_tags(strtolower($_GET['change-nice'])) ]); } ?> <table class="form-table"> <tr> <th><label for="user_nicename">User Nicename</label></th> <td> <code><?php echo esc_attr( $user->user_nicename ); ?></code> </td> </tr> </table> <?php });
Forum: Reviews
In reply to: [PagSeguro International Payment Gateway for WooCommerce] Golpes do PagbankChegou a registrar queixa no ReclameAqui ou no Procon?
Forum: Plugins
In reply to: [YITH Request a Quote for WooCommerce] How to change error messageYou can try the following code. Here I used for changing a message from the plugin WP Crontrol. I know that Woo has some custom error handling so I’m not sure this will work for you. The plugin Query Monitor helps to debug things (the
do_action
will show you the contents of the variables):add_action('wp_error_added', function ($code, $message, $data, $wp_error) { do_action( 'qm/debug', ['Error', $code, $message ] ); if ( $code == 'crontrol_info' ) { $wp_error->errors['crontrol_info'][0] = 'My modified message'; } }, 10, 4);
The
$code
var is easier but you can try with the$message
too.Fixed code:
add_action( 'enqueue_block_editor_assets', function () { $script = "jQuery( window ).load( function() { const isFullscreenMode = wp.data.select( 'core/edit-post' ).isFeatureActive( 'fullscreenMode' ); if ( isFullscreenMode ) { wp.data.dispatch( 'core/edit-post' ).toggleFeature( 'fullscreenMode' ); } const isDistractionFree = wp.data.select( 'core/edit-post' ).isFeatureActive( 'distractionFree' ); if ( isDistractionFree ) { wp.data.dispatch( 'core/edit-post' ).toggleFeature( 'distractionFree' ); } const getNotices = wp.data.select( 'core/notices' ).getNotices(); getNotices.forEach( ( v, i )=>{ if ( v.content.includes( 'Otter' ) ) wp.data.dispatch( 'core/notices' ).removeNotice(v.id); }) });"; wp_add_inline_script( 'wp-blocks', $script ); });
Forum: Reviews
In reply to: [Smart Hashtags [#hashtagger]] Nice plugin but hate the nagsMy own opinion is that folks offering things for free are entitled to nag as they wish…
That said, take a look at this plugin, it’s the end of the nagging nightmare, lol
https://www.ads-software.com/plugins/wp-admin-notification-center/This is starting to look like the AdBlock wars where the advertisers keep trying nonstop to escape being blocked, lol
Thanks for checking it out!
Forum: Plugins
In reply to: [System Dashboard] Localhost wp.local Fatal Error [SOLUTION]Working great, Bowo, thanks for the update!
No errors are reported on my system.
Forum: Plugins
In reply to: [Pix por Piggly (para Woocommerce)] Aparentemente o plugin foi abandonadoQue bacana que vocês voltaram!, é um grande plugin ??
Thanks, Juan. I’ll proceed as instructed.
Ok, I had to enable “Pass all the fields from the form as URL query parameters” and it worked.
But the fields are not being passed as URL parameters, they arrive as $_POST data as I needed.
So, both options are needed to pass the data as $_POST. If we choose only “Pass as URL query” then the data arrives as $_GET.
Olá!
Só deixando minha dúvida explicita nesta thread…
Só existe 1 jeito de enviar o comprovante (pela página de conta do cliente)?O que devemos fazer quando o comprovante é enviado pelo zap?
Atualmente eu uso o plugin User Swap pra poder acessar a página do cliente ou ent?o marco o pedido diretamente como Concluido.
Hi there!, thanks a lot for getting back to me, really appreciated ??
I couldn’t achieve my objetive fiddling with those 2 settings. On the category page I want the behavior “Show out of stock” and on the single product page I want “Hide out of stock” behavior.
Maybe the problem lies with WC Blocks that are like a blackbox, kind of impossible to filter:
https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/891I couldn’t make it work with
wwwoocommerce_product_query_tax_query
,wwwoocommerce_product_query
,pre_get_posts
. Maybe the filtersposts_request
orposts_clauses
could have helped but I found an easier solution:My WC Product Inventory setting is “Hide out of stock” and on the pages I want the opposite I applied the
pre_option
filter:add_filter('pre_option_woocommerce_hide_out_of_stock_items', function($pre_option, $option, $default){ if( is_page([2893,2895,5393])) $pre_option = 'no'; return $pre_option; }, 10, 3);
- This reply was modified 3 years, 3 months ago by brasofilo.
Forum: Plugins
In reply to: [OptionTree] Plugin Abandoned?That’s what it looks like ??
But someone forked and simplified it:
https://github.com/valendesigns/option-tree/issues/737- This reply was modified 3 years, 8 months ago by brasofilo.
Acho que finalmente encontrei o problema estudando o método
payment_complete()
.é necessário adicionar
pix-receipt
ao filtro de Valid Orders. Sem isso opayment_complete()
n?o vai atualizar o status nem salvá-lo.add_filter('woocommerce_valid_order_statuses_for_payment_complete', function($stati, $that){ $stati[] = 'pix-receipt'; return $stati; }, 10, 2);
E é necessário também marcar este transiente Needs Processing como false. Sem isso, o status do pedido vai ficar como
processing
em vez decompleted
.add_action ( 'woocommerce_order_status_pix-receipt', function ( $order_id, $instance ) { $order = $instance instanceof WC_Order ? $instance : new WC_Order((int)$order_id); if ( $order ) { $transient_name = 'wc_order_' . $order_id . '_needs_processing'; set_transient( $transient_name, false ); $order->payment_complete(); } }, 99, 2 );
Imagino que a quest?o do transiente pode ser resolvida de outra forma pois ela serve pra controlar produtos digitais e minha loja s?o produtos físicos.