Jump to content

zmena ceny bez DPH pri zlave na stránke produktu s atributami


Luigo05

Recommended Posts

Ahoj, mam prestashop 1.6.1.5 a pouzil som kod na zmenu cez bez DPH na stanke produkty a taktiez som pozmeniel product.js aby vsetko fungovalo spravne. Vsetko funguje fajn, ale akonahle dam zlavu na produkt tak cena bez DPH sa stale zobrazuje bez zlavy. Prikladam moj product.js. Nevie mi s tym niekto poradit prosim. Dakujem

 

if (priceWithDiscountsDisplay > 0)
    {
    if(findSpecificPrice()){
      $('#our_price_display').text(findSpecificPrice()).trigger('change');
    }
    else{
      $('#our_price_display').text(formatCurrency(priceWithDiscountsDisplay, currencyFormat, currencySign, currencyBlank)).trigger('change');
      $('#our_price_displaybezdane').text(formatCurrency(basePriceWithoutTax * currencyRate, currencyFormat, currencySign, currencyBlank));
    }
    
    }
    else
    {
        $('#our_price_display').text(formatCurrency(0, currencyFormat, currencySign, currencyBlank)).trigger('change');
    }

    // If the calculated price (after all discounts) is different than the base price
    // we show the old price striked through

    if (priceWithDiscountsDisplay.toFixed(2) != basePriceDisplay.toFixed(2))
    {
        $('#old_price_display span.price').text(formatCurrency(basePriceDisplay, currencyFormat, currencySign, currencyBlank));
        $('#old_price, #old_price_display, #old_price_display_taxes').removeClass('hidden').show();

        // Then if it's not only a group reduction we display the discount in red box
        if (priceWithDiscountsWithoutTax != priceWithGroupReductionWithoutTax)
        {
            if (combination.specific_price.reduction_type == 'amount')
            {
                $('#reduction_amount_display').html('-' + formatCurrency(discountValue, currencyFormat, currencySign, currencyBlank));
                $('#reduction_amount').show();
            }
            else
            {
                var toFix = 2;
                if ((parseFloat(discountPercentage).toFixed(2) - parseFloat(discountPercentage).toFixed(0)) == 0)
                    toFix = 0;
                $('#reduction_percent_display').html('-' + parseFloat(discountPercentage).toFixed(toFix) + '%');
                $('#reduction_percent').show();
            }
        }

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
×
×
  • Create New...