wdrożenia PrestaShop Powiększenie zdjęć moduł

Kombinacje nie uwzględniają zmian ceny

  • 1 Odpowiedzi
  • 2019 Wyświetleń

0 użytkowników i 1 Gość przegląda ten wątek.

*

Offline maoma

  • Nowy
  • *
  • 2
  • 0
  • prestashop
  • PrestaShop: PS
  • Status: forum
Kombinacje nie uwzględniają zmian ceny
« dnia: Luty 01, 2015, 08:41:33 pm »
Dodalam kombinacje do produktow w swoim sklepie. Zadaniem kombinacji ma byc wzrost cen w zaleznosci od parametrow. W panelu administracyjnym wszystko wyglada jak pozinno. Nietstety w sklepie kombinacje nie dzialaja poprawnie. Niezaleznie od wybranego typu produktu, wyswietla sie jedna cena, nie uwzgledniajac kombinacji wzrostu cen. Klient prawdziwa cene poznaje dopiero po dodaniu towaru do koszyka, gdzie pojawia sie jego autencyczna cena. Na innych formach czytalam ze przyczyna moze tkwic w przypadku gdy towar dodawany jest w innych walutach. U mnie dodany jest towar w euro a wyswietlany w zlotowkach. Presta 1.6.0.6. Będę wdzięczna za pomoc,

