Jump to content

změna ceny bez DPH u slevy na stránce produktu


Recommended Posts

Ahoj, mám prestashop 1.6.1.5 a použil jsem kód pro zobrazení ceny s DPH a zároveň bez DPH na stránce produktu. Problém nastal, když jsem použil specific price (slevu) u produktu. Všechny ceny se mění i v různých kombinacích, ale cenu bez daně to počítá stále ze základní ceny a ne ze zlevněné. Máte někdo nápad jak to vyřešit? díky

Link to comment
Share on other sites

  • 1 month later...

Mám ten samý problém. muj product.js. Nevíte mi poradit?

 

    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...