Jump to content

Edit History

Sasni

Sasni

Domyślnie plik js jest  /themes/default-bootstrap/js ale jak używasz innego szablonu to tylko podmieniasz nazwę.

 

funkcja o której piszę powinna się zaczynać w 926 linijce 

function updateDiscountTable(newPrice)
{
	$('#quantityDiscount tbody tr').each(function(){
		var type = $(this).data("discount-type");
		var discount = $(this).data("discount");
		var quantity = $(this).data("discount-quantity");

		if (type == 'percentage')
		{
			var discountedPrice = newPrice * (1 - discount/100);
			var discountUpTo = newPrice * (discount/100) * quantity;
		}
		else if (type == 'amount')
		{
			var discountedPrice = newPrice - discount;
			var discountUpTo = discount * quantity;
		}

		if (displayDiscountPrice != 0)
			$(this).children('td').eq(1).text( formatCurrency(discountedPrice * currencyRate, currencyFormat, currencySign, currencyBlank) );
			$(this).children('td').eq(2).text(/*upToTxt + ' ' + */formatCurrency(discountedPrice, currencyFormat, currencySign, currencyBlank));
			$(this).children('td').eq(3).text(upToTxt + ' ' + formatCurrency(Math.round(discountUpTo * currencyRate), currencyFormat, currencySign, currencyBlank));
	});
}

 

Sasni

Sasni

Domyślnie plik js jest  /themes/default-bootstrap/js ale jak używasz innego szablonu to tylko podmieniasz nazwę.

 

funkcja o której piszę powinna się zaczynać w 926 linijce 

function updateDiscountTable(newPrice)
{
	$('#quantityDiscount tbody tr').each(function(){
		var type = $(this).data("discount-type");
		var discount = $(this).data("discount");
		var quantity = $(this).data("discount-quantity");

		if (type == 'percentage')
		{
			var discountedPrice = newPrice * (1 - discount/100);
			var discountUpTo = newPrice * (discount/100) * quantity;
		}
		else if (type == 'amount')
		{
			var discountedPrice = newPrice - discount;
			var discountUpTo = discount * quantity;
		}

		if (displayDiscountPrice != 0)
			$(this).children('td').eq(1).text( formatCurrency(discountedPrice * currencyRate, currencyFormat, currencySign, currencyBlank) );
			$(this).children('td').eq(2).text(/*upToTxt + ' ' + */formatCurrency(discountedPrice, currencyFormat, currencySign, currencyBlank));
			$(this).children('td').eq(3).text(upToTxt + ' ' + formatCurrency(Math.round(discountUpTo * currencyRate), currencyFormat, currencySign, currencyBlank));
	});
}

Tutaj możesz zobaczyć jak to działa : https://sklep.tech-sas.pl/1233-avast-endpoint-protection.html

×
×
  • Create New...