OC 1.5 "Ürünler>Veri" Tabında "Maliyet" Satırını Nasıl Ekleyebilirim?

bilging

OpenCart-TR
Katılım
25 Şub 2012
Mesajlar
5
Tepkime puanı
0
Puanları
0
Merhabalar.
Opencart 1513'te bir site hazırlıyorum.
Ancak ürün eklerken maliyeti de belirtmem gerekiyor.
Bu işlemi şu linkteki eklentiyle yaptım : http://www.opencart.com/index.php?route=extension/extension/info&extension_id=6043

Ancak Export aracıyla aldığım xls dosyasını Excel'de açtığımda maliyet alanı görünmüyor. Sanırım indirdiğim export aracında bir düzenleme yapmak gerekecek. Kullandığım Export/Import aracı: http://www.mhccorp.com/export-import-tool.

admin/model/tool/export.php dosyasını bir hayli inceledim. Değişiklik yapmaya çalıştım, ancak her seferinde hatalar aldım. İşin içinden çıkamadım. Bu konuda yardımlarınızı bekliyorum. Teşekkür ederim.
 

Gökhan TAYLAN

OpenCart-TR
Katılım
14 Tem 2010
Mesajlar
826
Tepkime puanı
0
Puanları
16
Konum
İzmir
Opencart Cost Price - Maliyet Fiyatı Ekleme 1.5.x

Phpmyadmin sql import ediniz :
Kod:
ALTER TABLE `product` ADD `cost` DECIMAL( 15, 4 ) NOT NULL DEFAULT '0.0000'

Düzenle : admin/view/template/catalog/product_form.tpl

Bul :

Kod:
<td><input type="text" name="price" value="<?php echo $price; ?>" /></td>

Sonrasına Ekle :
Kod:
<td><?php echo $entry_cost; ?></td>
		  <td><input type="text" name="cost" value="<?php echo $cost; ?>" /></td>
		</tr>

Düzenle : admin/language/turkish/catalog/product.php

Bul :

Kod:
$_['entry_price']

Altına Ekle :

Kod:
$_['entry_cost']            = 'Maliyet Fiyatı:';

Düzenle : admin/controller/catalog/product.php

Bul :
Kod:
$this->data['entry_price'] = $this->language->get('entry_price');

Sonrasına Ekle :

Kod:
$this->data['entry_cost'] = $this->language->get('entry_cost');


