sabitertan
OpenCart-TR
Arkadaşlar şu anki haliyle kullanmak isteyen arkadaşlar için adım adım anlatıyorum.
Bu anlatım Opencart 1.4.9.1 ve Sanal pos 2.3.5 kurulu sistemler için geçerlidir. Ekleme yaparken dikkat ediniz kimi kodlar "ALTINA" kimileri "ÜSTÜNE" denilmiştir.
DEMO
1. Sanal posu etkinleştirin ve kredi kartı/banka- taksit ayarlarınızı yapın aşağıda bahsi geçen dosyaları düzenlemeden önce bir kopyasını mutlaka oluşturun.
2. catalog\view\theme\default\template\product\product.tpl dosyasını(ve temanızda bulunan product.tpl dosyasını) açın aşağıdaki değişiklikleri uygulayın.
Bul
	
	
	
		
Altına ekle
	
	
	
		
Bul
	
	
	
		
Üstüne ekle
	
	
	
		
3. catalog\controller\product\product.php dosyasını aç aşağıdaki değişiklikleri uygula
Bul
	
	
	
		
Üstüne ekle
	
	
	
		
Bul
	
	
	
		
Altına ekle
	
	
	
		
Bul
	
	
	
		
Altına ekle
	
	
	
		
Bul
	
	
	
		
Altına ekle
	
	
	
		
4. taksit tabının düzgün görünmesi için: catalog\view\theme\<tema adınız>\stylesheet\stylsheet.css dosyasını aç
Bul
	
	
	
		
Bu kodun altındaki padding değerinde örneğin default için
	
	
	
		
şeklindedir.
Ben şu şekilde değerleri değiştirdim
	
	
	
		
Ve yeterli oldu. Sizde deneyerek uygun ayarı sağlayabilirsiniz.
			
			Bu anlatım Opencart 1.4.9.1 ve Sanal pos 2.3.5 kurulu sistemler için geçerlidir. Ekleme yaparken dikkat ediniz kimi kodlar "ALTINA" kimileri "ÜSTÜNE" denilmiştir.
DEMO
1. Sanal posu etkinleştirin ve kredi kartı/banka- taksit ayarlarınızı yapın aşağıda bahsi geçen dosyaları düzenlemeden önce bir kopyasını mutlaka oluşturun.
2. catalog\view\theme\default\template\product\product.tpl dosyasını(ve temanızda bulunan product.tpl dosyasını) açın aşağıdaki değişiklikleri uygulayın.
Bul
		PHP:
	
	<a tab="#tab_related"><?php echo $tab_related; ?> (<?php echo count($products); ?>)</a>
	Altına ekle
		PHP:
	
	<!--taksit tab-link--> <a tab="#tab_taksit"><?php echo 'Taksit'; ?></a><!--taksit tab-link-->
	Bul
		PHP:
	
	 <div id="tab_description" class="tab_page"><?php echo $description; ?></div>
	Üstüne ekle
		PHP:
	
		<!--taksit tabi-->
	<div id="tab_taksit" class="tab_page">
	<?
if($taksit_var):
?>
<style type="text/css">
.taksit_liste {border:1px solid silver;}
.taksit_liste table th {vertical-align:top;text-align:center;}
.taksit_liste table td {vertical-align:top;text-align:right;padding:2px;}
.taksit_liste table tr.ozel td {font-weight:bold;}
.taksit_liste table thead td {font-weight:bold;text-decoration:underline;}
.pos_isim {font-size:120%;}
</style>
<b style="margin-bottom: 3px; display: block;"><?php echo $text_taksit_secenekleri;?></b>
<div id="sanal_pos_2_taksitler" style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-bottom: 10px;">
  <table width="100%" style="border-collapse:collapse;">
	<?
	$total_cols = 2;
	
	$col = -1;
	$trOpen = false;
	$col_width = intval(100/$total_cols) .'%';
	
			
	foreach($ccpos_config as $pos):
		$col = ($col+1)%$total_cols;
		if($col==0):$trOpen = true;?><tr><?endif;?>
		<td width="<?=$col_width?>" valign="top" class="taksit_liste">
			<table width="100%">
				<thead>
					<tr><th colspan=3 align="center" class="pos_isim"><?=$pos['isim']?></th></tr>
					<tr><td><?=$text_taksit?></td><td><?=$text_taksit_tutari?></td><td><?=$text_toplam_tutar?></td></tr>
				</thead>
				<tbody>
				<?				
				$toplam_tutar_goster = $this->currency->format($pure_price,false,false,TRUE);
				
				if(!isset($pos['taksitler'][1])){
					?>
					<tr class="ozel">
						<td>Peşin</td>						
						<td><?=$toplam_tutar_goster?></td>						
						<td><?=$toplam_tutar_goster?></td>
					</tr>
					<?
				}
				foreach($pos['taksitler'] as $taksit=>$data):
					$toplam_tutar = $pure_price * (100+$data['komisyon'])/100;
					$taksit_tutari = $toplam_tutar/$taksit;
					
					$toplam_tutar_goster = $this->currency->format($toplam_tutar,false,false,TRUE);
					$taksit_tutari_goster = $this->currency->format($taksit_tutari,false,false,TRUE);
					?>
					<tr class="ozel">
						<td><?=$taksit?></td>						
						<td><?=$taksit_tutari_goster?></td>						
						<td><?=$toplam_tutar_goster?></td>						
					</tr>
				<?endforeach;?>
				</tbody>
			</table>
		</td><?
		if($col==($total_cols-1)):$trOpen = false;?></tr><?endif;		
	endforeach;	
	while($col<($total_cols-1))
	{
		$col = ($col+1)%$total_cols;
		?><td width="<?=$col_width?>"></td><?		
	}
	if($trOpen):?></tr><?endif;
	?>
  </table>
