Algoritmika
Forum Replies Created
-
Hi, @nadhonar,
Sure, will do.
Forum: Reviews
In reply to: [Conditional Payment Gateways for WooCommerce] Great PluginThank you, @nadhonar!
Hi, @nadhonar,
Thank you for the idea.
Please update the plugin to the latest v2.3.0 (released today).
After the update, you will find a new “User Role” section (in “WooCommerce > Settings > Conditional Payment Gateways”).
Please give it a try and let me know what you think.
Hi, @nadhonar,
Thank you for the idea.
Please update the plugin to the latest v2.3.0 (released today).
After the update, you will find a new “Product Title” section (in “WooCommerce > Settings > Conditional Payment Gateways”).
Please give it a try and let me know what you think.
And if you like the plugin, please consider leaving me a rating.
Hi, @fletsch,
Sorry for not getting back to you sooner.
Are you still facing the issue? If so, could you please try running the rules manually with the “Run all rules now” tool in “WooCommerce > Settings > Order Status Rules > Tools”? Does it work properly in this case?
Hi, @esp5466,
Sorry for not getting back to you sooner.
I’m not sure if it’ll help, but please update the plugin to the latest v1.7.3 – I’ve added a new “Checkout update order meta” trigger there. This trigger is fired slightly earlier than “Checkout order processed”, so maybe that’ll make a difference.
Please give it a try and let me know what you think.
Thank you, @joja78!
Forum: Plugins
In reply to: [Order Status Rules for WooCommerce] hooks not fired on order complete emailHi, @simppa999,
I’ve made some tests and I believe it should be working.
Please try to add something simple to the email at first, e.g.:
add_action( 'plugins_loaded', function () {
if ( wp_doing_cron() ) {
add_action( 'woocommerce_email_order_meta', function ( $order, $sent_to_admin = false, $plain_text = false, $email = null ) {
echo 'TEST';
}, 10, 4 );
}
} );If it’s working, try adding some code from the original snippet, e.g.:
add_action( 'plugins_loaded', function () {
if ( wp_doing_cron() ) {
add_action( 'woocommerce_email_order_meta', function ( $order, $sent_to_admin = false, $plain_text = false, $email = null ) {
// Must be a "Completed order" email
if ( ! isset( $email->id ) || 'customer_completed_order' !== $email->id ) {
return;
}
echo 'TEST';
}, 10, 4 );
}
} );I hope this helps.
Forum: Plugins
In reply to: [Order Status Rules for WooCommerce] hooks not fired on order complete emailHi, @simppa999,
Glad to hear we figured out the cause of the problem.
Now, regarding the solution – the first thing that comes to mind – recreate our own
attach_tracking_to_email()
callback (from theclass-admin.php
file). It should look like this (I didn’t test it, though):add_action( 'plugins_loaded', function () {
if ( wp_doing_cron() ) {
add_action( 'woocommerce_email_order_meta', function ( $order, $sent_to_admin = false, $plain_text = false, $email = null ) {
// Must be a "Completed order" email
if ( ! isset( $email->id ) || 'customer_completed_order' !== $email->id ) {
return;
}
// Get labels
$labels = $order->get_meta( '_wc_pakettikauppa_labels' );
if ( empty( $labels ) ) {
return;
}
// Get tracking codes
$tracking_codes = array();
foreach ( $labels as $label ) {
if ( ! empty( $label['tracking_code'] ) ) {
array_push(
$tracking_codes,
array(
'code' => $label['tracking_code'],
'url' => $label['tracking_url'],
'point' => $label['pickup_name'],
)
);
}
}
if ( empty( $tracking_codes ) ) {
return;
}
// Output
$add_pickup_point_to_email = 'yes'; // Change this to 'no' if needed
?><h2><?php esc_attr_e( 'Tracking', 'woo-pakettikauppa' ); ?></h2><?php
foreach ( $tracking_codes as $code ) {
?><p><?php
if ( 'yes' === $add_pickup_point_to_email ) {
if ( ! empty( $code['point'] ) ) {
?><b><?php esc_attr_e( 'Pickup point', 'woo-pakettikauppa' ); ?></b>
<?php esc_attr( $code['point'] ); ?><br/><?php
} else {
?><b><?php esc_attr_e( 'Pickup point', 'woo-pakettikauppa' ); ?> :</b> —<br/><?php
}
}
echo sprintf(
__( 'You can %1$s with tracking code %2$s.', 'woo-pakettikauppa' ),
'<a href="' . esc_url( $code['url'] ) . '">' . __( 'track your order', 'woo-pakettikauppa' ) . '</a>',
'<b>' . esc_attr( $code['code'] ) . '</b>'
);
?></p><?php
}
}, 10, 4 );
}
} );Please give it a try and let me know what you think. And if you like the plugin, please consider leaving me a rating.
Forum: Plugins
In reply to: [Order Status Rules for WooCommerce] hooks not fired on order complete emailHi, @simppa999,
I’ve checked your links, and I think I know why the meta is not being added. The “Posti Shipping” plugin adds the callback only in the backend (
is_admin()
function on the line 192 in theposti-shipping/core/class-core.php
file), and when our rules are processed by the cron job, theis_admin()
function returnsfalse
. To be sure, could you please try running our rules manually via the “Run all rules now” tool (in “WooCommerce > Settings > Order Status Rules > Tools”)? I think the meta will be added in this case.Forum: Plugins
In reply to: [Order Status Rules for WooCommerce] hooks not fired on order complete emailHi, @simppa999,
Our plugin calls the standard WooCommerce
update_status()
function, which fires all related hooks, so I believe that thewoocommerce_email_order_meta
hook you mentioned is also fired.However, this hook has only one callback –
order_meta()
function – and it depends on thewoocommerce_email_order_meta_fields
filter (or its deprecated version –woocommerce_email_order_meta_keys
). By default in WooCommerce, this filter doesn’t have any callbacks attached, i.e., there should be some custom code that adds fields there, otherwise nothing is added to the email. Do you know which plugin or custom code deals with thewoocommerce_email_order_meta
action, orwoocommerce_email_order_meta_fields
(orwoocommerce_email_order_meta_keys
) filter on your site? If so, could you please post the code?Forum: Plugins
In reply to: [Automated Stock Update Triggers for WooCommerce] Cancelled ordersHi, @naresh11381,
Happy to help ??
Forum: Reviews
In reply to: [Automated Stock Update Triggers for WooCommerce] Great pluginThank you, @naresh11381!
Forum: Plugins
In reply to: [Automated Stock Update Triggers for WooCommerce] Cancelled ordersHi, @naresh11381,
Sorry for not getting back to you sooner.
Please update the plugin to the latest v1.7.1. Then go to “WooCommerce > Settings > Stock Triggers > Admin” and set the “Admin new order” option to “Maybe decrease”. Now, orders by admin should restore the stock when canceled.
Please give it a try and let me know what you think.
Hi, @patriciasoares27,
Please try using our
[alg_wc_atcbl_translate]
shortcode when setting labels in the plugin settings, e.g.:[alg_wc_atcbl_translate lang="EN"]Text for EN[/alg_wc_atcbl_translate][alg_wc_atcbl_translate lang="DE"]Text for DE[/alg_wc_atcbl_translate][alg_wc_atcbl_translate not_lang="EN,DE"]Text for other languages[/alg_wc_atcbl_translate]
Please give it a try and let me know what you think.