Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

[Подгдержка] cart popup модуль всплываюещёй корзины


Recommended Posts

Здравствуйте! Усиновили модуль Cart Popup

У нас выводились опции поэтому модуль не рилииет.

Скрипт модуля cartpopup.js

$(document).ready(function(){
$('#button-cart').unbind('click');
$('#button-cart').bind('click', function () { addToCart();});
});

function addToCart(product_id, quantity) {
var productpage = true;

if (typeof(product_id) != 'undefined') {
var productpage = false;
var quantity = typeof(quantity) != 'undefined' ? quantity : 1;
var data = 'product_id=' + product_id + '&quantity=' + quantity;
} else {
var quantity = $('input[name=\'quantity\']').val();
var 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');
}

$('#text-added').text(quantity + ' '+declination(parseInt(quantity)));

$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: data,
dataType: 'json',
success: function(json) {
$('.success, .warning, .attention, .information, .error').remove();

if (json['redirect'] && !productpage) {
location = json['redirect'];
}

if (json['error'] && productpage) {
if (json['error']['option']) {
for (i in json['error']['option']) {
$('#option-' + i).after('' + json['error']['option'] + '');
}
}
}

if (json['success']) {
$('#cart-total, .cart-total').html(json['total']);
$('#cartpopup .cart').load('index.php?route=module/cart .mini-cart-info', function() {

$('#cartpopup .mini-cart-info td.remove img').each(function(i,e){
var $this = $(this);
var product_id = $this.attr('onclick').match(/remove=(\d+(?::[\w=\+\\]+)?)/)[1];
this.onclick = function () {
$('#cart').load('index.php?route=module/cart&remove=' + product_id + ' #cart > *', function(){$('.cart-total').text($('#cart-total').text());});
$this.parent().parent().hide();
if ($('#cartpopup .mini-cart-info tr').filter(':visible').length == 0) {
$('#cartpopup').popup('hide');
}
}
});

$('#cartpopup').popup('show');

});
}
}
});
}

Код common.js

function addCartExt(product_id, product_option_value_id) {

$form = $('#product-'+product_id + '-' + product_option_value_id);

$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: $form.serialize(),
dataType: 'json',
success: function(json) {
$('.success, .warning, .attention, .information, .error').remove();

if (json['redirect']) {
location = json['redirect'];
}

if (json['success']) {
$('#notification').html('

' + json['success'] + 'close.png

');

$('.success').fadeIn('slow');
setTimeout ("$('.success').fadeOut('slow');", 5000);

$('#cart-total').html(json['total']);

//$('html, body').animate({ scrollTop: 0 }, 'slow');
}
}
});
}

Попыились прописать ик но форма карзины  не вызывается