Bul :
Kod:
if (isset($this->request->post['price'])) {

Öncesine Ekle :
Kod:
			if (isset($this->request->post['cost'])) {
				$this->data['cost'] = $this->request->post['cost'];
			} else if (!empty($product_info)) {
				$this->data['cost'] = $product_info['cost'];
			} else {
				$this->data['cost'] = '';
			}

Düzenle : admin/model/catalog/product.php

Bul :
Kod:
$this->db->query("UPDATE " . DB_PREFIX . "product SET model = '" . $this->db->escape($data['model']) . "', sku = '" . $this->db->escape($data['sku']) . "', upc = '" . $this->db->escape($data['upc']) . "', location = '" . $this->db->escape($data['location']) . "', quantity = '" . (int)$data['quantity'] . "', minimum = '" . (int)$data['minimum'] . "', subtract = '" . (int)$data['subtract'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', date_available = '" . $this->db->escape($data['date_available']) . "', manufacturer_id = '" . (int)$data['manufacturer_id'] . "', shipping = '" . (int)$data['shipping'] . "', price = '" . (float)$data['price'] . "', points = '" . (int)$data['points'] . "', weight = '" . (float)$data['weight'] . "', weight_class_id = '" . (int)$data['weight_class_id'] . "', length = '" . (float)$data['length'] . "', width = '" . (float)$data['width'] . "', height = '" . (float)$data['height'] . "', length_class_id = '" . (int)$data['length_class_id'] . "', status = '" . (int)$data['status'] . "', tax_class_id = '" . $this->db->escape($data['tax_class_id']) . "', sort_order = '" . (int)$data['sort_order'] . "', date_modified = NOW() WHERE product_id = '" . (int)$product_id . "'");

Değiştir :
Kod:
$this->db->query("UPDATE " . DB_PREFIX . "product SET model = '" . $this->db->escape($data['model']) . "', sku = '" . $this->db->escape($data['sku']) . "', upc = '" . $this->db->escape($data['upc']) . "', location = '" . $this->db->escape($data['location']) . "', quantity = '" . (int)$data['quantity'] . "', minimum = '" . (int)$data['minimum'] . "', subtract = '" . (int)$data['subtract'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', date_available = '" . $this->db->escape($data['date_available']) . "', manufacturer_id = '" . (int)$data['manufacturer_id'] . "', shipping = '" . (int)$data['shipping'] . "', cost = '" . (float)$data['cost'] . "', price = '" . (float)$data['price'] . "', points = '" . (int)$data['points'] . "', weight = '" . (float)$data['weight'] . "', weight_class_id = '" . (int)$data['weight_class_id'] . "', length = '" . (float)$data['length'] . "', width = '" . (float)$data['width'] . "', height = '" . (float)$data['height'] . "', length_class_id = '" . (int)$data['length_class_id'] . "', status = '" . (int)$data['status'] . "', tax_class_id = '" . $this->db->escape($data['tax_class_id']) . "', sort_order = '" . (int)$data['sort_order'] . "', date_modified = NOW() WHERE product_id = '" . (int)$product_id . "'");

Bul :
Kod:
$this->db->query("INSERT INTO " . DB_PREFIX . "product SET model = '" . $this->db->escape($data['model']) . "', sku = '" . $this->db->escape($data['sku']) . "', upc = '" . $this->db->escape($data['upc']) . "', location = '" . $this->db->escape($data['location']) . "', quantity = '" . (int)$data['quantity'] . "', minimum = '" . (int)$data['minimum'] . "', subtract = '" . (int)$data['subtract'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', date_available = '" . $this->db->escape($data['date_available']) . "', manufacturer_id = '" . (int)$data['manufacturer_id'] . "', shipping = '" . (int)$data['shipping'] . "', price = '" . (float)$data['price'] . "', points = '" . (int)$data['points'] . "', weight = '" . (float)$data['weight'] . "', weight_class_id = '" . (int)$data['weight_class_id'] . "', length = '" . (float)$data['length'] . "', width = '" . (float)$data['width'] . "', height = '" . (float)$data['height'] . "', length_class_id = '" . (int)$data['length_class_id'] . "', status = '" . (int)$data['status'] . "', tax_class_id = '" . $this->db->escape($data['tax_class_id']) . "', sort_order = '" . (int)$data['sort_order'] . "', date_added = NOW()");

Değiştir :
Kod:
$this->db->query("INSERT INTO " . DB_PREFIX . "product SET model = '" . $this->db->escape($data['model']) . "', sku = '" . $this->db->escape($data['sku']) . "', upc = '" . $this->db->escape($data['upc']) . "', location = '" . $this->db->escape($data['location']) . "', quantity = '" . (int)$data['quantity'] . "', minimum = '" . (int)$data['minimum'] . "', subtract = '" . (int)$data['subtract'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', date_available = '" . $this->db->escape($data['date_available']) . "', manufacturer_id = '" . (int)$data['manufacturer_id'] . "', shipping = '" . (int)$data['shipping'] . "', price = '" . (float)$data['price'] . "', cost = '" . (float)$data['cost'] . "', points = '" . (int)$data['points'] . "', weight = '" . (float)$data['weight'] . "', weight_class_id = '" . (int)$data['weight_class_id'] . "', length = '" . (float)$data['length'] . "', width = '" . (float)$data['width'] . "', height = '" . (float)$data['height'] . "', length_class_id = '" . (int)$data['length_class_id'] . "', status = '" . (int)$data['status'] . "', tax_class_id = '" . $this->db->escape($data['tax_class_id']) . "', sort_order = '" . (int)$data['sort_order'] . "', date_added = NOW()");


Not : Yedeksiz Çalışmayınız .
 

bilging

OpenCart-TR
Katılım
25 Şub 2012
Mesajlar
5
Tepkime puanı
0
Puanları
0
Çok teşekkür ederim yardımınız için.

Adımları bir bir uyguladım.
Panelde maliyet alanında istediğim şekilde kayıt yapabildim.
Ancak yine export ettiğimde maliyet sütunu eklenmemiş oluyor.
Sanırım son olarak kullandığım export aracında da düzenleme yapmak gerekecek.
Ekte gönderdiğim export aracını kullanıyorum. Acaba bir de onu inceleme şansınız var mı?
Yardımlarınız için çok çok teşekkür ederim.
 

Ekli dosyalar

  • opencart-1-5-1-x-export-import-8.zip
    857.6 KB · Görüntüleme: 18

Gökhan TAYLAN

OpenCart-TR
Katılım
14 Tem 2010
Mesajlar
826
Tepkime puanı
0
Puanları
16
Konum
İzmir
İnceleyip Geri Dönüş Yapıcam Beklemede Kalın.

bilging' Alıntı:
Çok teşekkür ederim yardımınız için.

Adımları bir bir uyguladım.
Panelde maliyet alanında istediğim şekilde kayıt yapabildim.
Ancak yine export ettiğimde maliyet sütunu eklenmemiş oluyor.
Sanırım son olarak kullandığım export aracında da düzenleme yapmak gerekecek.
Ekte gönderdiğim export aracını kullanıyorum. Acaba bir de onu inceleme şansınız var mı?
Yardımlarınız için çok çok teşekkür ederim.
 

Gökhan TAYLAN

OpenCart-TR
Katılım
14 Tem 2010
Mesajlar
826
Tepkime puanı
0
Puanları
16
Konum
İzmir
İnceleme Sonucu :
export - import modülüne cost price - maliyet fiyatı bölümü ekleme :


Bul :
Kod:
$price = trim($product['price']);

Altına Ekle :
Kod:
$cost = trim($product['cost']);


Bul :
Kod:
$sql .= "`stock_status_id`,`model`,`manufacturer_id`,`image`,`shipping`,`price`,`points`,`date_added`,`date_modified`,`date_available`,`weight`,`weight_class_id`,`status`,";

Değiştir :
Kod:
$sql .= "`stock_status_id`,`model`,`manufacturer_id`,`image`,`shipping`,`price`,`cost`,`points`,`date_added`,`date_modified`,`date_available`,`weight`,`weight_class_id`,`status`,";


Bul:
Kod:
$sql .= "$stockStatusId,'$model',$manufacturerId,'$imageName',$shipping,$price,$points,";

Değiştir :
Kod:
$sql .= "$stockStatusId,'$model',$manufacturerId,'$imageName',$shipping,$price,$cost,$points,";


Bul :
Kod:
$price = $this->getCell($data,$i,12,'0.00');
			$points = $this->getCell($data,$i,13,'0');
			$dateAdded = $this->getCell($data,$i,14);

			$dateAdded = ((is_string($dateAdded)) && (strlen($dateAdded)>0)) ? $dateAdded : "NOW()";
			$dateModified = $this->getCell($data,$i,15);
			$dateModified = ((is_string($dateModified)) && (strlen($dateModified)>0)) ? $dateModified : "NOW()";
			$dateAvailable = $this->getCell($data,$i,16);
			$dateAvailable = ((is_string($dateAvailable)) && (strlen($dateAvailable)>0)) ? $dateAvailable : "NOW()";
			$weight = $this->getCell($data,$i,17,'0');
			$unit = $this->getCell($data,$i,18,$defaultWeightUnit);
			$length = $this->getCell($data,$i,19,'0');
			$width = $this->getCell($data,$i,20,'0');
			$height = $this->getCell($data,$i,21,'0');
			$measurementUnit = $this->getCell($data,$i,22,$defaultMeasurementUnit);
			$status = $this->getCell($data,$i,23,'true');
			$taxClassId = $this->getCell($data,$i,24,'0');
			$viewed = $this->getCell($data,$i,25,'0');
			$langId = $this->getCell($data,$i,26,'1');
			if ($langId!=$languageId) {
				continue;
			}
			$keyword = $this->getCell($data,$i,27);
			$description = $this->getCell($data,$i,28);
			$description = htmlentities( $description, ENT_QUOTES, $this->detect_encoding($description) );
			$meta_description = $this->getCell($data,$i,29);
			$meta_description = htmlentities( $meta_description, ENT_QUOTES, $this->detect_encoding($meta_description) );
			$meta_keywords = $this->getCell($data,$i,30);
			$meta_keywords = htmlentities( $meta_keywords, ENT_QUOTES, $this->detect_encoding($meta_keywords) );
			$additionalImageNames = $this->getCell($data,$i,31);
			$stockStatusId = $this->getCell($data,$i,32,$defaultStockStatusId);
			$storeIds = $this->getCell($data,$i,33);
			$layout = $this->getCell($data,$i,34);
			$related = $this->getCell($data,$i,35);
			$tags = $this->getCell($data,$i,36);
			$sort_order = $this->getCell($data,$i,37,'0');
			$subtract = $this->getCell($data,$i,38,'true');
			$minimum = $this->getCell($data,$i,39,'1');

Değiştir :
Kod:
$price = $this->getCell($data,$i,12,'0.00');
			$cost = $this->getCell($data,$i,13,'0.00');
			$points = $this->getCell($data,$i,14,'0');
			$dateAdded = $this->getCell($data,$i,15);
			$dateAdded = ((is_string($dateAdded)) && (strlen($dateAdded)>0)) ? $dateAdded : "NOW()";
			$dateModified = $this->getCell($data,$i,16);
			$dateModified = ((is_string($dateModified)) && (strlen($dateModified)>0)) ? $dateModified : "NOW()";
			$dateAvailable = $this->getCell($data,$i,17);
			$dateAvailable = ((is_string($dateAvailable)) && (strlen($dateAvailable)>0)) ? $dateAvailable : "NOW()";
			$weight = $this->getCell($data,$i,18,'0');
			$unit = $this->getCell($data,$i,19,$defaultWeightUnit);
			$length = $this->getCell($data,$i,20,'0');
			$width = $this->getCell($data,$i,21,'0');
			$height = $this->getCell($data,$i,22,'0');
			$measurementUnit = $this->getCell($data,$i,23,$defaultMeasurementUnit);
			$status = $this->getCell($data,$i,24,'true');
			$taxClassId = $this->getCell($data,$i,25,'0');
			$viewed = $this->getCell($data,$i,26,'0');
			$langId = $this->getCell($data,$i,27,'1');
			if ($langId!=$languageId) {
				continue;
			}
			$keyword = $this->getCell($data,$i,28);
			$description = $this->getCell($data,$i,29);
			$description = htmlentities( $description, ENT_QUOTES, $this->detect_encoding($description) );
			$meta_description = $this->getCell($data,$i,30);
			$meta_description = htmlentities( $meta_description, ENT_QUOTES, $this->detect_encoding($meta_description) );
			$meta_keywords = $this->getCell($data,$i,31);
			$meta_keywords = htmlentities( $meta_keywords, ENT_QUOTES, $this->detect_encoding($meta_keywords) );
			$additionalImageNames = $this->getCell($data,$i,32);
			$stockStatusId = $this->getCell($data,$i,33,$defaultStockStatusId);
			$storeIds = $this->getCell($data,$i,34);
			$layout = $this->getCell($data,$i,35);
			$related = $this->getCell($data,$i,36);
			$tags = $this->getCell($data,$i,37);
			$sort_order = $this->getCell($data,$i,38,'0');
			$subtract = $this->getCell($data,$i,39,'true');
			$minimum = $this->getCell($data,$i,40,'1');

Bul :
Kod:
$product['price'] = $price;

Altına Ekle :
Kod:
$product['cost'] = $cost;


BUl :
Kod:
function validateProducts( &$reader )
	{
		$expectedProductHeading = array
		( "product_id", "name", "categories", "sku", "upc", "location", "quantity", "model", "manufacturer", "image_name", "requires\nshipping", "price", "points", "date_added", "date_modified", "date_available", "weight", "unit", "length", "width", "height", "length\nunit", "status\nenabled", "tax_class_id", "viewed", "language_id", "seo_keyword", "description", "meta_description", "meta_keywords", "additional image names", "stock_status_id", "store_ids", "layout", "related_ids", "tags", "sort_order", "subtract", "minimum" );
		$data =& $reader->getSheet(1);
		return $this->validateHeading( $data, $expectedProductHeading );
	}


Değiştir :
Kod:
function validateProducts( &$reader )
	{
		$expectedProductHeading = array
		( "product_id", "name", "categories", "sku", "upc", "location", "quantity", "model", "manufacturer", "image_name", "requires\nshipping", "price", "cost", "points", "date_added", "date_modified", "date_available", "weight", "unit", "length", "width", "height", "length\nunit", "status\nenabled", "tax_class_id", "viewed", "language_id", "seo_keyword", "description", "meta_description", "meta_keywords", "additional image names", "stock_status_id", "store_ids", "layout", "related_ids", "tags", "sort_order", "subtract", "minimum" );
		$data =& $reader->getSheet(1);
		return $this->validateHeading( $data, $expectedProductHeading );
	}

Bul :
Kod:
$worksheet->setColumn($j,$j++,max(strlen('price'),10)+1,$priceFormat);

Altına Ekle :
Kod:
$worksheet->setColumn($j,$j++,max(strlen('cost'),10)+1,$priceFormat);

Bul :
Kod:
$worksheet->writeString( $i, $j++, 'price', $boxFormat );

Altına Ekle :
Kod:
$worksheet->writeString( $i, $j++, 'cost', $boxFormat );

Bul :
Kod:
$query .= "  p.price,";

Altına Ekle :
Kod:
$query .= "  p.cost,";

Bul :
Kod:
$worksheet->write( $i, $j++, $row['price'], $priceFormat );

Altına Ekle :
Kod:
$worksheet->write( $i, $j++, $row['cost'], $priceFormat );


Tamamdır Sonuç Resimli : http://prntscr.com/do1sd
 

bilging

OpenCart-TR
Katılım
25 Şub 2012
Mesajlar
5
Tepkime puanı
0
Puanları
0
Ne diyeyim. Sağolun varolun.
Allah bin kere razı olsun.
Sizin gibi yardım sever insanlar oldukça özgür yazılım hep yaşayacaktır.
 

ycelebi

OpenCart-TR
Katılım
16 Ocak 2013
Mesajlar
1
Tepkime puanı
0
Puanları
0
Selam,
Opencart'a yeni mağaza açmaya çalışıyorum dolayısıyla opencart tecrübem pek yok.opencart 1.5.5.1 kurdum ve gerekli ayarları yaptım şimdi maliyet fiyatlarını bende girmek istiyorum ve import-export yaptığımda o sutununda excele gelmesini istiyorum.
Yukarıda vermiş olduğunuz kodları hangi dosyalarda aratıp değişiklik yapıyoruz bilgi verebilirmisiniz Lütfen.
yardımlarınız için şimditen Teşekürler
 
Üst