$data['internalid'], 'sku' => $data['itemid'], // 'type' => $data['includechildren'] ? 'configurable' : 'simple', // 'category' => $data['category'], 'name' => $data['displayname'] == '' ? $data['itemid'] : $data['displayname'], 'description' => $data['salesdescription'], 'status' => $data['isinactive'], // 'vendor' => $data['vendor'], // 'manufacturer' => $data['manufacturer'], 'upc' => $data['upccode'], // 'mpn' => $data['mpn'], // 'tax_class' => $data['taxschedule'], 'weight' => $data['weight'] ?? 1, // 'weight_unit' => $data['weightunit'], // 'cost' => $data['cost'], 'price' => $data['baseprice'] != '' ? $data['baseprice'] : 0, 'qty' => (int) ($data['locationquantityavailable'] ?? $data['quantityavailable'] ?? 0), 'locationId' => $data['inventorylocation'] ?? '', 'custitem_item_eol_for_sales' => $data['custitem_item_eol_for_sales'] ?? false, // 'is_in_stock' => ($data['quantityavailable'] ?? 0) > 0 ? 1 : 0, // 'created_at' => $data['createddate'], // 'updated_at' => $data['lastmodifieddate'] ]; } return $magentoData; } /** * Convert data from Magento format to NetSuite format. * * @param array $magentoData * @return array */ public function convertToNetSuiteFormat($magentoData) { // Your conversion logic here } }