WooCommerce API nodes for Node-RED

This commit is contained in:
2026-10-14 23:18:22 +02:00
commit e3b89fc74c
17 changed files with 1049 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
<script type="text/javascript">
RED.nodes.registerType("woocommerce-customer", {
category: "WooCommerce",
color: "#7f54b3",
defaults: {
name: { value: "" },
config: { type: "woocommerce-config", required: true },
operation: { value: "search" }
},
inputs: 1,
outputs: 1,
icon: "font-awesome/fa-users",
label: function () {
return this.name || ("WC Customer " + this.operation);
},
labelStyle: function () {
return this.name ? "node_label_italic" : "";
},
oneditprepare: function () {
$("#node-input-config").val(this.config ? this.config.id : "");
},
oneditsave: function () {
this.operation = $("#node-select-operation").val();
}
});
</script>
<script type="text/x-red" data-template-name="woocommerce-customer">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="WooCommerce Customer">
</div>
<div class="form-row">
<label for="node-input-config"><i class="fa fa-server"></i> Config</label>
<input type="text" id="node-input-config">
</div>
<div class="form-row">
<label for="node-select-operation"><i class="fa fa-wrench"></i> Operation</label>
<select id="node-select-operation">
<option value="search">Search by Email</option>
<option value="get">Get Customer by ID</option>
<option value="create">Create Customer</option>
</select>
</div>
<div class="form-tips" style="color:#888; font-size:11px; margin-top:10px;">
<b>Search</b>: msg.email – exact match on customer email<br>
<b>Get</b>: msg.customerId – WooCommerce user ID<br>
<b>Create</b>: msg.email, msg.firstname, msg.lastname, msg.billing, msg.shipping
</div>
</script>
<script type="text/x-red" data-help-name="woocommerce-customer">
<p>WooCommerce customer operations: search (by email), get, create.</p>
</script>