</div>
<?
endif;
?>
	
	
	</div>
	<!--taksit tabi son-->
	3. catalog\controller\product\product.php dosyasını aç aşağıdaki değişiklikleri uygula
Bul
		PHP:
	
	public function index() {
	Üstüne ekle
		PHP:
	
		// taksitlendirme
		private function getPosConfig($include_inactive=false)
  	{
		$config = array();
		if( ($data = $this->config->get('sanal_pos_2_ccpos_config')) && ($data = unserialize($data)) && is_array($data) )
		{
			$config = $data;
			if(!$include_inactive)
			{
				foreach($config as $key=>$pos)
				{
					if($pos['aktif']!=1)
						unset($config[$key]);
				}
			}
		}		
		return $config;
	}
		private function taksitVar($ccpos_config)
	{
		foreach($ccpos_config as $pos)
		{
			if($pos['aktif']==1 && count($pos['taksitler'])>0 )
				return true;
		}
		return false;
	}
	// taksitlendirme
	Bul
		PHP:
	
	$product_info = $this->model_catalog_product->getProduct($product_id);
	Altına ekle
		PHP:
	
	// taksitlendirme
		$this->language->load('payment/sanal_pos_2');
		
		$this->data['text_credit_card'] = $this->language->get('text_credit_card');
		$this->data['text_taksit_secenekleri'] = $this->language->get('text_taksit_secenekleri');//
		$this->data['text_wait'] = $this->language->get('text_wait');
		$this->data['text_diger'] = $this->language->get('text_diger');
		$this->data['text_taksit'] = $this->language->get('text_taksit');
		$this->data['text_taksit_tutari'] = $this->language->get('text_taksit_tutari');
		$this->data['text_toplam_tutar'] = $this->language->get('text_toplam_tutar');
		
		$this->data['entry_cc_type'] = $this->language->get('entry_cc_type');
		$this->data['entry_cc_owner'] = $this->language->get('entry_cc_owner');
		$this->data['entry_cc_number'] = $this->language->get('entry_cc_number');
		$this->data['entry_cc_expire_date'] = $this->language->get('entry_cc_expire_date');
		$this->data['entry_cc_cvv2'] = $this->language->get('entry_cc_cvv2');
		
		$this->data['button_confirm'] = $this->language->get('button_confirm');
		$this->data['button_back'] = $this->language->get('button_back');
		
		$this->data['error_failed'] = $this->language->get('error_failed');
		
		$this->data['months'] = array();
		
		for ($i = 1; $i <= 12; $i++) {
			$mon = sprintf('%02d', $i);
			$this->data['months'][] = array(
				//'text'  => strftime('%B', mktime(0, 0, 0, $i, 1, 2000)), 
				'text'  => $mon,
				'value' => $mon
			);
		}
		
		$today = getdate();
		$this->data['year_expire'] = array();
		for ($i = $today['year']; $i < $today['year'] + 11; $i++) {
			$this->data['year_expire'][] = array(
				'text'  => strftime('%Y', mktime(0, 0, 0, 1, 1, $i)),
				'value' => strftime('%Y', mktime(0, 0, 0, 1, 1, $i)) 
			);
		}
		
		$this->data['ccpos_config'] = $this->getPosConfig();
		$this->data['taksit_var'] = $this->taksitVar($this->data['ccpos_config']);
		
// taksitlendirme son
	Bul
		PHP:
	
	$this->data['price'] = $this->currency->format($this->tax->calculate($discount, $product_info['tax_class_id'], $this->config->get('config_tax')));
	Altına ekle
		PHP:
	
	//taksit modulu icin fiyat
				$this->data['pure_price'] = $this->tax->calculate($discount, $product_info['tax_class_id'], $this->config->get('config_tax'));
	Bul
		PHP:
	
	$this->data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
	Altına ekle
		PHP:
	
	//taksit modulu icin fiyat
				$this->data['pure_price'] = $this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'));
	4. taksit tabının düzgün görünmesi için: catalog\view\theme\<tema adınız>\stylesheet\stylsheet.css dosyasını aç
Bul
		Kod:
	
	.tabs a
	
		Kod:
	
	padding: 6px 15px 7px 15px;
	Ben şu şekilde değerleri değiştirdim
		Kod:
	
	padding: 6px 13px 7px 13px;