foreach ($item as $i) { $n_item++; $oi = array(); $pdata = $class_ean->getProductArticle($i->EAN); $oi['products_id'] = $pdata['products_id']; $oi['products_articles_id'] = $pdata['products_articles_id']; $oi['products_ean'] = $i->EAN; $oi['article_reference_number'] = $i->TB_ID; $oi['jng_sp_orders_id'] = $orders_id; $oi['article_number'] = $i->SKU; $oi['billing_text'] = $i->CHANNEL_SKU; $oi['order_quantity'] = $i->QUANTITY; $oi['delivery_time'] = $i->DELIVERY_TIME; $oi['delivery_replacement_time'] = 'null'; $oi['text'] = 'null'; $oi['price_received'] = !isset($i->TRANSFER_PRICE) || $i->TRANSFER_PRICE == 0 || $i->TRANSFER_PRICE == $i->ITEM_PRICE ? getPurchasePrice($i->ITEM_PRICE, $jng_sp_id) : $i->TRANSFER_PRICE; $oi['price'] = $i->ITEM_PRICE; $oi['order_item_count'] = $n_item; $oi['order_item_total'] = $n_items; foreach ($oi as $k => $v) { $oi[$k] = utf8_decode($v); } $oi_id = $class_jo->addItem($orders_id, $oi); logThis(" = ORDER ITEM ID {$oi_id} created"); $items_ids[] = $oi_id; $items_created++; } $class_jo->leadtimeSetStart($leadtime_start_date, '', $orders_id); } else { //FAILED TO CREATE NEW ORDER $existing_order = $class_jo->retrieveDetail(null, $o['order_id']);
break; case 'Paid Price': /* Now we used Unit Price as saved price, * Paid price will return zero when there voucher used by cust. $price = $cval; $price_after_provision = getPurchasePrice( $price, $jng_sp_id); */ break; case 'Unit Price': //this is the selling price, but when customer //use a special voucher, this will stay the same //while Paid Price is adjusted $price = $cval; $price_after_provision = getPurchasePrice($price, $jng_sp_id); break; case 'Wallet Credits': //not imported break; case 'Shipping Cost': $shipping_cost = $cval; break; case 'Voucher Amount': //not imported break; case 'Voucher Code': //not imported break; case 'Item Name': $billing_text = $cval;
// $content .= '</td></tr>'; // $content .= '<tr><td>'.$sp_detail['package_prefix'].' Price</td><td>'; // $content .= '<div>'; // $content .= '<input type="text" id="status_price" class="input2" name="price" value="'.$product_price.'" '.$price_style.' />'; // $content .= drawNeckermannButtons('status_price', $spinfo['status_price']); // $content .= '<div id="price_diff_notification" class="red"><small>'; // $content .= '! Catalog Price is higher then J&G Price !'; // $content .= '<br /><input id="removeshowroom" type="button" name="removeshowroom" value="Hide in J&G Website" />'; // $content .= '</small></div>'; // $content .= '<div id="price_diff_hidden" class="red"><small>This product is hidden in J&G Website because of price diff</small></div>'; // $content .= '</td></tr>'; $content .= '<tr><td>' . $sp_detail['package_prefix'] . ' Discount</td><td id="price_discount">' . round($discount, 1) . '%</td></tr>'; $jsprice = ''; } if ($jng_sp_id == '2') { $content .= '<tr><td>' . $sp_detail['package_prefix'] . ' Purchase Price</td><td>' . getPurchasePrice($product_price, $jng_sp_id) . '</td></tr>'; } $content .= '<tr><td colspan="2"> </td></tr>'; $content .= '<tr><td colspan="2"><strong>» <a href="?open=products-price&pids=' . $product_id . '&hidemenu=true" class="view_webpage">Click here to update price</a>!</strong></td></tr>'; /* $content .= '<tr><td>New Price</td><td>'; $content .= '<input type="text" id="price_new" class="input2" name="price_new" value="'.$product_price_new.'" />'; $content .= '</td></tr>'; $content .= '<tr><td>New Price Change</td><td>'; $content .= '<input type="text" id="price_new_start" class="input2" name="price_new_start" value="'.$product_price_new_start.'" />'; $content .= '</td></tr>'; */ $content .= '</table></div>'; $content .= '</div>'; $content .= '<div>'; $content .= '<h3><a href="#">Navigation Structure</a></h3>';
function generateXMLarticle($sp_detail, $p, $uselength = false) { global $deleted_eans, $deleted_eans_reported, $jng_sp_id; $result = ''; if (!in_array($p['products_ean'], $deleted_eans_reported)) { //only delete product if it is killed if ($p['products_active_status'] != '1') { $deleted_eans[] = $p['products_ean']; } else { //kill article if it's deactivated if (isset($p['article_status']) && $p['article_status'] == '0') { $deleted_eans[] = $p['products_ean']; } } //XML ARTICLES $result .= writeXMLopen('SKU', 3); if ($p['length'] != '' && $p['length'] != '0') { $result .= writeXMLline('Dimension2', textLength($p['length']) . ' Länge', 4); } $date_inv_start = ottodeDateFormat(date('Y-m-d H:i:s', strtotime($p['date_added']))); if ($p['active_status'] == '1' && (!isset($p['article_status']) || $p['article_status'] == '1')) { $date_inv_end_time = strtotime('+10 years'); } else { //deactivate products $date_inv_end_time = strtotime('+3 days'); } $date_inv_end = ottodeDateFormat(date('Y-m-d H:i:s', $date_inv_end_time)); $date_updated = ottodeDateFormat(date('Y-m-d H:i:s')); $price_old = $p['price_old'] == 0 ? $p['price'] : $p['price_old']; $result .= writeXMLline('InvoicingStartDate', $date_inv_start, 4); $result .= writeXMLline('InvoicingEndDate', $date_inv_end, 4); $result .= writeXMLline('SellingPrice', $p['price'], 4); $result .= writeXMLline('SellingPriceOld', $price_old, 4); $result .= writeXMLline('BuyingPrice', getPurchasePrice($p['price'], $jng_sp_id, $sp_detail), 4); $size = $p['length'] != '' && $p['length'] != '0' ? textLength($p['length'], false) : 'none'; $result .= writeXMLline('Size', $size, 4); $result .= writeXMLline('EAN', $p['products_ean'], 4); //In latest Warengruppen it seems that we can only use "neutral" //This means we can not use the existing gender information and //use a static value "neutral" instad. Updated by sahat on 02.07.2014 $result .= writeXMLline('Targetgroup', 'neutral', 4); //$result .= writeXMLline('ExpressDelivery', $p[''], 4); $result .= writeXMLclose('SKU', 3); } return $result; }