Quellcode durchsuchen

Publish Reverb listings immediately on create/update

Without publish=true the Reverb API saves listings as drafts, visible
in the seller dashboard but not in the public shop. Also add
has_inventory=true so Reverb treats the quantity field correctly for
stock-tracked listings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Benjamin Harris vor 2 Wochen
Ursprung
Commit
699b9d061f
1 geänderte Dateien mit 7 neuen und 5 gelöschten Zeilen
  1. 7 5
      upload/system/library/reverb/ProductMapper.php

+ 7 - 5
upload/system/library/reverb/ProductMapper.php

@@ -13,11 +13,13 @@ class ProductMapper {
         $currency = !empty($settings['currency']) ? $settings['currency'] : 'AUD';
 
         $payload = [
-            'title'       => $product['name'],
-            'description' => strip_tags($product['description']),
-            'sku'         => $product['model'],
-            'inventory'   => max(0, (int)$product['quantity']),
-            'price'       => [
+            'title'         => $product['name'],
+            'description'   => strip_tags($product['description']),
+            'sku'           => $product['model'],
+            'inventory'     => max(0, (int)$product['quantity']),
+            'has_inventory' => true,
+            'publish'       => true,
+            'price'         => [
                 'amount'   => number_format((float)$product['price'], 2, '.', ''),
                 'currency' => $currency,
             ],