private function runHelloCashPull(&$messages) { if (!defined('HELLOCASH_SYNC_IN_PROGRESS')) { define('HELLOCASH_SYNC_IN_PROGRESS', true); } $token = trim($this->params->get('api_token', '')); if (empty($token)) { $messages[] = "FEHLER: Kein API-Token konfiguriert."; return; } $db = JFactory::getDbo(); // 1. Auto-Mapping ausführen $this->runBulkAutoMapping($token, $db, $messages); // 2. Alle Mappings aus der DB laden (product_id => hellocash_id) $query = $db->getQuery(true) ->select(array($db->quoteName('product_id'), $db->quoteName('hellocash_id'))) ->from($db->quoteName('#__hikashop_hellocash_map')); $db->setQuery($query); $mappings = $db->loadObjectList(); if (empty($mappings)) { $messages[] = "Keine verknüpften Artikel vorhanden."; return; } $hcToHikaMap = array(); foreach ($mappings as $m) { $hcToHikaMap[(int)$m->hellocash_id] = (int)$m->product_id; } $updatedCount = 0; $headers = array("Authorization: Bearer " . $token, "Accept: application/json"); // 3. Bestände seitenweise von helloCash abrufen (100 Artikel pro Request) for ($page = 1; $page <= 25; $page++) { $url = "https://api.hellocash.business/api/v2/articles?limit=100&page=" . $page; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($httpCode == 429) { usleep(1500000); $page--; continue; } if ($httpCode != 200 || empty($response)) { break; } $data = json_decode($response, true); $articles = isset($data['data']) ? $data['data'] : (is_array($data) ? $data : array()); if (empty($articles)) { break; } foreach ($articles as $art) { $hcId = isset($art['id']) ? (int)$art['id'] : 0; if ($hcId <= 0 || !isset($hcToHikaMap[$hcId])) { continue; } $stock = null; if (isset($art['stocks'])) $stock = (int)$art['stocks']; elseif (isset($art['stock'])) $stock = (int)$art['stock']; if ($stock !== null) { $pId = $hcToHikaMap[$hcId]; $updateQuery = $db->getQuery(true) ->update($db->quoteName('#__hikashop_product')) ->set($db->quoteName('product_quantity') . ' = ' . $stock) ->where($db->quoteName('product_id') . ' = ' . $pId); $db->setQuery($updateQuery); try { $db->execute(); $updatedCount++; } catch (Exception $e) {} } } if (count($articles) < 100) { break; } usleep(100000); } // Kompakte Erfolgsmeldung ohne unendliche Einzelausgaben $messages[] = "SYNC FERTIG: Insgesamt " . $updatedCount . " Artikelbestände von helloCash nach HikaShop synchronisiert."; } https://shop.messer-schleifen.tirol/Category/kochmesser/type-atom 2026-11-05T21:03:14+00:00 MYOB ZB-06 Nakirimesser, 17 cm 2026-01-22T14:51:40+00:00 2026-01-22T14:51:40+00:00 https://shop.messer-schleifen.tirolhttps://shop.messer-schleifen.tirol/index.php?option=com_hikashop&ctrl=product&task=show&cid=6583&name=zb-06-nakirimesser-17-cm&Itemid=102&category_pathway=137 <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/ZB-06.jpg"/></td><td><p><strong>Klingenlänge:</strong> 17 cm<br /><strong>Klingenmaterial:</strong> SPG STRIX Stahl<br /><strong>Klingenhärte:</strong> 65 ± HRC<br /><strong>Griff:</strong> Ergonomischer Griff aus verschiedenfarbigem Pakkaholz<br /><strong>Schliff:</strong> Extrem scharf, beidseitig geschliffen<br /><strong>Design:</strong> Japanische Handwerkskunst in moderner Ausführung</p> <p> </p>Preis : 307,12 €</td></tr></table> <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/ZB-06.jpg"/></td><td><p><strong>Klingenlänge:</strong> 17 cm<br /><strong>Klingenmaterial:</strong> SPG STRIX Stahl<br /><strong>Klingenhärte:</strong> 65 ± HRC<br /><strong>Griff:</strong> Ergonomischer Griff aus verschiedenfarbigem Pakkaholz<br /><strong>Schliff:</strong> Extrem scharf, beidseitig geschliffen<br /><strong>Design:</strong> Japanische Handwerkskunst in moderner Ausführung</p> <p> </p>Preis : 307,12 €</td></tr></table> ZB-05 Bunkamesser, 16,5 cm 2026-01-22T14:51:40+00:00 2026-01-22T14:51:40+00:00 https://shop.messer-schleifen.tirolhttps://shop.messer-schleifen.tirol/index.php?option=com_hikashop&ctrl=product&task=show&cid=6582&name=zb-05-bunkamesser-16-5-cm&Itemid=102&category_pathway=137 <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/ZB-05.jpg"/></td><td><p><strong>Hersteller:</strong> Suncraft<br /><strong>Modell:</strong> Senzo Black ZB-05<br /><strong>Messertyp:</strong> Bunkamesser<br /><strong>Klingenlänge:</strong> 16,5 cm<br /><strong>Klingenmaterial:</strong> San Mai, 3-Lagen Stahl Messer, SPG STRIX Klingenkern , 65±1 HRC, japanischer V-Schliff, rostfrei<br /><strong>Griffmaterial:</strong> Oktagonal, Pakkaholz, mehrfarbig</p>Preis : 329,00 €</td></tr></table> <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/ZB-05.jpg"/></td><td><p><strong>Hersteller:</strong> Suncraft<br /><strong>Modell:</strong> Senzo Black ZB-05<br /><strong>Messertyp:</strong> Bunkamesser<br /><strong>Klingenlänge:</strong> 16,5 cm<br /><strong>Klingenmaterial:</strong> San Mai, 3-Lagen Stahl Messer, SPG STRIX Klingenkern , 65±1 HRC, japanischer V-Schliff, rostfrei<br /><strong>Griffmaterial:</strong> Oktagonal, Pakkaholz, mehrfarbig</p>Preis : 329,00 €</td></tr></table> ZB-04 Kochmesser, 21 cm 2026-01-22T14:51:40+00:00 2026-01-22T14:51:40+00:00 https://shop.messer-schleifen.tirolhttps://shop.messer-schleifen.tirol/index.php?option=com_hikashop&ctrl=product&task=show&cid=6581&name=zb-04-kochmesser-21-cm&Itemid=102&category_pathway=137 <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/ZB-04.jpg"/></td><td><p><strong>Hersteller:</strong> Suncraft<br /><strong>Modell:</strong> Senzo Black ZB-04<br /><strong>Messertyp:</strong> Japanisches Kochmesser<br /><strong>Klingenlänge:</strong> 21 cm<br /><strong>Klingenmaterial:</strong> San Mai, 3-Lagen Stahl Messer, SPG STRIX Klingenkern , 65±1 HRC, japanischer V-Schliff, rostfrei<br /><strong>Griffmaterial:</strong> Oktagonal, Pakkaholz, mehrfarbig</p>Preis : 349,00 €</td></tr></table> <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/ZB-04.jpg"/></td><td><p><strong>Hersteller:</strong> Suncraft<br /><strong>Modell:</strong> Senzo Black ZB-04<br /><strong>Messertyp:</strong> Japanisches Kochmesser<br /><strong>Klingenlänge:</strong> 21 cm<br /><strong>Klingenmaterial:</strong> San Mai, 3-Lagen Stahl Messer, SPG STRIX Klingenkern , 65±1 HRC, japanischer V-Schliff, rostfrei<br /><strong>Griffmaterial:</strong> Oktagonal, Pakkaholz, mehrfarbig</p>Preis : 349,00 €</td></tr></table> ZB-03 Santokumesser, 17 cm 2026-01-22T14:51:40+00:00 2026-01-22T14:51:40+00:00 https://shop.messer-schleifen.tirolhttps://shop.messer-schleifen.tirol/index.php?option=com_hikashop&ctrl=product&task=show&cid=6580&name=zb-03-santokumesser-17-cm&Itemid=102&category_pathway=137 <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/ZB-03.jpg"/></td><td><p><strong>Hersteller:</strong> Suncraft<br /><strong>Modell:</strong> Senzo Black ZB-03<br /><strong>Messertyp:</strong> Japanisches Kochmesser<br /><strong>Klingenlänge:</strong> 17 cm<br /><strong>Klingenmaterial:</strong> San Mai, 3-Lagen Stahl Messer, SPG STRIX Klingenkern , 65±1 HRC, japanischer V-Schliff, rostfrei<br /><strong>Griffmaterial:</strong> Oktagonal, Pakkaholz, mehrfarbig</p>Preis : 289,52 €</td></tr></table> <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/ZB-03.jpg"/></td><td><p><strong>Hersteller:</strong> Suncraft<br /><strong>Modell:</strong> Senzo Black ZB-03<br /><strong>Messertyp:</strong> Japanisches Kochmesser<br /><strong>Klingenlänge:</strong> 17 cm<br /><strong>Klingenmaterial:</strong> San Mai, 3-Lagen Stahl Messer, SPG STRIX Klingenkern , 65±1 HRC, japanischer V-Schliff, rostfrei<br /><strong>Griffmaterial:</strong> Oktagonal, Pakkaholz, mehrfarbig</p>Preis : 289,52 €</td></tr></table> ZB-02 Universalmesser, 13 cm 2026-01-22T14:51:40+00:00 2026-01-22T14:51:40+00:00 https://shop.messer-schleifen.tirolhttps://shop.messer-schleifen.tirol/index.php?option=com_hikashop&ctrl=product&task=show&cid=6579&name=zb-02-universalmesser-13-cm&Itemid=102&category_pathway=137 <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/ZB-02.jpg"/></td><td><p><strong>Hersteller:</strong> Suncraft<br /><strong>Modell:</strong> Senzo Black ZB-02<br /><strong>Messertyp:</strong> Universalmesser<br /><strong>Klingenlänge:</strong> 13 cm<br /><strong>Klingenmaterial:</strong> San Mai, 3-Lagen Stahl Messer, SPG STRIX Klingenkern , 65±1 HRC, japanischer V-Schliff, rostfrei<br /><strong>Griffmaterial:</strong> Oktagonal, Pakkaholz, mehrfarbig</p>Preis : 223,00 €</td></tr></table> <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/ZB-02.jpg"/></td><td><p><strong>Hersteller:</strong> Suncraft<br /><strong>Modell:</strong> Senzo Black ZB-02<br /><strong>Messertyp:</strong> Universalmesser<br /><strong>Klingenlänge:</strong> 13 cm<br /><strong>Klingenmaterial:</strong> San Mai, 3-Lagen Stahl Messer, SPG STRIX Klingenkern , 65±1 HRC, japanischer V-Schliff, rostfrei<br /><strong>Griffmaterial:</strong> Oktagonal, Pakkaholz, mehrfarbig</p>Preis : 223,00 €</td></tr></table> ZB-01 Schälmesser, 10 cm 2026-01-22T14:51:40+00:00 2026-01-22T14:51:40+00:00 https://shop.messer-schleifen.tirolhttps://shop.messer-schleifen.tirol/index.php?option=com_hikashop&ctrl=product&task=show&cid=6578&name=zb-01-schaelmesser-10-cm&Itemid=102&category_pathway=137 <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/ZB-01.jpg"/></td><td><p><strong>Hersteller:</strong> Suncraft<br /><strong>Modell:</strong> Senzo Black ZB-01<br /><strong>Messertyp:</strong> Gemüsemesser<br /><strong>Klingenlänge:</strong> 10 cm<br /><strong>Klingenmaterial:</strong> San Mai, 3-Lagen Stahl Messer, SPG STRIX Klingenkern , 65±1 HRC, japanischer V-Schliff, rostfrei<br /><strong>Griffmaterial:</strong> Oktagonal, Pakkaholz, mehrfarbig</p>Preis : 210,00 €</td></tr></table> <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/ZB-01.jpg"/></td><td><p><strong>Hersteller:</strong> Suncraft<br /><strong>Modell:</strong> Senzo Black ZB-01<br /><strong>Messertyp:</strong> Gemüsemesser<br /><strong>Klingenlänge:</strong> 10 cm<br /><strong>Klingenmaterial:</strong> San Mai, 3-Lagen Stahl Messer, SPG STRIX Klingenkern , 65±1 HRC, japanischer V-Schliff, rostfrei<br /><strong>Griffmaterial:</strong> Oktagonal, Pakkaholz, mehrfarbig</p>Preis : 210,00 €</td></tr></table> TO-07 Sashimimesser 21 cm 2026-01-22T14:51:40+00:00 2026-01-22T14:51:40+00:00 https://shop.messer-schleifen.tirolhttps://shop.messer-schleifen.tirol/index.php?option=com_hikashop&ctrl=product&task=show&cid=6577&name=to-07-sashimimesser-21-cm&Itemid=102&category_pathway=136 <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/6736.jpg"/></td><td>Preis : 248,00 €</td></tr></table> <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/6736.jpg"/></td><td>Preis : 248,00 €</td></tr></table> TO-06 Kochmesser 24 cm 2026-01-22T14:51:40+00:00 2026-01-22T14:51:40+00:00 https://shop.messer-schleifen.tirolhttps://shop.messer-schleifen.tirol/index.php?option=com_hikashop&ctrl=product&task=show&cid=6576&name=to-06-kochmesser-24-cm&Itemid=102&category_pathway=136 <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/6735.jpg"/></td><td>Preis : 299,00 €</td></tr></table> <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/6735.jpg"/></td><td>Preis : 299,00 €</td></tr></table> TO-05 Kochmesser 20 cm 2026-01-22T14:51:40+00:00 2026-01-22T14:51:40+00:00 https://shop.messer-schleifen.tirolhttps://shop.messer-schleifen.tirol/index.php?option=com_hikashop&ctrl=product&task=show&cid=6575&name=to-05-kochmesser-20-cm&Itemid=102&category_pathway=136 <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/6734.jpg"/></td><td>Preis : 284,00 €</td></tr></table> <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/6734.jpg"/></td><td>Preis : 284,00 €</td></tr></table> TO-04 Santokumesser 16,7 cm 2026-01-22T14:51:40+00:00 2026-01-22T14:51:40+00:00 https://shop.messer-schleifen.tirolhttps://shop.messer-schleifen.tirol/index.php?option=com_hikashop&ctrl=product&task=show&cid=6574&name=to-04-santokumesser-16-7-cm&Itemid=102&category_pathway=136 <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/6733.jpg"/></td><td>Preis : 269,00 €</td></tr></table> <table><tr><td><img src="https://shop.messer-schleifen.tirol/images/com_hikashop/upload/thumbnails/150x150/6733.jpg"/></td><td>Preis : 269,00 €</td></tr></table>