suleyman70
OpenCart-TR
- Katılım
- 28 Tem 2013
- Mesajlar
- 2
- Tepkime puanı
- 0
- Puanları
- 0
Arkadaşlar ben OpenCart'ı SA-MP serverime shop sistemi için kullanıyorum, şimdi mysqlla bağlantılı serverim ancak siparişi onayladıktan sonra bilgileri mysql'a nasıl işleyeceğimi bilmiyorum PHP'den pek çaktığım söylenemez.
Kodlar bu;
Mysql'daki bilgilere şöyle işlenecek;
user'deki silah1'e ürünün kodunu girecek, para'dan da ürünün fiyatını düşecek.
Sadece şunu istiyorum mysql işlemeyi falan ben hallederim de success olduktan sonra ürünün ıd'ı ve fiyatı hangi bilgiler olarak ele çıkıyor yani data[payment_id] falan var hangisi ve hangi satırda işleniyor?
Kodlar bu;
Kod:
<?php
class ControllerCheckoutSuccess extends Controller {
public function index() {
if ( isset($this->session->data['order_id']) && ( ! empty($this->session->data['order_id'])) ) {
$this->session->data['last_order_id'] = $this->session->data['order_id'];
}
if (isset($this->session->data['order_id'])) {
$this->cart->clear();
unset($this->session->data['shipping_method']);
unset($this->session->data['shipping_methods']);
unset($this->session->data['payment_method']);
unset($this->session->data['payment_methods']);
unset($this->session->data['guest']);
unset($this->session->data['comment']);
unset($this->session->data['order_id']);
unset($this->session->data['coupon']);
unset($this->session->data['reward']);
unset($this->session->data['voucher']);
unset($this->session->data['vouchers']);
}
$this->language->load('checkout/success');
if (! empty($this->session->data['last_order_id']) ) {
$this->document->setTitle(sprintf($this->language->get('heading_title_customer'), $this->session->data['last_order_id']));
} else {
$this->document->setTitle($this->language->get('heading_title'));
}
$this->data['breadcrumbs'] = array();
$this->data['breadcrumbs'][] = array(
'href' => $this->url->link('common/home'),
'text' => $this->language->get('text_home'),
'separator' => false
);
$this->data['breadcrumbs'][] = array(
'href' => $this->url->link('checkout/cart'),
'text' => $this->language->get('text_basket'),
'separator' => $this->language->get('text_separator')
);
$this->data['breadcrumbs'][] = array(
'href' => $this->url->link('checkout/checkout', '', 'SSL'),
'text' => $this->language->get('text_checkout'),
'separator' => $this->language->get('text_separator')
);
$this->data['breadcrumbs'][] = array(
'href' => $this->url->link('checkout/success'),
'text' => $this->language->get('text_success'),
'separator' => $this->language->get('text_separator')
);
if (! empty($this->session->data['last_order_id']) ) {
$this->data['heading_title'] = sprintf($this->language->get('heading_title_customer'), $this->session->data['last_order_id']);
} else {
$this->data['heading_title'] = $this->language->get('heading_title');
}
if ($this->customer->isLogged()) {
$this->data['text_message'] = sprintf($this->language->get('text_customer'), $this->url->link('account/order/info&order_id=' . $this->session->data['last_order_id'], '', 'SSL'), $this->session->data['last_order_id'], $this->url->link('account/account', '', 'SSL'), $this->url->link('account/order', '', 'SSL'), $this->url->link('account/download', '', 'SSL'), $this->url->link('information/contact'));
} else {
$this->data['text_message'] = sprintf($this->language->get('text_guest'), $this->session->data['last_order_id'], $this->url->link('information/contact'));
}
$this->data['button_continue'] = $this->language->get('button_continue');
$this->data['continue'] = $this->url->link('common/home');
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/success.tpl')) {
$this->template = $this->config->get('config_template') . '/template/common/success.tpl';
} else {
$this->template = 'default/template/common/success.tpl';
}
$this->children = array(
'common/column_left',
'common/column_right',
'common/content_top',
'common/content_bottom',
'common/footer',
'common/header'
);
$this->response->setOutput($this->render());
}
}
?>
user'deki silah1'e ürünün kodunu girecek, para'dan da ürünün fiyatını düşecek.
Sadece şunu istiyorum mysql işlemeyi falan ben hallederim de success olduktan sonra ürünün ıd'ı ve fiyatı hangi bilgiler olarak ele çıkıyor yani data[payment_id] falan var hangisi ve hangi satırda işleniyor?