2026-10-14 23:18:22 +02:00
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
RED.nodes.registerType("woocommerce-config", {
|
|
|
|
|
|
category: "config",
|
|
|
|
|
|
defaults: {
|
|
|
|
|
|
name: { value: "" },
|
2026-10-14 23:21:16 +02:00
|
|
|
|
baseUrl: { value: "https://example.com/wp-json/wc/v3", required: true }
|
2026-10-14 23:18:22 +02:00
|
|
|
|
},
|
|
|
|
|
|
credentials: {
|
|
|
|
|
|
consumerKey: { type: "text" },
|
|
|
|
|
|
consumerSecret: { type: "password" }
|
|
|
|
|
|
},
|
|
|
|
|
|
label: function () {
|
|
|
|
|
|
return this.name || this.baseUrl || "WooCommerce";
|
|
|
|
|
|
},
|
|
|
|
|
|
labelStyle: function () {
|
|
|
|
|
|
return this.name ? "node_label_italic" : "";
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/x-red" data-template-name="woocommerce-config">
|
|
|
|
|
|
<div class="form-row">
|
|
|
|
|
|
<label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
|
|
|
|
<input type="text" id="node-config-input-name" placeholder="WooCommerce Config">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="form-row">
|
|
|
|
|
|
<label for="node-config-input-baseUrl"><i class="fa fa-server"></i> Base URL</label>
|
2026-10-14 23:21:16 +02:00
|
|
|
|
<input type="text" id="node-config-input-baseUrl" placeholder="https://example.com/wp-json/wc/v3">
|
2026-10-14 23:18:22 +02:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="form-row">
|
|
|
|
|
|
<label for="node-config-input-consumerKey"><i class="fa fa-key"></i> Consumer Key</label>
|
|
|
|
|
|
<input type="text" id="node-config-input-consumerKey" autocomplete="off">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="form-row">
|
|
|
|
|
|
<label for="node-config-input-consumerSecret"><i class="fa fa-lock"></i> Consumer Secret</label>
|
|
|
|
|
|
<input type="password" id="node-config-input-consumerSecret" autocomplete="off">
|
|
|
|
|
|
<div class="form-tips" style="color:#888; font-size:11px; margin-top:4px;">
|
|
|
|
|
|
Create API key at: WooCommerce → Settings → Advanced → REST API.<br>
|
|
|
|
|
|
Key must have <b>Read</b> permission (preferably Read/Write).<br>
|
|
|
|
|
|
User bound to key must be <b>Administrator</b> or equivalent.
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/x-red" data-help-name="woocommerce-config">
|
|
|
|
|
|
<p>WooCommerce REST API configuration node.</p>
|
|
|
|
|
|
<h3>Details</h3>
|
|
|
|
|
|
<p>Configure your WooCommerce store connection.</p>
|
|
|
|
|
|
<ul>
|
2026-10-14 23:21:16 +02:00
|
|
|
|
<li><b>Base URL</b> – Your WooCommerce REST API URL, e.g. <code>https://example.com/wp-json/wc/v3</code></li>
|
2026-10-14 23:18:22 +02:00
|
|
|
|
<li><b>Consumer Key</b> – From WooCommerce → Settings → Advanced → REST API</li>
|
|
|
|
|
|
<li><b>Consumer Secret</b> – Paired with Consumer Key</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
</script>
|