automatic budget approval
-
We work with your plugin for budgets and for some time now our code that interacted with your plugin for automatic budget approval no longer works. I thought it was my version of PHP but when validating on the plugin page I identified that the version is ok. Can you help me? The code apparently no longer works. See below for evaluation.
// Função para aprovar automaticamente o orçamento quando um novo pedido é criado
function approve_quotes_automatically($order_id) {
$security_nonce = wp_create_nonce(‘qwc-update-status-security’);
$security_nonce_send = wp_create_nonce(‘qwc-send-quote-security’);?> <script> jQuery(document).ready(function ($) { let order_id = '<?php echo $order_id;?>'; let security_nonce = '<?php echo $security_nonce;?>'; let security_nonce_send = '<?php echo $security_nonce_send;?>'; $.ajax({ type: 'POST', url: ajaxurl, data: { 'order_id': order_id, 'status': 'quote-complete', 'action': 'qwc_update_status', 'security_nonce': security_nonce }, success: function(response) { $.ajax({ type: 'POST', url: ajaxurl, data: { 'order_id': order_id, 'action': 'qwc_send_quote', 'security_nonce': security_nonce_send } }); } }); }); </script> <?php}
add_action(‘woocommerce_thankyou’, ‘approve_quotes_automatically’, 10, 1);
The topic ‘automatic budget approval’ is closed to new replies.