Commit 04867f2e authored by Reinhold Kainhofer's avatar Reinhold Kainhofer

Implement widget to modify variable replacements

parent fa5f77ff
OpenTools Advanced Ordernumbers for WooCommerce - Open TODOs
============================================================
- Make sure the numbers are generated only for new orders, not for exsiting ones
- Check REST API
- Would it make sense to configure the order password format?
- Implement custom variables
- Find out how multisite works and make the plugin work with it
- Add action to create an updated / new order number for an existing order
- implement woocommerce_hidden_order_itemmeta hook to hide the order number post meta?
- Use $order->order_date for the date-relating fields!
- Collect and return php warning messages (i.e. all other output) in the AJAX call and return it inside the JSON rather than as extra HTML.
HOOKS for order handling:
woocommerce_new_order: FE new
woocommerce_checkout_update_order_meta: FE updated
woocommerce_checkout_order_processed: FE created, API created
woocommerce_process_shop_order_meta: API created, API updated, BE updated
woocommerce_api_create_order: API created
woocommerce_api_edit_order: API updated
woocommerce_create_order: // Give plugins the opportunity to create an order themselves
woocommerce_generate_order_key
woocommerce_order_class
woocommerce_order_status_changed
woocommerce_order_action_
wc_create_order( $order_data );
woocommerce_new_order', $order_id );
Order created in BackEnd:
Created: wp_insert_post => Assign placeholder (no address yet)
Modified:
\ No newline at end of file
......@@ -17,10 +17,10 @@ td.counter_value {
}
table.wc_ordernumber_counters thead > tr:nth-child(odd) > th,
table.wc_ordernumber_counters tfoot > td.addcounter_row > th {
table.wc_ordernumber_counters tfoot > tr.addcounter_row > td {
background: #E0E0E0;
}
table.wc_ordernumber_counters tbody > tr:nth-child(odd) > td {
table.wc_ordernumber_counters tbody > tr:nth-child(even) > td {
background: #F0F0F0;
}
.ordernumber-btn {
......
table.ordernumber_variables {
border: 1px solid #888888;
width: inherit;
}
table.ordernumber_variables td, table.ordernumber_variables th {
padding: 0px;
vertical-align: middle;
}
/* table.ordernumber_variables td.sort:before { */
/* float: none; */
/* display: inline-block; */
/* } */
table.ordernumber_variables thead th {
text-align: center;
width: auto;
}
td.counter_value {
text-align: center;
}
table.ordernumber_variables thead > tr:nth-child(odd) > th,
table.ordernumber_variables tfoot > tr.addreplacement_row > td {
background: #E0E0E0;
}
table.ordernumber_variables tbody > tr:nth-child(even) > td {
background: #F0F0F0;
}
table.ordernumber_variables tbody tr td input {
width: 120px;
}
.ordernumber-btn {
cursor: pointer;
}
table.ordernumber_variables img {
padding: 0;
margin: 0;
}
tr.rowhidden {
display: none;
}
\ No newline at end of file
var ordernumberVariablesAddRow = function (template, element) {
jQuery("#" + template + " tr").clone(true)
.appendTo("table#" + element + " tbody")
.find('input,select,button,img')
.removeAttr('disabled');
jQuery("tr#ordernumber-replacements-empty-row")
.addClass("rowhidden")
.find('input')
.attr('disabled', 'disabled');
}
jQuery(document).ready (function () {
jQuery('img.ordernumber-replacement-deletebtn').click(
function () {
jQuery(this).closest('tr').remove();
var count = jQuery(this).closest('table').find('tbody tr').length;
if (count==0) {
jQuery("tr#ordernumber-replacements-empty-row")
.removeClass("rowhidden")
.find('input,select,button,img')
.removeAttr('disabled');
}
}
);
});
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment