sipariş formunda ülke bölümünün kaldırılması

KraL6001

OpenCart-TR
Katılım
17 Eki 2010
Mesajlar
32
Tepkime puanı
0
Puanları
0
S.a, ya arkadaşlar sipariş formunda ülke bölümünü kaldırıyorum ama sonrasında hata veriyor. Acaba guest_step_1.tpldeki yerden başka sileceğimiz yer mi var? Aldığım hata aşağıdaki gibidir.

Notice: Undefined index: country_id in /home/siteadi/public_html/catalog/controller/checkout/guest_step_1.php on line 492Notice: Undefined index: country_id in /home/siteadi/public_html/catalog/controller/checkout/guest_step_1.php on line 500Notice: Undefined index: country_id in /home/siteadi/public_html/catalog/controller/checkout/guest_step_1.php on line 33Notice: Undefined index: country_id in /home/siteadi/public_html/catalog/controller/checkout/guest_step_1.php on line 37Notice: Undefined index: country_id in /home/siteadi/public_html/catalog/controller/checkout/guest_step_1.php on line 42Warning: Cannot modify header information - headers already sent by (output started at /home/siteadi/public_html/index.php:92) in /home/siteadi/public_html/system/engine/controller.php on line 27
 

mirac

OpenCart-TR
Katılım
7 Şub 2010
Mesajlar
1,383
Tepkime puanı
0
Puanları
0
Yaş
41
Konum
Beykoz____
Web sitesi
www.notebook-cantasi.com
Hata kodunda yazıyor hangi satırda sorun olduğunu.. Örnek için alttaki konuyu incele..

Hata satırı.
catalog/controller/checkout/guest_step_1.php on line 492

http://forum.opencart-tr.com/thread-1793-post-9521.html#pid9521
 

KraL6001

OpenCart-TR
Katılım
17 Eki 2010
Mesajlar
32
Tepkime puanı
0
Puanları
0
ustam cevabın için tşkler. Fakat 492. satırdaki hata olduğunu bende gördüm ve ne yaptıysam hatalar zinciri devam etti. verdiğiniz linkte benim sorunuma yardımcı olmadı malesef. Benim sildiğim kısım aşağıdaki yer, bir bakarmısınız lütfen.

catalog\view\theme\default\template\checkout\guest_step_1.tpl dosyasında 81 ile 96. satır. Burayı silince o hatayı veriyor. Aslında bazı yerleri silince hata vermiyor ama tam anlamıyla kaldırınca hata veriyor.Sence nasıl ve nereleri silersem tamamen kalkar ustam. Yardımcı olurmusun? Tşkler şimdiden.

Kod:
<tr>
            <td><span class="required">*</span> <?php echo $entry_country; ?></td>
            <td><select name="country_id" id="country_id" onchange="$('select[name=\'zone_id\']').load('index.php?route=checkout/guest_step_1/zone&country_id=' + this.value + '&zone_id=<?php echo $zone_id; ?>'); $('#postcode').load('index.php?route=checkout/guest_step_1/postcode&country_id=' + this.value);">
                <option value="FALSE"><?php echo $text_select; ?></option>
                <?php foreach ($countries as $country) { ?>
                <?php if ($country['country_id'] == $country_id) { ?>
                <option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
                <?php } else { ?>
                <option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
                <?php } ?>
                <?php } ?>
              </select>
              <?php if ($error_country) { ?>
              <span class="error"><?php echo $error_country; ?></span>
              <?php } ?></td>
          </tr>
 

mirac

OpenCart-TR
Katılım
7 Şub 2010
Mesajlar
1,383
Tepkime puanı
0
Puanları
0
Yaş
41
Konum
Beykoz____
Web sitesi
www.notebook-cantasi.com
Ben php dosyası diyorum sen tpl dosyasından bahsediyorsun.. tpl dosyasından sildiğin kodun php dosyasından karşılığını silmezsen hata almaman imkansız..

Yapman gereken;

\catalog\view\theme\KULLANDIĞIN TEMA\template\checkout\guest_step_1.tpl Aç..
Bul ve Sil..
Kod:
 <tr>
            <td><span class="required">*</span> <?php echo $entry_country; ?></td>
            <td><select name="country_id" id="country_id" onchange="$('select[name=\'zone_id\']').load('index.php?route=checkout/guest_step_1/zone&country_id=' + this.value + '&zone_id=<?php echo $zone_id; ?>'); $('#postcode').load('index.php?route=checkout/guest_step_1/postcode&country_id=' + this.value);">
                <option value="FALSE"><?php echo $text_select; ?></option>
                <?php foreach ($countries as $country) { ?>
                <?php if ($country['country_id'] == $country_id) { ?>
                <option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
                <?php } else { ?>
                <option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
                <?php } ?>
                <?php } ?>
              </select>
              <?php if ($error_country) { ?>
              <span class="error"><?php echo $error_country; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_zone; ?></td>
            <td><select name="zone_id">
              </select>
              <?php if ($error_zone) { ?>
              <span class="error"><?php echo $error_zone; ?></span>
              <?php } ?></td>
          </tr>


\catalog\controller\checkout\guest_step_1.php Aç..

Bul ve sil
Kod:
		$country_info = $this->model_localisation_country->getCountry($this->request->post['country_id']);
		
		if ($country_info && $country_info['postcode_required']) {
			if ((strlen(utf8_decode($this->request->post['postcode'])) < 2) || (strlen(utf8_decode($this->request->post['postcode'])) > 10)) {
				$this->error['postcode'] = $this->language->get('error_postcode');
			}
		}

Bul ve Sil..
Kod:
    	if ($this->request->post['country_id'] == 'FALSE') {
      		$this->error['country'] = $this->language->get('error_country');
    	}
		
    	if ($this->request->post['zone_id'] == 'FALSE') {
      		$this->error['zone'] = $this->language->get('error_zone');
    	}



Ayrıca foruma kod eklerken kullandığınız editörün özelliklerinden faydalanmayı deneyiniz..
 

KraL6001

OpenCart-TR
Katılım
17 Eki 2010
Mesajlar
32
Tepkime puanı
0
Puanları
0
Dediklerini yaptım ama bu seferde aşağıdaki hatayı vermeye başladı :)

Kod:
Notice: Undefined index: country_id in /home/tesmer/public_html/catalog/controller/checkout/guest_step_1.php on line 33Notice: Undefined index: country_id in /home/tesmer/public_html/catalog/controller/checkout/guest_step_1.php on line 37Notice: Undefined index: country_id in /home/tesmer/public_html/catalog/controller/checkout/guest_step_1.php on line 42Warning: Cannot modify header information - headers already sent by (output started at /home/tesmer/public_html/index.php:92) in /home/tesmer/public_html/system/engine/controller.php on line 27

guest_step_1.php on line 33, 33. satırı siliyorum sonra sırayla satırlarda hata verme işi devam ediyor. Ben sildikçe hata satırı değişiyor :) Yani sonu olmayan bir gidiş gibi :)
 

mirac

OpenCart-TR
Katılım
7 Şub 2010
Mesajlar
1,383
Tepkime puanı
0
Puanları
0
Yaş
41
Konum
Beykoz____
Web sitesi
www.notebook-cantasi.com
Bendeki php dosyası örneği
Kod:
<?php 
class ControllerCheckoutGuestStep1 extends Controller {
	private $error = array();
	      
  	public function index() {
    	if (!$this->cart->hasProducts() || (!$this->cart->hasStock() && !$this->config->get('config_stock_checkout'))) {
	  		$this->redirect(HTTPS_SERVER . 'index.php?route=checkout/cart');
    	}
		
		if ($this->customer->isLogged()) {
	  		$this->redirect(HTTPS_SERVER . 'index.php?route=checkout/shipping');
    	} 

		if (!$this->config->get('config_guest_checkout') || $this->cart->hasDownload()) {
			$this->session->data['redirect'] = HTTPS_SERVER . 'index.php?route=checkout/shipping';

	  		$this->redirect(HTTPS_SERVER . 'index.php?route=account/login');
    	} 
		
		$this->language->load('checkout/guest_step_1');
		
		if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
			$this->session->data['guest']['firstname'] = $this->request->post['firstname'];
			$this->session->data['guest']['lastname'] = $this->request->post['lastname'];
			$this->session->data['guest']['email'] = $this->request->post['email'];
			$this->session->data['guest']['telephone'] = $this->request->post['telephone'];
			$this->session->data['guest']['fax'] = $this->request->post['fax'];
			$this->session->data['guest']['company'] = $this->request->post['company'];
			$this->session->data['guest']['address_1'] = $this->request->post['address_1'];
			$this->session->data['guest']['address_2'] = $this->request->post['address_2'];
			$this->session->data['guest']['postcode'] = $this->request->post['postcode'];
			$this->session->data['guest']['city'] = $this->request->post['city'];
			$this->session->data['guest']['country_id'] = $this->request->post['country_id'];
			$this->session->data['guest']['zone_id'] = $this->request->post['zone_id'];
						
			if ($this->cart->hasShipping()) {
				$this->tax->setZone($this->request->post['country_id'], $this->request->post['zone_id']);
			}
			
			$this->load->model('localisation/country');
			
			$country_info = $this->model_localisation_country->getCountry($this->request->post['country_id']);
			
			if ($country_info) {
				$this->session->data['guest']['country'] = $country_info['name'];	
				$this->session->data['guest']['iso_code_2'] = $country_info['iso_code_2'];
				$this->session->data['guest']['iso_code_3'] = $country_info['iso_code_3'];
				$this->session->data['guest']['address_format'] = $country_info['address_format'];
			} else {
				$this->session->data['guest']['country'] = '';	
				$this->session->data['guest']['iso_code_2'] = '';
				$this->session->data['guest']['iso_code_3'] = '';
				$this->session->data['guest']['address_format'] = '';
			}
						
			$this->load->model('localisation/zone');

			$zone_info = $this->model_localisation_zone->getZone($this->request->post['zone_id']);
			
			if ($zone_info) {
				$this->session->data['guest']['zone'] = $zone_info['name'];
				$this->session->data['guest']['zone_code'] = $zone_info['code'];
			} else {
				$this->session->data['guest']['zone'] = '';
				$this->session->data['guest']['zone_code'] = '';
			}
			
			if (isset($this->request->post['shipping_indicator'])) {
				$this->session->data['guest']['shipping']['firstname'] = $this->request->post['shipping_firstname'];
				$this->session->data['guest']['shipping']['lastname'] = $this->request->post['shipping_lastname'];
				$this->session->data['guest']['shipping']['company'] = $this->request->post['shipping_company'];
				$this->session->data['guest']['shipping']['address_1'] = $this->request->post['shipping_address_1'];
				$this->session->data['guest']['shipping']['address_2'] = $this->request->post['shipping_address_2'];
				$this->session->data['guest']['shipping']['postcode'] = $this->request->post['shipping_postcode'];
				$this->session->data['guest']['shipping']['city'] = $this->request->post['shipping_city'];
				$this->session->data['guest']['shipping']['country_id'] = $this->request->post['shipping_country_id'];
				$this->session->data['guest']['shipping']['zone_id'] = $this->request->post['shipping_zone_id'];
			
				if ($this->cart->hasShipping()) {
					$this->tax->setZone($this->request->post['shipping_country_id'], $this->request->post['shipping_zone_id']);
				}
			
				$shipping_country_info = $this->model_localisation_country->getCountry($this->request->post['shipping_country_id']);
				
				if ($shipping_country_info) {
					$this->session->data['guest']['shipping']['country'] = $shipping_country_info['name'];	
					$this->session->data['guest']['shipping']['iso_code_2'] = $shipping_country_info['iso_code_2'];
					$this->session->data['guest']['shipping']['iso_code_3'] = $shipping_country_info['iso_code_3'];
					$this->session->data['guest']['shipping']['address_format'] = $shipping_country_info['address_format'];
				} else {
					$this->session->data['guest']['shipping']['country'] = '';	
					$this->session->data['guest']['shipping']['iso_code_2'] = '';
					$this->session->data['guest']['shipping']['iso_code_3'] = '';
					$this->session->data['guest']['shipping']['address_format'] = '';
				}
				
				$shipping_zone_info = $this->model_localisation_zone->getZone($this->request->post['shipping_zone_id']);
			
				if ($zone_info) {
					$this->session->data['guest']['shipping']['zone'] = $shipping_zone_info['name'];
					$this->session->data['guest']['shipping']['zone_code'] = $shipping_zone_info['code'];
				} else {
					$this->session->data['guest']['shipping']['zone'] = '';
					$this->session->data['guest']['shipping']['zone_code'] = '';
				}
				
			} else {
				unset($this->session->data['guest']['shipping']);
			}
			
			unset($this->session->data['shipping_methods']);
			unset($this->session->data['shipping_method']);
			unset($this->session->data['payment_methods']);
			unset($this->session->data['payment_method']);
			
	  		$this->redirect(HTTPS_SERVER . 'index.php?route=checkout/guest_step_2');
    	} 

		$this->document->title = $this->language->get('heading_title');
      	
		$this->document->breadcrumbs = array();

      	$this->document->breadcrumbs[] = array(
        	'href'      => HTTP_SERVER . 'index.php?route=common/home',
        	'text'      => $this->language->get('text_home'),
        	'separator' => FALSE
      	); 

      	$this->document->breadcrumbs[] = array(
        	'href'      => HTTP_SERVER . 'index.php?route=checkout/cart',
        	'text'      => $this->language->get('text_cart'),
        	'separator' => $this->language->get('text_separator')
      	);
		
      	$this->document->breadcrumbs[] = array(
        	'href'      => HTTPS_SERVER . 'index.php?route=checkout/guest_step_1',
        	'text'      => $this->language->get('text_guest_step_1'),
        	'separator' => $this->language->get('text_separator')
      	);
		
    	$this->data['heading_title'] = $this->language->get('heading_title');
		
    	$this->data['text_your_details'] = $this->language->get('text_your_details');
		$this->data['text_your_address'] = $this->language->get('text_your_address');
		$this->data['text_shipping_address'] = $this->language->get('text_shipping_address');
		$this->data['text_indicator'] = $this->language->get('text_indicator');
		$this->data['text_select'] = $this->language->get('text_select');
		
    	$this->data['entry_firstname'] = $this->language->get('entry_firstname');
    	$this->data['entry_lastname'] = $this->language->get('entry_lastname');
    	$this->data['entry_email'] = $this->language->get('entry_email');
    	$this->data['entry_telephone'] = $this->language->get('entry_telephone');
		$this->data['entry_fax'] = $this->language->get('entry_fax');
    	$this->data['entry_company'] = $this->language->get('entry_company');
    	$this->data['entry_address_1'] = $this->language->get('entry_address_1');
    	$this->data['entry_address_2'] = $this->language->get('entry_address_2');
    	$this->data['entry_postcode'] = $this->language->get('entry_postcode');
    	$this->data['entry_city'] = $this->language->get('entry_city');
    	$this->data['entry_country'] = $this->language->get('entry_country');
    	$this->data['entry_zone'] = $this->language->get('entry_zone');
		
		$this->data['button_continue'] = $this->language->get('button_continue');
		$this->data['button_back'] = $this->language->get('button_back');
		
		if (isset($this->error['firstname'])) {
			$this->data['error_firstname'] = $this->error['firstname'];
		} else {
			$this->data['error_firstname'] = '';
		}	
		
		if (isset($this->error['lastname'])) {
			$this->data['error_lastname'] = $this->error['lastname'];
		} else {
			$this->data['error_lastname'] = '';
		}
	
		if (isset($this->error['email'])) {
			$this->data['error_email'] = $this->error['email'];
		} else {
			$this->data['error_email'] = '';
		}
		
		if (isset($this->error['telephone'])) {
			$this->data['error_telephone'] = $this->error['telephone'];
		} else {
			$this->data['error_telephone'] = '';
		}

		if (isset($this->error['address_1'])) {
			$this->data['error_address_1'] = $this->error['address_1'];
		} else {
			$this->data['error_address_1'] = '';
		}
		
		if (isset($this->error['city'])) {
			$this->data['error_city'] = $this->error['city'];
		} else {
			$this->data['error_city'] = '';
		}
		
		if (isset($this->error['postcode'])) {
			$this->data['error_postcode'] = $this->error['postcode'];
		} else {
			$this->data['error_postcode'] = '';
		}
		
		if (isset($this->error['country'])) {
			$this->data['error_country'] = $this->error['country'];
		} else {
			$this->data['error_country'] = '';
		}

		if (isset($this->error['zone'])) {
			$this->data['error_zone'] = $this->error['zone'];
		} else {
			$this->data['error_zone'] = '';
		}
		
		if (isset($this->error['shipping_firstname'])) {
			$this->data['error_shipping_firstname'] = $this->error['shipping_firstname'];
		} else {
			$this->data['error_shipping_firstname'] = '';
		}	
		
		if (isset($this->error['shipping_lastname'])) {
			$this->data['error_shipping_lastname'] = $this->error['shipping_lastname'];
		} else {
			$this->data['error_shipping_lastname'] = '';
		}
		
		if (isset($this->error['shipping_address_1'])) {
			$this->data['error_shipping_address_1'] = $this->error['shipping_address_1'];
		} else {
			$this->data['error_shipping_address_1'] = '';
		}
		
		if (isset($this->error['shipping_city'])) {
			$this->data['error_shipping_city'] = $this->error['shipping_city'];
		} else {
			$this->data['error_shipping_city'] = '';
		}
		
		if (isset($this->error['shipping_postcode'])) {
			$this->data['error_shipping_postcode'] = $this->error['shipping_postcode'];
		} else {
			$this->data['error_shipping_postcode'] = '';
		}
		
		if (isset($this->error['shipping_country'])) {
			$this->data['error_shipping_country'] = $this->error['shipping_country'];
		} else {
			$this->data['error_shipping_country'] = '';
		}

		if (isset($this->error['shipping_zone'])) {
			$this->data['error_shipping_zone'] = $this->error['shipping_zone'];
		} else {
			$this->data['error_shipping_zone'] = '';
		}
		
    	$this->data['action'] = HTTPS_SERVER . 'index.php?route=checkout/guest_step_1';

		if (isset($this->request->post['firstname'])) {
    		$this->data['firstname'] = $this->request->post['firstname'];
		} elseif (isset($this->session->data['guest']['firstname'])) {
			$this->data['firstname'] = $this->session->data['guest']['firstname'];
		} else {
			$this->data['firstname'] = '';
		}

		if (isset($this->request->post['lastname'])) {
    		$this->data['lastname'] = $this->request->post['lastname'];
		} elseif (isset($this->session->data['guest']['lastname'])) {
			$this->data['lastname'] = $this->session->data['guest']['lastname'];
		} else {
			$this->data['lastname'] = '';
		}
		
		if (isset($this->request->post['email'])) {
    		$this->data['email'] = $this->request->post['email'];
		} elseif (isset($this->session->data['guest']['email'])) {
			$this->data['email'] = $this->session->data['guest']['email'];
		} else {
			$this->data['email'] = '';
		}
		
		if (isset($this->request->post['telephone'])) {
    		$this->data['telephone'] = $this->request->post['telephone'];
		} elseif (isset($this->session->data['guest']['telephone'])) {
			$this->data['telephone'] = $this->session->data['guest']['telephone'];		
		} else {
			$this->data['telephone'] = '';
		}

		if (isset($this->request->post['fax'])) {
    		$this->data['fax'] = $this->request->post['fax'];
		} elseif (isset($this->session->data['guest']['fax'])) {
			$this->data['fax'] = $this->session->data['guest']['fax'];				
		} else {
			$this->data['fax'] = '';
		}

		if (isset($this->request->post['company'])) {
    		$this->data['company'] = $this->request->post['company'];
		} elseif (isset($this->session->data['guest']['company'])) {
			$this->data['company'] = $this->session->data['guest']['company'];			
		} else {
			$this->data['company'] = '';
		}
		
		if (isset($this->request->post['address_1'])) {
    		$this->data['address_1'] = $this->request->post['address_1'];
		} elseif (isset($this->session->data['guest']['address_1'])) {
			$this->data['address_1'] = $this->session->data['guest']['address_1'];			
		} else {
			$this->data['address_1'] = '';
		}

		if (isset($this->request->post['address_2'])) {
    		$this->data['address_2'] = $this->request->post['address_2'];
		} elseif (isset($this->session->data['guest']['address_2'])) {
			$this->data['address_2'] = $this->session->data['guest']['address_2'];			
		} else {
			$this->data['address_2'] = '';
		}

		if (isset($this->request->post['postcode'])) {
    		$this->data['postcode'] = $this->request->post['postcode'];
		} elseif (isset($this->session->data['guest']['postcode'])) {
			$this->data['postcode'] = $this->session->data['guest']['postcode'];					
		} else {
			$this->data['postcode'] = '';
		}
		
		if (isset($this->request->post['city'])) {
    		$this->data['city'] = $this->request->post['city'];
		} elseif (isset($this->session->data['guest']['city'])) {
			$this->data['city'] = $this->session->data['guest']['city'];			
		} else {
			$this->data['city'] = '';
		}

