Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Recommended Posts

28.02.2023 в 14:57, kJlukOo сказал:

в личку напишите тестовый домен и версию

подскажите еще, пжлст, а в каком месте появится блок? Наш сайт - https://arcos.com.ua/ru/nozhi_po_seriyam/riviera_white/nozh_yaponskij_santoku_140_mm_riviera_white_arcos__233224

Link to comment
Share on other sites


28.02.2023 в 15:16, Gouache сказал:

подскажите еще, пжлст, а в каком месте появится блок? Наш сайт - https://arcos.com.ua/ru/nozhi_po_seriyam/riviera_white/nozh_yaponskij_santoku_140_mm_riviera_white_arcos__233224

этот момент настраивается

Link to comment
Share on other sites

  • 4 weeks later...

1. Подскажите, какой код JS нужен, чтобы при клике на кнопку купить комплект открывалась корзина в шаблоне Fellmart? Для наглядности: https://prnt.sc/8UZsTAW8dxbG

При нажатии комплект добавляется, но визуально это никак не видно. Лишь если самому зайти в корзину.

Я так понимаю вот скрипт добавления в корзину:

// Cart add remove functions
var cart = {
	'add': function(product_id, quantity) {
		$.ajax({
			url: 'index.php?route=checkout/cart/add',
			type: 'post',
			data: 'product_id=' + product_id + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1),
			dataType: 'json',
			cache: false,
			beforeSend: function() {
				$('#cart > button').button('loading');
			},
			complete: function() {
				$('#cart > button').button('reset');
			},
			success: function(json) {
				$('.alert-dismissible, .text-danger').remove();

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

				if (json['error'] && json['error']['error_warning']) {
					fmNotify('danger', '<div class="alert-text-item">' + json['error']['error_warning'] + '</div>');
				}

				if (json['success']) {
					if (json['isPopup']) {
						octPopupCart();
					} else {
						fmNotify('success', json['success']);
					}

					if(typeof octYandexEcommerce == 'function') {
						octYandexEcommerce(json);
				    }

					// Need to set timeout otherwise it wont update the total
					setTimeout(function () {
						$('.fm-menu-cart-index').html(json['total_products']);
						$('.fm-menu-cart-text').html(json['total_amount']);
					}, 100);
				}
			},
			error: function(xhr, ajaxOptions, thrownError) {
				alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
			}
		});
	},
	'update': function(key, quantity) {
		$.ajax({
			url: 'index.php?route=checkout/cart/edit',
			type: 'post',
			data: 'key=' + key + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1),
			dataType: 'json',
			cache: false,
			beforeSend: function() {
				$('#cart > button').button('loading');
			},
			complete: function() {
				$('#cart > button').button('reset');
			},
			success: function(json) {
				// Need to set timeout otherwise it wont update the total
				setTimeout(function () {
					$('#oct-cart-quantity, .header-cart-index, #mobile_cart_index').html(json['total_products']);
					$('.fm-menu-cart-text').html(json['total_amount']);
				}, 100);

				var now_location = String(document.location.pathname);

				if ((now_location == '/cart/') || (now_location == '/cart') || (now_location == '/checkout/') || (now_location == '/checkout') || (getURLVar('route') == 'checkout/cart') || (getURLVar('route') == 'checkout/checkout')) {
					location = 'index.php?route=checkout/cart';
				} else {
					$('#cart > ul').load('index.php?route=common/cart/info ul li');
				}
			},
			error: function(xhr, ajaxOptions, thrownError) {
				alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
			}
		});
	},
	'remove': function(key) {
		$.ajax({
			url: 'index.php?route=checkout/cart/remove',
			type: 'post',
			data: 'key=' + key,
			dataType: 'json',
			cache: false,
			beforeSend: function() {
				$('#cart > button').button('loading');
			},
			complete: function() {
				$('#cart > button').button('reset');
			},
			success: function(json) {
				// Need to set timeout otherwise it wont update the total
				setTimeout(function () {
					//$('#oct-cart-quantity, .header-cart-index, .mobile-header-index').html(json['total_products']);
					//$('.fm-cart-text').html(json['total_amount']);
				}, 100);

				var now_location = String(document.location.pathname);

				if ((now_location == '/cart/') || (now_location == '/cart') || (now_location == '/checkout/') || (now_location == '/checkout') || (getURLVar('route') == 'checkout/cart') || (getURLVar('route') == 'checkout/checkout')) {
					location = 'index.php?route=checkout/cart';
				} else {
					$('#cart > ul').load('index.php?route=common/cart/info ul li');
				}
			},
			error: function(xhr, ajaxOptions, thrownError) {
				alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
			}
		});
	}
}

 

2. Появилась возможность добавить комплект, если у товара такой имеется в окне popup (в том же шаблоне Feelmart). https://prnt.sc/7UMZuXhP8b6y ?

По аналогии с магазином Розетка: https://prnt.sc/XRVonEs-XCHm

 

3. Как указывать скидку в процентах? Если ставить число скидки и даже со знаком % - всё равно минусует только указанное число, а не проценты. 

 

4. Как вывести комплект в корзине Simple, если у товара таковой имеется?

Edited by SerginioWS
Link to comment
Share on other sites


27.03.2023 в 23:54, SerginioWS сказал:

1. Подскажите, какой код JS нужен, чтобы при клике на кнопку купить комплект открывалась корзина в шаблоне Fellmart? Для наглядности: https://prnt.sc/8UZsTAW8dxbG

При нажатии комплект добавляется, но визуально это никак не видно. Лишь если самому зайти в корзину.

