本文整理汇总了PHP中Settings::get_import_settings方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::get_import_settings方法的具体用法?PHP Settings::get_import_settings怎么用?PHP Settings::get_import_settings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings
的用法示例。
在下文中一共展示了Settings::get_import_settings方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process_xml
public function process_xml($type = "FOR_INSERT")
{
global $logger, $db;
$this->store_products = $this->get_imported($this->name);
$this->import_settings = Settings::get_import_settings($this->name);
$fh = @fopen(FEED_PATH . "dealerpricelist.csv", "r");
$art = fgetcsv($fh, null, ",");
$i = 0;
$bz = 0;
$this->all = 0;
return array();
while (($art = fgetcsv($fh, null, ",")) !== false) {
$sku = (string) trim($art[1]);
$store_product_id = @$this->store_products[$sku];
$this->all++;
if ($type == "FOR_INSERT" && $store_product_id) {
continue;
}
if ($type == "FOR_UPDATE" && !$store_product_id) {
continue;
}
$item = new stdClass();
$item->sku = $sku;
$catname = ($art[8] != "" ? $art[8] : "") . ($art[9] != "" ? " > " . $art[9] : "") . ($art[10] != "" ? " > " . $art[10] : "");
$catnametext = str_replace("\"", "``", $catname);
$catnametext = str_replace("\"", "``", $catnametext);
$catnametext = str_replace("'", "`", $catnametext);
$item->category_XML = $catnametext;
if (@$this->category_mapping[$item->category_XML]) {
foreach ($this->category_mapping[$item->category_XML] as $catstore) {
// $d = $this->get_ps_category_ancestors($catstore);
// dump($d);exit;
// $item->category_ids[] = $this->get_ps_category_ancestors($catstore);
$item->category_ids[] = (int) $catstore;
}
}
if (@count($item->category_ids) == 0) {
// echo $bz++ . ". {$sku} NO CATEGORY ({$item->category_XML}) <Br>";
continue;
}
//$item->category_ids = array_unique($item->category_ids);
// dump($item->category_ids) ;exit;
// part number
// dump(explode(",",$this->import_settings['NOT_IMPORT_NAME']));exit;
//if (in_array($item->sku, explode(",",$this->import_settings['NOT_IMPORT_SKU']))) continue;
// 33,34
$item->quantity = (int) $art[7];
if (!$item->quantity) {
// echo $bz2++ . ". {$sku} QTY=0<Br>";
continue;
}
// if ($item->quantity < 10 ) continue;
// if ($item->quantity < 10) continue;
$item->title = $art[2];
$item->desc_short = ImpLib::limitString($art[3]);
$item->meta_desc = ImpLib::limitString($art[3]);
$item->tags = "";
$item->meta_keywords = "";
$item->desc_long = $art[3];
$item->vendor = $art[0];
$item->plant = $art[0];
$item->manufacturer = $art[0];
$item->manufacturer_sku = $art[1];
//$item->supplier_reference = $art[3];
$item->manufacturer_sku_2 = $art[4];
$item->store_product_id = $store_product_id;
$item->supplier = "Dove";
// if ($type=="FOR_INSERT") {
// $item->id_manufacturer = $this->get_manufacturer_id($item->manufacturer);
// $item->manufacturer_id = $item->id_manufacturer;
// }
$item->ean_upc = (string) $art[13];
$item->price = (double) $art[6];
// $item->rrp = (float) (str_replace("$", "", $art[3]));;
$item->raw_price = $item->price;
if ($item->price < 0.1) {
continue;
}
// echo Settings::get_margin_from_price($item->price);exit;
$margin = @$this->import_settings['MARGIN'][$item->category_XML];
// dump($this->import_settings['MARGIN']);exit;
//dump($this->import_settings);
$item->margin = $margin > 0 ? $margin : (int) $this->import_settings['GLOBALPROFITMARGIN'];
// dump($item);exit;
/// $item->margin = ($margin !="") ? $margin : Settings::get_margin_from_price($item->price);
$item->price_raw = $item->price;
$item->price = $item->price * (1 + $item->margin / 100);
$item->price = $item->price;
$item->wholesale_price = $item->price_raw;
$item->weight = "";
$item->length = "";
$item->width = "";
$item->height = "";
$item->active = 1;
$item->_regular_price = $item->price;
$item->_sale_price = "";
$item->status = 1;
$item->images = array();
if ($art[11] != "") {
$item->images[] = $art[11];
//.........这里部分代码省略.........
示例2: process_xml
public function process_xml($type = "FOR_INSERT")
{
global $logger, $db;
$this->store_products = $this->get_imported($this->name);
$this->import_settings = Settings::get_import_settings($this->name);
$fh = @fopen(FEED_PATH . "CDL EPricefile.csv", "r");
$art = fgetcsv($fh, null, ",");
$i = 0;
$bz = 0;
$this->all = 0;
// dump($art);
while (($art = fgetcsv($fh, null, ",")) !== false) {
$sku = (string) trim($art[0]);
$sku = str_replace("\\", "-", $sku);
// dump($art);exit;
$store_product_id = @$this->store_products[$sku];
$this->all++;
if ($type == "FOR_INSERT" && $store_product_id) {
continue;
}
if ($type == "FOR_UPDATE" && !$store_product_id) {
continue;
}
$item = new stdClass();
$item->sku = $sku;
$item->category_XML = $art[3];
if (@$this->category_mapping[$item->category_XML]) {
foreach ($this->category_mapping[$item->category_XML] as $catstore) {
// $d = $this->get_ps_category_ancestors($catstore);
// dump($d);exit;
// $item->category_ids[] = $this->get_ps_category_ancestors($catstore);
$item->category_ids[] = (int) $catstore;
}
}
if (@count($item->category_ids) == 0) {
// echo $bz++ . ". {$sku} NO CATEGORY ({$item->category_XML}) <Br>";
continue;
}
$item->quantity = (int) $art[10];
if (!$item->quantity) {
// echo $bz2++ . ". {$sku} QTY=0<Br>";
continue;
}
// if ($item->quantity < 10 ) continue;
// if ($item->quantity < 10) continue;
$item->title = $art[2];
$item->desc_short = ImpLib::limitString($art[2]);
$item->meta_desc = ImpLib::limitString($art[2]);
$item->tags = "";
$item->meta_keywords = "";
$item->desc_long = $art[2];
$item->vendor = $art[4];
$item->plant = $art[4];
$item->manufacturer = $art[4];
$item->manufacturer_sku = $art[0];
//$item->supplier_reference = $art[3];
$item->manufacturer_sku_2 = $art[0];
$item->store_product_id = $store_product_id;
$item->supplier = "CDL";
// if ($type=="FOR_INSERT") {
// $item->id_manufacturer = $this->get_manufacturer_id($item->manufacturer);
// $item->manufacturer_id = $item->id_manufacturer;
// }
$item->ean_upc = "";
$item->price = (double) $art[9];
// $item->rrp = (float) (str_replace("$", "", $art[3]));;
$item->raw_price = $item->price;
if ($item->price < 0.1) {
continue;
}
// echo Settings::get_margin_from_price($item->price);exit;
$margin = @$this->import_settings['MARGIN'][$item->category_XML];
// dump($this->import_settings['MARGIN']);exit;
//dump($this->import_settings);
$item->margin = $margin > 0 ? $margin : (int) $this->import_settings['GLOBALPROFITMARGIN'];
// dump($item);exit;
/// $item->margin = ($margin !="") ? $margin : Settings::get_margin_from_price($item->price);
$item->price_raw = $item->price;
$item->price = $item->price * (1 + $item->margin / 100);
$item->_regular_price = $item->price;
$item->wholesale_price = $item->price_raw;
$item->weight = "";
$item->length = "";
$item->width = "";
$item->_sale_price = "";
$item->_wc_cog_cost = "";
$item->height = "";
$item->active = 1;
$item->status = 1;
$item->images = array();
$imgfile = IMPORT_ABS_PATH . "/CDL_temp_/Jpegs/" . str_replace("-", "", strtolower($item->sku)) . ".jpg";
if (@filesize($imgfile) > 100) {
$item->images = "http://www.bestdirect.co.nz/CDL_temp_/Jpegs/" . str_replace("-", "", strtolower($item->sku)) . ".jpg";
// dump($item);exit;
}
// dump($imgfile);exit;
if ($sku == "A-U2AFMICBM") {
// dump($item);
// dump($art);
// exit;
//.........这里部分代码省略.........
示例3: displayCategoryMappingTool
public static function displayCategoryMappingTool()
{
global $b2b, $AUTOMAP, $logger, $db, $iconf;
$b2b->import_settings = Settings::get_import_settings($b2b->name);
?>
<table border="0" cellpadding="0" cellspacing="0" width="1200">
<tr class='tableheader2' style="display: none;"><td colspan="3">Category Mapping Tool
<div class="info1"><img src="<?php
echo IMPORT_BASE_URL . IMPORT_PATH;
?>
/assets/info.png" /></div>
</td></tr>
<tr class='tableheader'><td width='650'><?php
echo _t("Supplier's category");
?>
</td><?php
foreach ($iconf['SettingsPerCategory'] as $colname => $sett) {
echo "<td>{$colname}</td>";
}
?>
<td width='30'></td><td width='550'><?php
echo _t("Store category");
?>
</td></tr>
<?php
$store_categories = $b2b->get_store_categories();
$b2b->store_categories_simple = $b2b->get_store_categories_simple();
echo Settings::get_selector($store_categories, 0, 0);
// $category_mapping = $b2b->get_category_mapping_tree();
if ($AUTOMAP) {
$category_mapping = $b2b->get_category_mapping_tree();
} else {
$category_mapping = $b2b->get_category_mapping_tree();
}
$b2b->import_category_mapping = Settings::get_category_mappings($b2b->name);
if (isset($b2b->import_category_mapping)) {
foreach ($b2b->import_category_mapping as $feed_category_id => $store_category_ids) {
foreach ($store_category_ids as $store_category_id) {
if (!isset($b2b->store_categories_simple[$store_category_id])) {
// the mapped category not exists
$db->query("DELETE FROM import_category_settings WHERE store_category_id='{$store_category_id}'");
$logger->LogCron(" - REMOVED store_category {$store_category_id} from settings.");
}
}
}
}
$b2b->import_category_mapping = Settings::get_category_mappings($b2b->name);
foreach ($category_mapping as $cm) {
if (!isset($cm['id'])) {
continue;
}
$id = $cm['id'];
if (!$id) {
continue;
}
if (strlen($cm['name']) < 2) {
continue;
}
$feed_category_id_from_settings = $selectors = "";
if (@$b2b->import_category_mapping[$id]) {
foreach ($b2b->import_category_mapping[$id] as $feed_category_id_from_settings) {
$selectors .= Settings::get_virtual_selector($b2b->store_categories_simple, $feed_category_id_from_settings, $id) . "<br />";
}
}
$b2b->parent_feed_category_id_from_settings = @$feed_category_id_from_settings;
if (!@$selectors) {
$selectors = Settings::get_virtual_selector($b2b->store_categories_simple, $feed_category_id_from_settings, $id);
}
// alespon choose
$addcatmap = '<div class="addcatmap" feedID="' . $id . '" >+</div>';
// $selector = Settings::get_virtual_selector($b2b->store_categories_simple, $feed_category_id_from_settings, $id);
$button_add_new_category = $feed_category_id_from_settings == "" || $feed_category_id_from_settings == "0" ? '<span class="new_cat_mapped" newcatname="' . addslashes(str_replace("\"", "'", $cm['name'])) . '" newcatid="' . $id . '" newparentid="0" >=></span>' : "";
if (@$b2b->feed_category_counts[$id]) {
$count = "(" . $b2b->feed_category_counts[$id] . ")";
} else {
$count = "";
}
$p2dset = "";
if (isset($iconf['SettingsCategoryProducts'])) {
foreach ($iconf['SettingsCategoryProducts'] as $setTitle => $setValues) {
$p2dset .= "<div class='p2dset p2dset_{$setValues['code']}' category_feed_id='{$id}' SetTitle='{$setTitle}' product_settings_type='{$setValues['code']}'><img src='" . IMPORT_BASE_URL . IMPORT_PATH . "/assets/{$setValues['icon']}' alt='{$setTitle}' /></div><div opened='0' class='p2dset_{$setValues['code']}_{$id} p2dsetbox'></div>";
}
}
echo "<tr class='trmaincategory'><td class='maincategory'><h4 class='h4s'>" . $cm['name'] . " {$count}</h4><span class='corner'>{$p2dset}</span><div style='clear:both'></div></td>";
foreach ($iconf['SettingsPerCategory'] as $colname => $sett) {
echo "<td><input class='{$sett['class']}' code='{$sett['code']}' type='text' category_feed_id='{$id}' value='" . (@$b2b->import_settings[$sett['code']][$id] != "" ? $b2b->import_settings[$sett['code']][$id] : "") . "' size='{$sett['size']}'></td>";
}
echo "<td>{$button_add_new_category} {$addcatmap}</td><td class='selectors_{$id}'>{$selectors}</td></tr>";
if ($AUTOMAP && ($feed_category_id_from_settings == "" || $feed_category_id_from_settings == "0")) {
Settings::automapCategory($cm['name'], $id);
}
if (isset($cm['sub'])) {
// Settings::_printSubCats($cm['sub']);
}
}
?>
</table>
<script language="JavaScript">
//.........这里部分代码省略.........
示例4:
<?php
$import_settings = Settings::get_import_settings($b2b->name);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="<?php
echo IMPORT_BASE_URL . IMPORT_PATH;
?>
/assets/jquery.js"></script>
<script type="text/javascript" src="<?php
echo IMPORT_BASE_URL . IMPORT_PATH;
?>
/assets/jquery.bpopup.min.js"></script>
<script type="text/javascript" src="<?php
echo IMPORT_BASE_URL . IMPORT_PATH;
?>
/assets/jquery.hashchange.min.js"></script>
<script type="text/javascript" src="<?php
echo IMPORT_BASE_URL . IMPORT_PATH;
?>
/assets/jquery.easytabs.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?php
echo IMPORT_BASE_URL . IMPORT_PATH;
?>
/assets/style.min.css" />
</head>
<body>
<h1><?php
示例5: process_xml
public function process_xml($type = "FOR_INSERT")
{
global $logger, $db;
$this->store_products = $this->get_imported($this->name);
$this->updatedIceCatItems = IceCat::getUpdatedIceCatItemsOK();
$this->import_settings = Settings::get_import_settings($this->name);
$fh = @fopen(FEED_PATH . $this->name . ".csv", "r");
$art = fgetcsv($fh, null, "|");
// dump($art) ;
$i = 0;
$bz = 0;
$this->all = 0;
while (($art = fgetcsv($fh, null, "|")) !== false) {
$sku = (string) trim($art[1]);
// 0
$store_product_id = @$this->store_products[$sku];
$this->all++;
if ($type == "FOR_INSERT" && $store_product_id) {
continue;
}
if ($type == "FOR_UPDATE" && !$store_product_id) {
continue;
}
// continue;
$item = new stdClass();
$item->sku = $sku;
$item->category_XML = $art[10];
// 4
// $logger->
if (@$this->category_mapping[$item->category_XML]) {
foreach ($this->category_mapping[$item->category_XML] as $catstore) {
$d = $this->get_category_ancestors($catstore);
// dump($d);exit;
if ($d != 0) {
//dump($d);
foreach ($d as $cc) {
$item->category_ids[] = (int) $cc;
}
}
$item->category_ids[] = (int) $catstore;
}
}
if (@count($item->category_ids) == 0) {
//echo $bz++ . ". {$sku} NO CATEGORY ({$item->category_XML}) <Br>";
continue;
}
//$item->category_ids = array_unique($item->category_ids);
// dump($item->category_ids) ;exit;
// part number
// dump(explode(",",$this->import_settings['NOT_IMPORT_NAME']));exit;
//if (in_array($item->sku, explode(",",$this->import_settings['NOT_IMPORT_SKU']))) continue;
// 33,34
$item->quantity = (int) $art[11];
// 7
if (!$item->quantity) {
continue;
}
if ($item->quantity < 10) {
continue;
}
// if ($item->quantity < 10) continue;
$item->title = $art[4];
// 3
$item->desc_short = ImpLib::limitString($art[4]);
// 3
$item->meta_desc = ImpLib::limitString($art[4]);
// 3
$item->meta_keywords = ImpLib::limitString($art[4]);
$item->tags = ImpLib::limitString($art[4]);
$item->desc_long = $art[4];
$item->vendor = $art[2];
$item->plant = $art[2];
$item->manufacturer = $art[2];
// 1
$item->manufacturer_sku = $art[3];
// 2
//$item->supplier_reference = $art[3];
$item->manufacturer_sku_2 = $art[0];
$item->store_product_id = $store_product_id;
$item->supplier = "SY";
// if ($type=="FOR_INSERT") {
$item->manufacturer_id = $this->get_manufacturer_id($item->manufacturer);
// }
$item->ean_upc = "";
$item->price = (double) str_replace("\$", "", $art[7]);
$item->rrp = (double) str_replace("\$", "", $art[7]);
$item->raw_price = $item->price;
if ($item->price < 0.1) {
continue;
}
// echo Settings::get_margin_from_price($item->price);exit;
$margin = @$this->import_settings['MARGIN'][$item->category_XML];
// dump($this->import_settings['MARGIN']);exit;
//dump($this->import_settings);
$item->margin = $margin > 0 ? $margin : (int) $this->import_settings['GLOBALPROFITMARGIN'];
// dump($item);exit;
/// $item->margin = ($margin !="") ? $margin : Settings::get_margin_from_price($item->price);
$item->price_raw = $item->price;
$item->price = $item->price * (1 + $item->margin / 100);
// $item->price = $item->price ;
//.........这里部分代码省略.........
示例6: process_xml
public function process_xml($type = "FOR_INSERT")
{
global $logger, $db;
$this->store_products = $this->get_imported($this->name);
$this->updatedIceCatItems = IceCat::getUpdatedIceCatItemsOK();
$this->import_settings = Settings::get_import_settings($this->name);
$cached_ancestors = array();
$fh = @fopen(FEED_PATH . "/215841.csv", "r");
$art = fgetcsv($fh, null, "\t");
// dump($art) ;
$i = 0;
$bz = 0;
$this->all = 0;
while (($art = fgetcsv($fh, null, ",")) !== false) {
// dump($art);exit;
$sku = (int) trim($art[0]);
if ($sku == "1520519") {
continue;
}
$store_product_id = @$this->store_products[$sku];
$this->all++;
if ($type == "FOR_INSERT" && $store_product_id) {
continue;
}
if ($type == "FOR_UPDATE" && !$store_product_id) {
continue;
}
// exit;
if ($type == "FOR_UPDATE") {
// if ( !$this->updatedIceCatItems[$sku] ) continue;
}
$item = new stdClass();
$item->category_XML = $art[12];
if (@$this->category_mapping[$item->category_XML]) {
foreach ($this->category_mapping[$item->category_XML] as $catstore) {
if (isset($cached_ancestors[$catstore])) {
$d = $cached_ancestors[$catstore];
} else {
// $logger->LogCron(" - $catstore");
$cached_ancestors[$catstore] = $this->get_category_ancestors($catstore);
$d = $cached_ancestors[$catstore];
// $logger->LogCron(" - ok => " . print_r($d, true));
}
// dump($d);exit;
foreach ($d as $cc) {
$item->category_ids[] = (int) $cc;
}
$item->category_ids[] = (int) $catstore;
}
}
if (@count($item->category_ids) == 0) {
//echo $bz++ . ". {$sku} NO CATEGORY ({$item->category_XML}) <Br>";
continue;
}
//$item->category_ids = array_unique($item->category_ids);
// dump($item->category_ids) ;exit;
$item->sku = $sku;
// part number
// dump(explode(",",$this->import_settings['NOT_IMPORT_NAME']));exit;
//if (in_array($item->sku, explode(",",$this->import_settings['NOT_IMPORT_SKU']))) continue;
// 33,34
$item->quantity = $art[16];
if (!$item->quantity) {
continue;
}
// if ($item->quantity < 10) continue;
$item->title = $art[1];
$item->desc_short = ImpLib::limitString($art[23]);
$item->desc_long = $art[23];
/*
['0'] = String(18) "Ingram Part Number"
| ['2'] = String(20) "Customer Part Number" = 0
| ['3'] = String(18) "Vendor Part Number"
| ['6'] = String(13) "Vendor Number"
*
*/
$item->vendor = $art[7];
$item->plant = $art[5];
$item->manufacturer = $art[7];
$item->manufacturer_sku = $art[3];
$item->meta_desc = $item->desc_short;
$item->meta_keywords = $item->desc_short;
$item->tags = $item->desc_short;
//$item->supplier_reference = $art[3];
$item->manufacturer_sku_2 = $art[6];
$item->store_product_id = $store_product_id;
$item->supplier = "IM";
//$db->query("UPDATE "._DB_PREFIX_."product_supplier SET id_supplier='{$item->id_supplier}' WHERE id_product='{$store_product_id}'");
$item->manufacturer_id = $this->get_manufacturer_id($item->manufacturer);
//dump($item);exit;
if ($type == "FOR_INSERT") {
//$item->id_manufacturer = $this->get_manufacturer_id($item->manufacturer);
//$item->id_supplier = $this->get_supplier_id($art[4]);
}
$item->ean_upc = $art[4];
$item->online_only = 0;
$item->price = $art[13];
$item->rrp = $art[14];
$item->raw_price = $art[13];
//.........这里部分代码省略.........