/*

    }
}
//add a combination of attributes in the global JS sytem
function addCombination(idCombination, arrayOfIdAttributes, quantity, price, ecotax, id_image, reference, unit_price, minimal_quantity, available_date, combination_specific_price)
{
    globalQuantity += quantity;
    var combination = [];
    combination['idCombination'] = idCombination;
    combination['quantity'] = quantity;
    combination['idsAttributes'] = arrayOfIdAttributes;
    combination['price'] = price;
    combination['ecotax'] = ecotax;
    combination['image'] = id_image;
    combination['reference'] = reference;
    combination['unit_price'] = unit_price;
    combination['minimal_quantity'] = minimal_quantity;
    combination['available_date'] = available_date;
    combination['specific_price'] = [];
    combination['specific_price'] = combination_specific_price;
    combinations.push(combination);
}
// search the combinations' case of attributes and update displaying of availability, prices, ecotax, and image
function findCombination(firstTime)
{
    $('#minimal_quantity_wanted_p').fadeOut();
    $('#quantity_wanted').val(1);
    //create a temporary 'choice' array containing the choices of the customer
    var choice = [];
    $('#attributes select, #attributes input[type=hidden], #attributes input[type=radio]:checked').each(function(){
        choice.push($(this).val());
    });
    //testing every combination to find the conbination's attributes' case of the user
    for (var combination = 0; combination < combinations.length; ++combination)
    {
        //verify if this combinaison is the same that the user's choice
        var combinationMatchForm = true;
        $.each(combinations[combination]['idsAttributes'], function(key, value)
        {
            if (!in_array(value, choice))
            {
                combinationMatchForm = false;
            }
        });
        if (combinationMatchForm)
        {
            if (combinations[combination]['minimal_quantity'] > 1)
            {
                $('#minimal_quantity_label').html(combinations[combination]['minimal_quantity']);
                $('#minimal_quantity_wanted_p').fadeIn();
                $('#quantity_wanted').val(combinations[combination]['minimal_quantity']);
                $('#quantity_wanted').bind('keyup', function() {checkMinimalQuantity(combinations[combination]['minimal_quantity']);});
            }
            //combination of the user has been found in our specifications of combinations (created in back office)
            selectedCombination['unavailable'] = false;
            selectedCombination['reference'] = combinations[combination]['reference'];
            $('#idCombination').val(combinations[combination]['idCombination']);
            //get the data of product with these attributes
            quantityAvailable = combinations[combination]['quantity'];
            selectedCombination['price'] = combinations[combination]['price'];
            selectedCombination['unit_price'] = combinations[combination]['unit_price'];
            selectedCombination['specific_price'] = combinations[combination]['specific_price'];
            if (combinations[combination]['ecotax'])
                selectedCombination['ecotax'] = combinations[combination]['ecotax'];
            else
                selectedCombination['ecotax'] = default_eco_tax;
            //show the large image in relation to the selected combination
            if (combinations[combination]['image'] && combinations[combination]['image'] != -1)
                displayImage( $('#thumb_'+combinations[combination]['image']).parent() );
            //show discounts values according to the selected combination
            if (combinations[combination]['idCombination'] && combinations[combination]['idCombination'] > 0)
                displayDiscounts(combinations[combination]['idCombination']);
            //get available_date for combination product
            selectedCombination['available_date'] = combinations[combination]['available_date'];
           
            //update the display
            updateDisplay();
            if(typeof(firstTime) != 'undefined' && firstTime)
                refreshProductImages(0);
            else
                refreshProductImages(combinations[combination]['idCombination']);
            //leave the function because combination has been found
            return;
        }
    }
    //this combination doesn't exist (not created in back office)
    selectedCombination['unavailable'] = true;
    updateDisplay();
}
//update display of the availability of the product AND the prices of the product
function updateDisplay()
{
    if (!selectedCombination['unavailable'] && quantityAvailable > 0 && productAvailableForOrder == 1)
    {
        //show the choice of quantities
        $('#quantity_wanted_p:hidden').show('slow');
        //show the "add to cart" button ONLY if it was hidden
        $('#add_to_cart:hidden').fadeIn(600);
        //hide the hook out of stock
        $('#oosHook').hide();
       
        //hide availability date
        $('#availability_date_label').hide();
        $('#availability_date_value').hide();
        //availability value management
        if (availableNowValue != '')
        {
            //update the availability statut of the product
            $('#availability_value').removeClass('warning_inline');
            $('#availability_value').text(availableNowValue);
            if(stock_management == 1)
                $('#availability_statut:hidden').show();
        }
        else
        {
            //hide the availability value
            $('#availability_statut:visible').hide();
        }
        //'last quantities' message management
        if (!allowBuyWhenOutOfStock)
        {
            if (quantityAvailable <= maxQuantityToAllowDisplayOfLastQuantityMessage)
            $('#last_quantities').show('slow');
            else
                $('#last_quantities').hide('slow');
        }
        if (quantitiesDisplayAllowed)
        {
            $('#pQuantityAvailable:hidden').show('slow');
            $('#quantityAvailable').text(quantityAvailable);
            if (quantityAvailable < 2) // we have 1 or less product in stock and need to show "item" instead of "items"
            {
                $('#quantityAvailableTxt').show();
                $('#quantityAvailableTxtMultiple').hide();
            }
            else
            {
                $('#quantityAvailableTxt').hide();
                $('#quantityAvailableTxtMultiple').show();
            }
        }
    }
    else
    {
        //show the hook out of stock
        if (productAvailableForOrder == 1)
        {
            $('#oosHook').show();
            if ($('#oosHook').length > 0 && function_exists('oosHookJsCode'))
                oosHookJsCode();
        }
        //hide 'last quantities' message if it was previously visible
        $('#last_quantities:visible').hide('slow');
        //hide the quantity of pieces if it was previously visible
        $('#pQuantityAvailable:visible').hide('slow');
        //hide the choice of quantities
        if (!allowBuyWhenOutOfStock)
            $('#quantity_wanted_p:visible').hide('slow');
        //display that the product is unavailable with theses attributes
        if (!selectedCombination['unavailable'])
            $('#availability_value').text(doesntExistNoMore + (globalQuantity > 0 ? ' ' + doesntExistNoMoreBut : '')).addClass('warning_inline');
        else
        {
            $('#availability_value').text(doesntExist).addClass('warning_inline');
            $('#oosHook').hide();
        }
        if(stock_management == 1)
            $('#availability_statut:hidden').show();
       
        //display availability date
        if (selectedCombination.length)
        {
            var available_date = selectedCombination['available_date'];
            tab_date = available_date.split('-');
            var time_available = new Date(tab_date[2], tab_date[1], tab_date[0]);
            time_available.setMonth(time_available.getMonth()-1);
            var now = new Date();
            // date displayed only if time_available
            if (now.getTime() < time_available.getTime())
            {
                $('#availability_date_value').text(selectedCombination['available_date']);
                $('#availability_date_label').show();
                $('#availability_date_value').show();
            }
            else
            {
                $('#availability_date_label').hide();
                $('#availability_date_value').hide();
            }
        }
        //show the 'add to cart' button ONLY IF it's possible to buy when out of stock AND if it was previously invisible
        if (allowBuyWhenOutOfStock && !selectedCombination['unavailable'] && productAvailableForOrder == 1)
        {
            $('#add_to_cart:hidden').fadeIn(600);
            if (availableLaterValue != '')
            {
                $('#availability_value').text(availableLaterValue);
                if(stock_management == 1)
                    $('#availability_statut:hidden').show('slow');
            }
            else
                $('#availability_statut:visible').hide('slow');
        }
        else
        {
            $('#add_to_cart:visible').fadeOut(600);
            if(stock_management == 1)
                $('#availability_statut:hidden').show('slow');
        }
        if (productAvailableForOrder == 0)
            $('#availability_statut:visible').hide();
    }
    if (selectedCombination['reference'] || productReference)
    {
        if (selectedCombination['reference'])
            $('#product_reference span').text(selectedCombination['reference']);
        else if (productReference)
            $('#product_reference span').text(productReference);
        $('#product_reference:hidden').show('slow');
    }
    else
        $('#product_reference:visible').hide('slow');
    //update display of the the prices in relation to tax, discount, ecotax, and currency criteria
    if (!selectedCombination['unavailable'] && productShowPrice == 1)
    {
        var priceTaxExclWithoutGroupReduction = '';
        // retrieve price without group_reduction in order to compute the group reduction after
        // the specific price discount (done in the JS in order to keep backward compatibility)
        if (!displayPrice && !noTaxForThisProduct)
        {
            priceTaxExclWithoutGroupReduction = ps_round(productPriceTaxExcluded, 6) * (1 / group_reduction);
        } else {
            priceTaxExclWithoutGroupReduction = ps_round(productPriceTaxExcluded, 6) * (1 / group_reduction);
        }
        var combination_add_price = selectedCombination['price'] * group_reduction;
        var tax = (taxRate / 100) + 1;
        var display_specific_price;
        if (selectedCombination.specific_price)
        {
            display_specific_price = selectedCombination.specific_price['price'];
            if (selectedCombination['specific_price'].reduction_type == 'percentage')
            {
                $('#reduction_amount').hide();
                $('#reduction_percent_display').html('-' + parseFloat(selectedCombination['specific_price'].reduction_percent) + '%');
                $('#reduction_percent').show();
            } else if (selectedCombination['specific_price'].reduction_type == 'amount' && selectedCombination['specific_price'].reduction_price != 0) {
                $('#reduction_amount_display').html('-' + formatCurrency(selectedCombination['specific_price'].reduction_price, currencyFormat, currencySign, currencyBlank));
                $('#reduction_percent').hide();
                $('#reduction_amount').show();
            } else {
                $('#reduction_percent').hide();
                $('#reduction_amount').hide();
            }
        }
        else
        {
            display_specific_price = product_specific_price['price'];
            if (product_specific_price['reduction_type'] == 'percentage')
                $('#reduction_percent_display').html(product_specific_price['specific_price'].reduction_percent);
        }
       
        if (product_specific_price['reduction_type'] != '' || selectedCombination['specific_price'].reduction_type != '')
            $('#discount_reduced_price,#old_price').show();
        else
            $('#discount_reduced_price,#old_price').hide();
       
        if (product_specific_price['reduction_type'] == 'percentage' || selectedCombination['specific_price'].reduction_type == 'percentage')
            $('#reduction_percent').show();
        else
            $('#reduction_percent').hide();
        if (display_specific_price)
            $('#not_impacted_by_discount').show();
        else
            $('#not_impacted_by_discount').hide();
        var taxExclPrice = (display_specific_price && display_specific_price >= 0  ? (specific_currency ? display_specific_price : display_specific_price * currencyRate) : priceTaxExclWithoutGroupReduction) + selectedCombination['price'] * currencyRate;
        if (display_specific_price)
            productPriceWithoutReduction = priceTaxExclWithoutGroupReduction + selectedCombination['price'] * currencyRate; // Need to be global => no var
        if (!displayPrice && !noTaxForThisProduct)
        {
   

*

Offline west

  • Administrator
  • Mieszkaniec
  • *****
  • 5,286
  • 106
  • Płeć: Mężczyzna
  • Europasaz.pl
    • PrestaShop, Wordpress, SMF, Woocomerce
  • PrestaShop: 1.7
  • Status: Programista
Odp: Kombinacje nie uwzględniają zmian ceny
« Odpowiedź #1 dnia: Luty 02, 2015, 07:51:32 pm »
za to odpowiedzialny jest plik js umieszczony w katalogu tematu. moim zdaniem waluta nie ma tutaj znaczenia. Zobacz plik product.js tam jest zaszyta z tego co pamiętam funkcja zmiany cen
MODUŁY | https://europasaz.pl |  SKLEPY INTERNETOWE | WSPARCIE TECHNICZNE | HOSTING | https://europasaz.pl