Я так понимаю вот скрипт добавления в корзину:

// Cart add remove functions
var cart = {
	'add': function(product_id, quantity) {
		$.ajax({
			url: 'index.php?route=checkout/cart/add',
			type: 'post',
			data: 'product_id=' + product_id + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1),
			dataType: 'json',
			cache: false,
			beforeSend: function() {
				$('#cart > button').button('loading');
			},
			complete: function() {
				$('#cart > button').button('reset');
			},
			success: function(json) {
				$('.alert-dismissible, .text-danger').remove();

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

				if (json['error'] && json['error']['error_warning']) {
					fmNotify('danger', '<div class="alert-text-item">' + json['error']['error_warning'] + '</div>');
				}

				if (json['success']) {
					if (json['isPopup']) {
						octPopupCart();
					} else {
						fmNotify('success', json['success']);
					}

					if(typeof octYandexEcommerce == 'function') {
						octYandexEcommerce(json);
				    }

					// Need to set timeout otherwise it wont update the total
					setTimeout(function () {
						$('.fm-menu-cart-index').html(json['total_products']);
						$('.fm-menu-cart-text').html(json['total_amount']);
					}, 100);
				}
			},
			error: function(xhr, ajaxOptions, thrownError) {
				alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
			}
		});
	},
	'update': function(key, quantity) {
		$.ajax({
			url: 'index.php?route=checkout/cart/edit',
			type: 'post',
			data: 'key=' + key + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1),
			dataType: 'json',
			cache: false,
			beforeSend: function() {
				$('#cart > button').button('loading');
			},
			complete: function() {
				$('#cart > button').button('reset');
			},
			success: function(json) {
				// Need to set timeout otherwise it wont update the total
				setTimeout(function () {
					$('#oct-cart-quantity, .header-cart-index, #mobile_cart_index').html(json['total_products']);
					$('.fm-menu-cart-text').html(json['total_amount']);
				}, 100);

				var now_location = String(document.location.pathname);

				if ((now_location == '/cart/') || (now_location == '/cart') || (now_location == '/checkout/') || (now_location == '/checkout') || (getURLVar('route') == 'checkout/cart') || (getURLVar('route') == 'checkout/checkout')) {
					location = 'index.php?route=checkout/cart';
				} else {
					$('#cart > ul').load('index.php?route=common/cart/info ul li');
				}
			},
			error: function(xhr, ajaxOptions, thrownError) {
				alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
			}
		});
	},
	'remove': function(key) {
		$.ajax({
			url: 'index.php?route=checkout/cart/remove',
			type: 'post',
			data: 'key=' + key,
			dataType: 'json',
			cache: false,
			beforeSend: function() {
				$('#cart > button').button('loading');
			},
			complete: function() {
				$('#cart > button').button('reset');
			},
			success: function(json) {
				// Need to set timeout otherwise it wont update the total
				setTimeout(function () {
					//$('#oct-cart-quantity, .header-cart-index, .mobile-header-index').html(json['total_products']);
					//$('.fm-cart-text').html(json['total_amount']);
				}, 100);

				var now_location = String(document.location.pathname);

				if ((now_location == '/cart/') || (now_location == '/cart') || (now_location == '/checkout/') || (now_location == '/checkout') || (getURLVar('route') == 'checkout/cart') || (getURLVar('route') == 'checkout/checkout')) {
					location = 'index.php?route=checkout/cart';
				} else {
					$('#cart > ul').load('index.php?route=common/cart/info ul li');
				}
			},
			error: function(xhr, ajaxOptions, thrownError) {
				alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
			}
		});
	}
}

 

2. Появилась возможность добавить комплект, если у товара такой имеется в окне popup (в том же шаблоне Feelmart). https://prnt.sc/7UMZuXhP8b6y ?

По аналогии с магазином Розетка: https://prnt.sc/XRVonEs-XCHm

 

3. Как указывать скидку в процентах? Если ставить число скидки и даже со знаком % - всё равно минусует только указанное число, а не проценты. 

 

4. Как вывести комплект в корзине Simple, если у товара таковой имеется?

if (json['isPopup']) {
    octPopupCart();
} else {
    fmNotify('success', json['success']);
}

setTimeout(function() {
    $('.fm-menu-cart-index').html(json['total_products']);
    $('.fm-menu-cart-text').html(json['total_amount']);
}, 100);

3. скидка в %. писать "5%"

4. виджетом. в виджете поставить галочка около CART

 

Link to comment
Share on other sites

  • 1 month later...

@ kJlukOo 
Добрый день! Есть проблема с модулем КомплектыPro, использую в теме ReMarket (opencart 3). Сейчас при сохранении комплекта у товара ничего не происходит и не сохраняется комплект, в консоле запрос уходит со статусом 200 https://prnt.sc/z_z6dXeKKyG4 , https://prnt.sc/DZTeSqXlE3Xy и все, подскажите, как решить проблему ?

Link to comment
Share on other sites


10.05.2023 в 10:56, room15 сказал:

@ kJlukOo 
Добрый день! Есть проблема с модулем КомплектыPro, использую в теме ReMarket (opencart 3). Сейчас при сохранении комплекта у товара ничего не происходит и не сохраняется комплект, в консоле запрос уходит со статусом 200 https://prnt.sc/z_z6dXeKKyG4 , https://prnt.sc/DZTeSqXlE3Xy и все, подскажите, как решить проблему ?

ключ кривой. напишите домен в личку на котором используете

Link to comment
Share on other sites

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.