    	if (isset($this->request->post['country_id'])) {
      		$this->data['country_id'] = $this->request->post['country_id'];
		} elseif (isset($this->session->data['guest']['country_id'])) {
			$this->data['country_id'] = $this->session->data['guest']['country_id'];			  	
		} else {
      		$this->data['country_id'] = $this->config->get('config_country_id');
    	}

    	if (isset($this->request->post['zone_id'])) {
      		$this->data['zone_id'] = $this->request->post['zone_id'];
		} elseif (isset($this->session->data['guest']['zone_id'])) {
			$this->data['zone_id'] = $this->session->data['guest']['zone_id'];			
    	} else {
      		$this->data['zone_id'] = 'FALSE';
    	}
    	
    	if (isset($this->request->post['shipping_firstname'])) {
    		$this->data['shipping_firstname'] = $this->request->post['shipping_firstname'];
		} elseif (isset($this->session->data['guest']['shipping']['firstname'])) {
			$this->data['shipping_firstname'] = $this->session->data['guest']['shipping']['firstname'];
		} else {
			$this->data['shipping_firstname'] = '';
		}

		if (isset($this->request->post['shipping_lastname'])) {
    		$this->data['shipping_lastname'] = $this->request->post['shipping_lastname'];
		} elseif (isset($this->session->data['guest']['shipping']['lastname'])) {
			$this->data['shipping_lastname'] = $this->session->data['guest']['shipping']['lastname'];
		} else {
			$this->data['shipping_lastname'] = '';
		}
		
		if (isset($this->request->post['shipping_company'])) {
    		$this->data['shipping_company'] = $this->request->post['shipping_company'];
		} elseif (isset($this->session->data['guest']['shipping']['company'])) {
			$this->data['shipping_company'] = $this->session->data['guest']['shipping']['company'];			
		} else {
			$this->data['shipping_company'] = '';
		}
		
		if (isset($this->request->post['shipping_address_1'])) {
    		$this->data['shipping_address_1'] = $this->request->post['shipping_address_1'];
		} elseif (isset($this->session->data['guest']['shipping']['address_1'])) {
			$this->data['shipping_address_1'] = $this->session->data['guest']['shipping']['address_1'];			
		} else {
			$this->data['shipping_address_1'] = '';
		}

		if (isset($this->request->post['shipping_address_2'])) {
    		$this->data['shipping_address_2'] = $this->request->post['shipping_address_2'];
		} elseif (isset($this->session->data['guest']['shipping']['address_2'])) {
			$this->data['shipping_address_2'] = $this->session->data['guest']['shipping']['address_2'];			
		} else {
			$this->data['shipping_address_2'] = '';
		}

		if (isset($this->request->post['shipping_postcode'])) {
    		$this->data['shipping_postcode'] = $this->request->post['shipping_postcode'];
		} elseif (isset($this->session->data['guest']['shipping']['postcode'])) {
			$this->data['shipping_postcode'] = $this->session->data['guest']['shipping']['postcode'];					
		} else {
			$this->data['shipping_postcode'] = '';
		}
		
		if (isset($this->request->post['shipping_city'])) {
    		$this->data['shipping_city'] = $this->request->post['shipping_city'];
		} elseif (isset($this->session->data['guest']['shipping']['city'])) {
			$this->data['shipping_city'] = $this->session->data['guest']['shipping']['city'];			
		} else {
			$this->data['shipping_city'] = '';
		}

    	if (isset($this->request->post['shipping_country_id'])) {
      		$this->data['shipping_country_id'] = $this->request->post['shipping_country_id'];
		} elseif (isset($this->session->data['guest']['shipping']['country_id'])) {
			$this->data['shipping_country_id'] = $this->session->data['guest']['shipping']['country_id'];			  	
		} else {
      		$this->data['shipping_country_id'] = $this->config->get('config_country_id');
    	}

    	if (isset($this->request->post['shipping_zone_id'])) {
      		$this->data['shipping_zone_id'] = $this->request->post['shipping_zone_id'];
		} elseif (isset($this->session->data['guest']['shipping']['zone_id'])) {
			$this->data['shipping_zone_id'] = $this->session->data['guest']['shipping']['zone_id'];			
    	} else {
      		$this->data['shipping_zone_id'] = 'FALSE';
    	}
    	
    	if (isset($this->request->post['shipping_indicator'])) {
      		$this->data['shipping_indicator'] = TRUE;
      	} elseif (isset($this->session->data['guest']['shipping'])) {
			$this->data['shipping_indicator'] = TRUE;
    	} else {
      		$this->data['shipping_indicator'] = FALSE;
    	}

		$this->data['shipping'] = $this->cart->hasShipping();
		
		$this->load->model('localisation/country');
		
    	$this->data['countries'] = $this->model_localisation_country->getCountries();
		