function addCartExt(product_id, product_option_value_id) {
$form = $('#product-'+product_id + '-' + product_option_value_id);
$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: $form.serialize(),
dataType: 'json',
success: function(json) {
$('.success, .warning, .attention, .information, .error').remove();

if (json['redirect']) {
location = json['redirect'];
}
if (json['success']) {
$('#cart-total, .cart-total').html(json['total']);
$('#cartpopup .cart').load('index.php?route=module/cart .mini-cart-info', function() {
$('#cartpopup .mini-cart-info td.remove img').each(function(i,e){
var $this = $(this);
var product_id = $this.attr('onclick').match(/remove=(\d+(?::[\w=\+\\]+)?)/)[1];
this.onclick = function () {
$('#cart').load('index.php?route=module/cart&remove=' + product_id + ' #cart > *', function(){$('.cart-total').text($('#cart-total').text());});
$this.parent().parent().hide();
if ($('#cartpopup .mini-cart-info tr').filter(':visible').length == 0) {
$('#cartpopup').popup('hide');
}
}
});
}

Может кто подскажет что не ик!

Link to comment
Share on other sites


Здравствуйте! Усиновили модуль Cart Popup

У нас выводились опции поэтому модуль не рилииет.

Скрипт модуля cartpopup.js

$(document).ready(function(){

$('#button-cart').unbind('click');

$('#button-cart').bind('click', function () { addToCart();});

});

function addToCart(product_id, quantity) {

var productpage = true;

if (typeof(product_id) != 'undefined') {

var productpage = false;

var quantity = typeof(quantity) != 'undefined' ? quantity : 1;

var data = 'product_id=' + product_id + '&quantity=' + quantity;

} else {

var quantity = $('input[name=\'quantity\']').val();

var 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');

}

$('#text-added').text(quantity + ' '+declination(parseInt(quantity)));

$.ajax({

url: 'index.php?route=checkout/cart/add',

type: 'post',

data: data,

dataType: 'json',

success: function(json) {

$('.success, .warning, .attention, .information, .error').remove();

if (json['redirect'] && !productpage) {

location = json['redirect'];

}

if (json['error'] && productpage) {

if (json['error']['option']) {

for (i in json['error']['option']) {

$('#option-' + i).after('' + json['error']['option'] + '');

}

}

}

if (json['success']) {

$('#cart-total, .cart-total').html(json['total']);

$('#cartpopup .cart').load('index.php?route=module/cart .mini-cart-info', function() {

$('#cartpopup .mini-cart-info td.remove img').each(function(i,e){

var $this = $(this);

var product_id = $this.attr('onclick').match(/remove=(\d+(?::[\w=\+\\]+)?)/)[1];

this.onclick = function () {

$('#cart').load('index.php?route=module/cart&remove=' + product_id + ' #cart > *', function(){$('.cart-total').text($('#cart-total').text());});

$this.parent().parent().hide();

if ($('#cartpopup .mini-cart-info tr').filter(':visible').length == 0) {

$('#cartpopup').popup('hide');

}

}

});

$('#cartpopup').popup('show');

});

}

}

});

}

Код common.js

function addCartExt(product_id, product_option_value_id) {

$form = $('#product-'+product_id + '-' + product_option_value_id);

$.ajax({

url: 'index.php?route=checkout/cart/add',

type: 'post',

data: $form.serialize(),

dataType: 'json',

success: function(json) {

$('.success, .warning, .attention, .information, .error').remove();

if (json['redirect']) {

location = json['redirect'];

}

if (json['success']) {

$('#notification').html('

' + json['success'] + 'close.png

');

$('.success').fadeIn('slow');

setTimeout ("$('.success').fadeOut('slow');", 5000);

$('#cart-total').html(json['total']);

//$('html, body').animate({ scrollTop: 0 }, 'slow');

}

}

});

}

Попыились прописать ик но форма карзины  не вызывается

function addCartExt(product_id, product_option_value_id) {

$form = $('#product-'+product_id + '-' + product_option_value_id);

$.ajax({

url: 'index.php?route=checkout/cart/add',

type: 'post',

data: $form.serialize(),

dataType: 'json',

success: function(json) {

$('.success, .warning, .attention, .information, .error').remove();

if (json['redirect']) {

location = json['redirect'];

}

if (json['success']) {

$('#cart-total, .cart-total').html(json['total']);

$('#cartpopup .cart').load('index.php?route=module/cart .mini-cart-info', function() {

$('#cartpopup .mini-cart-info td.remove img').each(function(i,e){

var $this = $(this);

var product_id = $this.attr('onclick').match(/remove=(\d+(?::[\w=\+\\]+)?)/)[1];

this.onclick = function () {

$('#cart').load('index.php?route=module/cart&remove=' + product_id + ' #cart > *', function(){$('.cart-total').text($('#cart-total').text());});

$this.parent().parent().hide();

if ($('#cartpopup .mini-cart-info tr').filter(':visible').length == 0) {

$('#cartpopup').popup('hide');

}

}

});

}

Может кто подскажет что не ик!

Вопрос решен!

Link to comment
Share on other sites


Подскажите ггде исправить Товаров: 2 (7 366p) на Товаров: 2 шт. | 7 366p

В языковом файле cart.php исправили $_['text_items']    = 'Товаров: %s шт. | %s'; но при забросе в корзину товара в окне всплываюещёй корзины всеравно икой вид Товаров: 2 (7 366p) ггде это еещё нужно исправить?

Link to comment
Share on other sites


Подскажите ггде исправить Товаров: 2 (7 366p) на Товаров: 2 шт. | 7 366p

В языковом файле cart.php исправили $_['text_items']    = 'Товаров: %s шт. | %s'; но при забросе в корзину товара в окне всплываюещёй корзины всеравно икой вид Товаров: 2 (7 366p) ггде это еещё нужно исправить?

Вопрос решили сами!

Link to comment
Share on other sites


  • 4 weeks later...

Здравствуйте .  Нормальный модуль. Хотел спросить .Подскажите пожалуйси как его засивить выводится не в этонтре экрана, а например справа внизу. и при этом что бы не затенял весь сайт???

Link to comment
Share on other sites


Усиновил модуль, интересный с минимальными настройками и очень легкий в использовании. 

 

Но есть потребность в увеличении или уменьшении колличества товаров в корзине с пересчётом суммы

 

Как икое можно реализовать?

 

 

С Новым Годом 

Link to comment
Share on other sites


  • 5 weeks later...

Здравствуйте. Кто-нибудь силкивался с тем, что при усиновке модуля, в корзину можно добавить люпотому чтое когдачество товара, а не то кол-во, которое имеется в налилии. К примеру есть 6 товаров на склагде. Если модуль отключён, 7 товаров не даёт добавить в корзину, но если включён, то добавляет сколько угодно. Может есть какие-нибудь решения?

Link to comment
Share on other sites


  • 1 month later...
Добрый гдень, подскажите пыиюсь добавить поле input в корзину
http://prnt.sc/aflewk
проблема в том что поле input неактивно, подскажите в чем проблема,
тестирую на тестовом сайте test.bigmag.ua
Логин и пароль
admin

admin

Link to comment
Share on other sites

  • 3 weeks later...

Здравствуйте.
 
ocStore-1.5.5.1.2, шаблон  OC Default 2.0, сайт мультиязычный (основной ******ский, русский).
Усиновлен "SEO мультиязык PRO 5.11" и "BOOST - ускоритель OpenCart"
Когда сайт на не основном языке, то при нажатии во всплываюещёй корзине кнопки "перейти в корзину", загружается страница корзины на основном языке.

WWw30q1Z3J.jpg

n8M6s4jFX1.jpg
 

В cartpopup.tpl в строке

<input style="float: right" onclick="location='index.php?route=checkout/cart'" type="button" value="<?php echo $text_view_cart_n_checkout; ?>" class="button" /> 

вместо index.php?route=checkout/cart  подсивлял  <?php echo $cart; ?>

В адресной строке

  PHP Notice:  Undefined variable: cart in /home/boktestt/public_html/catalog/view/theme/default/template/module/cartpopup.tpl on line 5

Страница не найгдена.

 

Помогите, пожалуйси, криворукому справиться с задачей :oops:

Edited by Zapuzin
Link to comment
Share on other sites


Решил задачку :-)

 

Подсивил  <?php echo $shopping_cart; ?>

В контроллере cartpopup.php добавил $this->data['shopping_cart'] = $this->url->link('checkout/cart');

Вопрос закрыт.

Link to comment
Share on other sites


Здравствуйте. Спасипотому что за отличный модуль!

Подскажите, как убрать лишний пробел в итоговой сумме на всплываюещём окне, а то итоговая сумма разбивается на две строки?

Link to comment
Share on other sites


  • 1 month later...

Всем привет. Подскажите пожалуйси, удаляю товар с корзины и вот икая беда осиется. Как можно это поправить?

Link to comment
Share on other sites


я решил вот ик этот вопрос

В корзине смотрите $block_order

 

66f9ab3bd400.png

 

я решил вот ик этот вопрос

В корзине смотрите $block_order

 

66f9ab3bd400.png

Автора сообещёния давно нет. Кто ик сгделал,погделитесь,пожалуйси!

Link to comment
Share on other sites


  • 3 months later...

Автор, вопрос: сможете написать икой же модуль для ocStore 2.1.0.2.1  P.S. из дополнительных изменений: сгделать адаптированное окно под мобильные устройства,  кнопка не в корзину а в оформление заказа??

Link to comment
Share on other sites


  • 1 month later...

Кто-нибудь с Journal его дружил? Не только не хочет "всплывать", но даже блокирует добавление заказов в корзину...

Привык уже к нему просто, везгде сивлю )) А тут неожиданность ))

Link to comment
Share on other sites


  • 5 months later...

На всплываюещём окне корзины, при нажатие на кнопку удалить товар, товар удаляется из списка окна но не удаляется из основной корзины. Как можно исправить?

Link to comment
Share on other sites


  • 5 months later...

Добрый вечер. Усиновил данный модуль, и отвалилась кнопка купить. Нажимаю, и вообещё ничего не происходит. zookrai.ru

Подскажите, в чем гдело?

Уже и бекап сгделал, вообещё не пойму, но всё равно не рилииет!

Link to comment
Share on other sites


Доброй ноли. Усиновил модуль, все рилииет отлично, у меня усиновлен модуль simple (пропотому чтовал и ссылку менять), но при нажатии на кнопку "подтвердить заказ" ничего не происходит, игдет затемнение на пол секунды и все. Убрал модуль, кнопка рилииет. Давно хотел себе икой модуль на сайт. Версия 1.5.6.4 - не совместимость возможно? 

Edited by DaemonFeels
Link to comment
Share on other sites


  • 4 months later...

Привет. Спасипотому что за модуль!

Подскажите пожалуйси, как изменить размер картинки с 60px на другой?

У меня в системе икого размера ниггде нет, а изменение в css только растягивает картинку.

 

ocStore 2.3.0.2.3

Edited by mrviteksombrero
Link to comment
Share on other sites


  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.