catalog/controller/cehckout/cart.php Açınız;
PHP Kod:
public function index() {
$this->language->load('checkout/cart');
Hemen Altına Ekleyelim
PHP Kod:
if ($this->request->server['REQUEST_METHOD'] == 'GET' && isset($this->request->get['product_id'])) {
if (isset($this->request->get['option'])) {
$option = $this->request->get['option'];
} else {
$option = array();
}
if (isset($this->request->get['quantity'])) {
$quantity = $this->request->get['quantity'];
} else {
$quantity = 1;
}
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->cart->add($this->request->get['product_id'], $quantity, $option);
$this->redirect(HTTPS_SERVER . 'index.php?route=checkout/cart');
} else
Daha sonra açalım: catalog/view/theme/seninteman/template/product/product/product.tpl
Burda iki yerde ekleme yapacaz.
1. Bulalım:
PHP Kod:
<input type="button" value="<?php echo $button_cart; ?>" id="button-cart" class="button" />
Arasına Ekleyelim :
PHP Kod:
<a href="index.php?route=checkout/cart&product_id=<?php echo $product_id; ?>" &product_id=<?php echo $product_id; ?>" id="button-cart1"><span><img src="image/com.png" width="166" height="39" /></span></a>
2. Bulalım :
PHP Kod:
<a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><?php echo $button_cart; ?></a>
Gene Arasına Ekleyelim :
PHP Kod:
<a href="index.php?route=checkout/cart&product_id=<?php echo $product_id; ?>" &product_id=<?php echo $product_id; ?>" id="button-cart1"><span>hemen al</span></a>
BENIM KULLANDIGIM BU
AÇ Daha sonra açalım: catalog/view/theme/seninteman/template/product/product/product.tpl
ARA
<input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
<a id="button-cart" class="button"><span class="button-cart-text"><?php echo $button_cart; ?></span></a>
Gene Arasına Ekleyelim : -364. satır
<!-- Hızlı Al -->
<input type="button" value="HEMEN SATIN AL" id="hizli-ode" class="button"/>
<!-- Hızlı Al -->
ARA
-------------------------------------------------
success: function(json) {
$('.success, .warning, .attention, information, .error').remove();
if (json['success']) {
$('#profile-description').html(json['success']);
}
}
});
});
-------------------------------------------------
SONRASINA EKLE.
725. satır olabir
-------------------------------------------------
<!-- Hızlı Al -->
$('#hizli-ode').bind('click', function() {
$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea'),
dataType: 'json',
success: function(json) {
$('.success, .warning, .attention, information, .error').remove();
if (json['error']) {
if (json['error']['option']) {
for (i in json['error']['option']) {
$('#option-' + i).after('<span class="error">' + json['error']['option'] + '</span>');
}
}
}
if (json['success']) {
$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
$('.success').fadeIn('slow');
$('#cart-total').html(json['total']);
$('html, body').animate({ scrollTop: 0 }, 'slow');
window.location.href = '/index.php?route=onecheckout/checkout';
}
}
});
});
<!-- Hızlı Al -->
-------------------------------------------------
http://www.tr-opencart.com/Konu-hemen-al
PHP Kod:
public function index() {
$this->language->load('checkout/cart');
Hemen Altına Ekleyelim
PHP Kod:
if ($this->request->server['REQUEST_METHOD'] == 'GET' && isset($this->request->get['product_id'])) {
if (isset($this->request->get['option'])) {
$option = $this->request->get['option'];
} else {
$option = array();
}
if (isset($this->request->get['quantity'])) {
$quantity = $this->request->get['quantity'];
} else {
$quantity = 1;
}
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->cart->add($this->request->get['product_id'], $quantity, $option);
$this->redirect(HTTPS_SERVER . 'index.php?route=checkout/cart');
} else
Daha sonra açalım: catalog/view/theme/seninteman/template/product/product/product.tpl
Burda iki yerde ekleme yapacaz.
1. Bulalım:
PHP Kod:
<input type="button" value="<?php echo $button_cart; ?>" id="button-cart" class="button" />
Arasına Ekleyelim :
PHP Kod:
<a href="index.php?route=checkout/cart&product_id=<?php echo $product_id; ?>" &product_id=<?php echo $product_id; ?>" id="button-cart1"><span><img src="image/com.png" width="166" height="39" /></span></a>
2. Bulalım :
PHP Kod:
<a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><?php echo $button_cart; ?></a>
Gene Arasına Ekleyelim :
PHP Kod:
<a href="index.php?route=checkout/cart&product_id=<?php echo $product_id; ?>" &product_id=<?php echo $product_id; ?>" id="button-cart1"><span>hemen al</span></a>
BENIM KULLANDIGIM BU
AÇ Daha sonra açalım: catalog/view/theme/seninteman/template/product/product/product.tpl
ARA
<input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
<a id="button-cart" class="button"><span class="button-cart-text"><?php echo $button_cart; ?></span></a>
Gene Arasına Ekleyelim : -364. satır
<!-- Hızlı Al -->
<input type="button" value="HEMEN SATIN AL" id="hizli-ode" class="button"/>
<!-- Hızlı Al -->
ARA
-------------------------------------------------
success: function(json) {
$('.success, .warning, .attention, information, .error').remove();
if (json['success']) {
$('#profile-description').html(json['success']);
}
}
});
});
-------------------------------------------------
SONRASINA EKLE.
725. satır olabir
-------------------------------------------------
<!-- Hızlı Al -->
$('#hizli-ode').bind('click', function() {
$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea'),
dataType: 'json',
success: function(json) {
$('.success, .warning, .attention, information, .error').remove();
if (json['error']) {
if (json['error']['option']) {
for (i in json['error']['option']) {
$('#option-' + i).after('<span class="error">' + json['error']['option'] + '</span>');
}
}
}
if (json['success']) {
$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
$('.success').fadeIn('slow');
$('#cart-total').html(json['total']);
$('html, body').animate({ scrollTop: 0 }, 'slow');
window.location.href = '/index.php?route=onecheckout/checkout';
}
}
});
});
<!-- Hızlı Al -->
-------------------------------------------------
http://www.tr-opencart.com/Konu-hemen-al