		$this->data['back'] = HTTP_SERVER . 'index.php?route=checkout/cart';
		
		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/checkout/guest_step_1.tpl')) {
			$this->template = $this->config->get('config_template') . '/template/checkout/guest_step_1.tpl';
		} else {
			$this->template = 'default/template/checkout/guest_step_1.tpl';
		}
		
		$this->children = array(
			'common/column_left',
			'common/column_right',
			'common/footer',
			'common/header'
		);
		
		$this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));
  	}
	
  	private function validate() {
    	if ((strlen(utf8_decode($this->request->post['firstname'])) < 1) || (strlen(utf8_decode($this->request->post['firstname'])) > 32)) {
      		$this->error['firstname'] = $this->language->get('error_firstname');
    	}

    	if ((strlen(utf8_decode($this->request->post['lastname'])) < 1) || (strlen(utf8_decode($this->request->post['lastname'])) > 32)) {
      		$this->error['lastname'] = $this->language->get('error_lastname');
    	}

		$pattern = '/^[A-Z0-9._%-+]+@[A-Z0-9][A-Z0-9.-]{0,61}[A-Z0-9]\.[A-Z]{2,6}$/i';
		
    	if (!preg_match($pattern, $this->request->post['email'])) {
      		$this->error['email'] = $this->language->get('error_email');
    	}
		
    	if ((strlen(utf8_decode($this->request->post['telephone'])) < 3) || (strlen(utf8_decode($this->request->post['telephone'])) > 32)) {
      		$this->error['telephone'] = $this->language->get('error_telephone');
    	}
		
    	if ((strlen(utf8_decode($this->request->post['address_1'])) < 3) || (strlen(utf8_decode($this->request->post['address_1'])) > 128)) {
      		$this->error['address_1'] = $this->language->get('error_address_1');
    	}

    	if ((strlen(utf8_decode($this->request->post['city'])) < 3) || (strlen(utf8_decode($this->request->post['city'])) > 128)) {
      		$this->error['city'] = $this->language->get('error_city');
    	}
		
		$this->load->model('localisation/country');
		

		
		if (isset($this->request->post['shipping_indicator'])) {
			
			if ((strlen(utf8_decode($this->request->post['shipping_firstname'])) < 3) || (strlen(utf8_decode($this->request->post['shipping_firstname'])) > 32)) {
      		$this->error['shipping_firstname'] = $this->language->get('error_firstname');
    		}

    		if ((strlen(utf8_decode($this->request->post['shipping_lastname'])) < 3) || (strlen(utf8_decode($this->request->post['shipping_lastname'])) > 32)) {
      			$this->error['shipping_lastname'] = $this->language->get('error_lastname');
    		}
			
			if ((strlen(utf8_decode($this->request->post['shipping_address_1'])) < 3) || (strlen(utf8_decode($this->request->post['shipping_address_1'])) > 128)) {
      		$this->error['shipping_address_1'] = $this->language->get('error_address_1');
    		}

    		if ((strlen(utf8_decode($this->request->post['shipping_city'])) < 3) || (strlen(utf8_decode($this->request->post['shipping_city'])) > 128)) {
      			$this->error['shipping_city'] = $this->language->get('error_city');
    		}
			
			$country_info = $this->model_localisation_country->getCountry($this->request->post['shipping_country_id']);
		
			if ($country_info && $country_info['postcode_required']) {
				if ((strlen(utf8_decode($this->request->post['shipping_postcode'])) < 2) || (strlen(utf8_decode($this->request->post['shipping_postcode'])) > 10)) {
					$this->error['shipping_postcode'] = $this->language->get('error_postcode');
				}
			}
			
    		if ($this->request->post['shipping_country_id'] == 'FALSE') {
      			$this->error['shipping_country'] = $this->language->get('error_country');
    		}
			
    		if ($this->request->post['shipping_zone_id'] == 'FALSE') {
      			$this->error['shipping_zone'] = $this->language->get('error_zone');
    		}
    		
		}
		
    	if (!$this->error) {
      		return TRUE;
    	} else {
      		return FALSE;
    	}
  	}
	
  	public function zone() {
		$output = '<option value="FALSE">' . $this->language->get('text_select') . '</option>';
		
		$this->load->model('localisation/zone');

    	$results = $this->model_localisation_zone->getZonesByCountryId($this->request->get['country_id']);
        
      	foreach ($results as $result) {
        	$output .= '<option value="' . $result['zone_id'] . '"';
	
	    	if (isset($this->request->get['zone_id']) && ($this->request->get['zone_id'] == $result['zone_id'])) {
	      		$output .= ' selected="selected"';
	    	}
	
	    	$output .= '>' . $result['name'] . '</option>';
    	} 
		
		if (!$results) {
			if (!$this->request->get['zone_id']) {
		  		$output .= '<option value="0" selected="selected">' . $this->language->get('text_none') . '</option>';
			} else {
				$output .= '<option value="0">' . $this->language->get('text_none') . '</option>';
			}
		}
	
		$this->response->setOutput($output, $this->config->get('config_compression'));
  	}
	
	public function postcode() {

  		$this->language->load('checkout/guest_step_1');

  		$this->load->model('localisation/country');

    	$result = $this->model_localisation_country->getCountry($this->request->get['country_id']);

		$output = '';

      	if ($result['postcode_required']) {
        	$output = '<span class="required">*</span> ' . $this->language->get('entry_postcode');
		} else {
			$output = $this->language->get('entry_postcode');
		}

		$this->response->setOutput($output, $this->config->get('config_compression'));
	}
}
?>

Buda tpl dosyasının örneği
Kod:
<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content">
  <div class="top">
    <div class="left"></div>
    <div class="right"></div>
    <div class="center">
      <h1><?php echo $heading_title; ?></h1>
    </div>
  </div>
  <div class="middle">
    <form action="<?php echo str_replace('&', '&', $action); ?>" method="post" enctype="multipart/form-data" id="guest">
      <b style="margin-bottom: 2px; display: block;"><?php echo $text_your_details; ?></b>
      <div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-bottom: 10px;">
        <table>
          <tr>
            <td width="150"><span class="required">*</span> <?php echo $entry_firstname; ?></td>
            <td><input type="text" name="firstname" value="<?php echo $firstname; ?>" />
              <?php if ($error_firstname) { ?>
              <span class="error"><?php echo $error_firstname; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_lastname; ?></td>
            <td><input type="text" name="lastname" value="<?php echo $lastname; ?>" />
              <?php if ($error_lastname) { ?>
              <span class="error"><?php echo $error_lastname; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_email; ?></td>
            <td><input type="text" name="email" value="<?php echo $email; ?>" />
              <?php if ($error_email) { ?>
              <span class="error"><?php echo $error_email; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_telephone; ?></td>
            <td><input type="text" name="telephone" value="<?php echo $telephone; ?>" />
              <?php if ($error_telephone) { ?>
              <span class="error"><?php echo $error_telephone; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td><?php echo $entry_fax; ?></td>
            <td><input type="text" name="fax" value="<?php echo $fax; ?>" /></td>
          </tr>
        </table>
      </div>
      <b style="margin-bottom: 2px; display: block;"><?php echo $text_your_address; ?></b>
      <div id="address" style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-bottom: 10px;">
        <table>
          <tr>
            <td width="150"><?php echo $entry_company; ?></td>
            <td><input type="text" name="company" value="<?php echo $company; ?>" /></td>
          </tr>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_address_1; ?></td>
            <td><input type="text" name="address_1" value="<?php echo $address_1; ?>" />
              <?php if ($error_address_1) { ?>
              <span class="error"><?php echo $error_address_1; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td><?php echo $entry_address_2; ?></td>
            <td><input type="text" name="address_2" value="<?php echo $address_2; ?>" /></td>
          </tr>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_city; ?></td>
            <td><input type="text" name="city" value="<?php echo $city; ?>" />
              <?php if ($error_city) { ?>
              <span class="error"><?php echo $error_city; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td id="postcode"><?php echo $entry_postcode; ?></td>
            <td><input type="text" name="postcode" value="<?php echo $postcode; ?>" />
			  <?php if ($error_postcode) { ?>
              <span class="error"><?php echo $error_postcode; ?></span>
              <?php } ?></td>
          </tr>
        </table>
      </div>
      <!-- start shipping address -->
      <span style="clear:both;">
      <?php if ($shipping_indicator) { ?>
      	<input type="checkbox" value="1" checked="checked" onchange="(this.checked) ? $('#shipping_details').css('display','block') : $('#shipping_details').css('display','none');" name="shipping_indicator" id="shipping_indicator" style="margin: 15px 5px 20px 5px;" /><label for="shipping_indicator"><?php echo $text_indicator; ?></label>
      <?php } else { ?>
        <input type="checkbox" value="1" onclick="(this.checked) ? $('#shipping_details').css('display','block') : $('#shipping_details').css('display','none');" name="shipping_indicator" id="shipping_indicator" style="margin: 15px 5px 20px 5px;" /><label for="shipping_indicator"><?php echo $text_indicator; ?></label>
      <?php } ?>
      </span>
      <div id="shipping_details" style="<?php echo ($shipping_indicator) ? 'display:block;' : 'display:none;' ?>">
      <b style="margin-bottom: 2px; display: block;"><?php echo $text_shipping_address; ?></b>
      <div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-bottom: 10px;">
      <table>
          <tr>
            <td width="150"><span class="required">*</span> <?php echo $entry_firstname; ?></td>
            <td><input type="text" name="shipping_firstname" value="<?php echo $shipping_firstname; ?>" />
              <?php if ($error_shipping_firstname) { ?>
              <span class="error"><?php echo $error_shipping_firstname; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_lastname; ?></td>
            <td><input type="text" name="shipping_lastname" value="<?php echo $shipping_lastname; ?>" />
              <?php if ($error_shipping_lastname) { ?>
              <span class="error"><?php echo $error_shipping_lastname; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td width="150"><?php echo $entry_company; ?></td>
            <td><input type="text" name="shipping_company" value="<?php echo $shipping_company; ?>" /></td>
          </tr>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_address_1; ?></td>
            <td><input type="text" name="shipping_address_1" value="<?php echo $shipping_address_1; ?>" />
              <?php if ($error_shipping_address_1) { ?>
              <span class="error"><?php echo $error_shipping_address_1; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td><?php echo $entry_address_2; ?></td>
            <td><input type="text" name="shipping_address_2" value="<?php echo $shipping_address_2; ?>" /></td>
          </tr>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_city; ?></td>
            <td><input type="text" name="shipping_city" value="<?php echo $shipping_city; ?>" />
              <?php if ($error_shipping_city) { ?>
              <span class="error"><?php echo $error_shipping_city; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td id="shipping_postcode"><?php echo $entry_postcode; ?></td>
            <td><input type="text" name="shipping_postcode" value="<?php echo $shipping_postcode; ?>" />
			  <?php if ($error_shipping_postcode) { ?>
              <span class="error"><?php echo $error_shipping_postcode; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_country; ?></td>
            <td><select name="shipping_country_id" id="shipping_country_id" onchange="$('select[name=\'shipping_zone_id\']').load('index.php?route=checkout/guest_step_1/zone&country_id=' + this.value + '&zone_id=<?php echo $shipping_zone_id; ?>'); $('#shipping_postcode').load('index.php?route=checkout/guest_step_1/postcode&country_id=' + this.value);">
                <option value="FALSE"><?php echo $text_select; ?></option>
                <?php foreach ($countries as $country) { ?>
                <?php if ($country['country_id'] == $shipping_country_id) { ?>
                <option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
                <?php } else { ?>
                <option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
                <?php } ?>
                <?php } ?>
              </select>
              <?php if ($error_shipping_country) { ?>
              <span class="error"><?php echo $error_shipping_country; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_zone; ?></td>
            <td><select name="shipping_zone_id">
              </select>
              <?php if ($error_shipping_zone) { ?>
              <span class="error"><?php echo $error_shipping_zone; ?></span>
              <?php } ?></td>
          </tr>
        </table>
      </div>
      </div>
      <!-- end shipping address -->
      <div class="buttons">
        <table>
          <tr>
            <td align="left"><a onclick="location = '<?php echo str_replace('&', '&', $back); ?>'" class="button"><span><?php echo $button_back; ?></span></a></td>
            <td align="right"><a onclick="$('#guest').submit();" class="button"><span><?php echo $button_continue; ?></span></a></td>
          </tr>
        </table>
      </div>
    </form>
  </div>
  <div class="bottom">
    <div class="left"></div>
    <div class="right"></div>
    <div class="center"></div>
  </div>
</div>
<script type="text/javascript"><!--
$('select[name=\'zone_id\']').load('index.php?route=checkout/guest_step_1/zone&country_id=<?php echo $country_id; ?>&zone_id=<?php echo $zone_id; ?>');
$('select[name=\'shipping_zone_id\']').load('index.php?route=checkout/guest_step_1/zone&country_id=<?php echo $shipping_country_id; ?>&zone_id=<?php echo $shipping_zone_id; ?>');
$('#postcode').load('index.php?route=checkout/guest_step_1/postcode&country_id=<?php echo $country_id; ?>');
$('#shipping_postcode').load('index.php?route=checkout/guest_step_1/postcode&country_id=<?php echo $shipping_country_id; ?>');
//--></script>
<?php echo $footer; ?>
 

KraL6001

OpenCart-TR
Katılım
17 Eki 2010
Mesajlar
32
Tepkime puanı
0
Puanları
0
ustam tşkler cevapların için fakat sendekileri katmama rağmen hata veriyor. Herhalde yapamayacam bu kadar basit bir şeyi :) Yinede tşkler mirac kardeşim.

Yalnız sana birşey daha soracağım. Ben şimdi anasayfadaki Alışveriş sepetinde yer alan yerde "kasaya git" yazan linki direk guest_step_1 yönlendirdimde, yalnız ürünü incele dediğimde ve oradan sepete eklettiğimde Alışveriş sepetindeki kasaya git linkini yönlendiremedim. Yani ürün detayları kısmında yer alan "kasaya git" linki tıkladığımda misafir alışverişi yeri çıkıyor. Direk sipariş formunun 1. adımının çıkmasını orada yapamadım. Dosyaların hepsine baktım ama bir türlü bulamadım. Bana bu konuda bir yol gösterebilirmisin mirac kardeşim. Bir fikrin yada bilgin varsa ve paylaşırsan benimle çok sevinirim. Şimdiden teşekkürler.
 

KraL6001

OpenCart-TR
Katılım
17 Eki 2010
Mesajlar
32
Tepkime puanı
0
Puanları
0
adminim zaten oradan değiştirdim. Benim anlatmak istediğim ürünü incelerken sepete at butonuna tıklıyoruz ya, ürün resmi js ile Alşıveriş sepetine gidiyor. Orada yer alan "kasaya git" linkini guest_step_1 e yönlendiremedim. Dediğiniz yerden yoksa diğer yerleri yaptım yani, sadece o kısımdakini değiştiremedim. Onu söyliyeyim dedim:) Yine de cvbınız için tşk ederim.
 

admin

Administrator
Yönetici
Katılım
13 Ağu 2009
Mesajlar
3,196
Tepkime puanı
1
Puanları
38
Yaş
37
Konum
Bursa
Web sitesi
www.opencart-tr.com
catalog/controller/module/cart.php
BUL
Kod:
' . $checkout . '

istediğin link ile değiştir.
 

KraL6001

OpenCart-TR
Katılım
17 Eki 2010
Mesajlar
32
Tepkime puanı
0
Puanları
0
adminim hay senden Allah razı olsun. Çok tşk ederim.

Yalnız adminim bu konu başlığındaki işi hala yapamadım. Yani Ülke ile Posta kodunu kaldırmak istiyorum fakat hata veriyor. guest_step_1.tpl ve guest_step_1.php deki yerlerde denilen yerleri siliyorum hata veriyor. Yani bu kadar basit bişeyde neden böyle hata yapıyorum inan anlamıyorum. Yani o kadarda yabancısı değilim bu olayların ama nedense alakalı olan yada denilen yerleri siliyorum ikinci adıma geçerken hata veriyor :( Bir türlü kurtulamadım şu ülke ve posta kodu yerinden :) Bunada bir yardım olursan çok sevinirim. Tşk ederim yardımlarınız için.
 
Üst