FiveM Upvotes configuration and order

April 3, 2021


‘); }); $(window).on(“load”, function() { selectProduct(62); }); function selectGame(product_id, game_id) { $(‘.game-list li a’).removeClass(‘active’); $(‘.game-list li a[data-id=’+ game_id +’]’).addClass(‘active’); $(‘#productConfig’).removeClass(‘hidden’); $(‘#productConfig’).slideDown(500, function () { $(‘#game_id’).val(game_id); $(‘#container #container-row’).load(‘/interface/shop/product/_ajax/html_productConfig.php?product_id=’+ product_id +’&game_id=’+ game_id, function(){ setTimeout(triggerClickForAccounting, 200); computePrice(); if (game_id === 0) { $(‘.row-game-list’).slideDown(1000); $(‘#productConfig’).slideUp(1000); } else { $(‘.row-game-list’).slideUp(1000, function() { scrollto(‘#productConfig’); }); } }); }); } function switchGame() { $(‘.row-game-list’).slideDown(1000, function () { scrollto(‘.game-list-search’); }); } function selectDelivery(product_id) { $(‘.game-list li a’).removeClass(‘active’); $(‘.game-list li a[data-id=’+ game_id +’]’).addClass(‘active’); $(‘#productConfig’).removeClass(‘hidden’); $(‘#productConfig’).slideDown(500); $(‘#game_id’).val(game_id); scrollto(‘#productConfig .panel-title’); $(‘#container #container-row’).load(‘/interface/shop/product/_ajax/html_productConfig.php?product_id=’ + product_id, function(){ computePrice(); }); } function selectProduct(productId, packageId) { $(‘#productConfig’).removeClass(‘hidden’); $(‘#container #container-row’).load(‘/interface/shop/product/_ajax/html_productConfig.php?product_id=’ + productId + ‘&packageId=’ + packageId, function(){ setTimeout(triggerClickForAccounting, 200); computePrice(); }); } var shopAjaxRunning = 0; var productPrice = 0; var currentRAM = 0; var pricedConfigurationModules = []; function updatePrices() { console.log(“Update!”); $.post(“/interface/shop/product/_ajax/json_computeProductPrice.php”, $(“#productForm”).serialize(), function(data) { console.log(“Hello, test!”); for (var fieldId in shopConfig) { if (shopConfig[fieldId].visible) { shopConfig[fieldId].visible = false; } } for (var fieldId in data.fieldList) { shopConfig[fieldId] = data.fieldList[fieldId]; } shopOverlay.updating = false; productPrice = data.bruttoValue.toFixed(2); shopOverlay.productPrice = productPrice; shopOverlay.taxIsIncluded = data.includedTax; shopOverlay.taxDescription = data.taxDescription; shopOverlay.productPriceNet = data.nettoValue.toFixed(2); shopOverlay.productPriceTax = data.taxValue.toFixed(2); var voucherPriceNoteContainer = $(‘.payment-methods-option-price-detail’); var creditCardInput = $(‘.payment-methods-option[data-payment-method=credit_card]’); if (typeof(creditCardInput.data(‘disabled-by-limit’)) === ‘undefined’ || ! creditCardInput.data(‘disabled-by-limit’)) { creditCardInput.removeClass(‘disabled’).find(‘.blur-overlay’).remove(); } if (productPrice < .5) { creditCardInput.addClass('disabled').append('Minimum amount: 50 cents]]>‘).removeClass(‘payment-methods-option-checked’); creditCardInput.siblings(‘.payment-methods-option-modal’).remove(); } console.log(“Brutto”, productPrice, “Account”, accountBalance); if ($(‘.payment-methods-option-checked’).length > 0) { if ($(‘.payment-methods-option-checked’).data(‘payment-method’) === ‘Balance’) { if (productPrice > accountBalance) { $(document).ready(function () { $(‘.payment-methods-option-finish-submit’).html(‘Cash in‘).addClass(‘no-upgrade-change’); }); } else { $(document).ready(function () { $(‘.payment-methods-option-finish-submit’).html(‘Buy now‘); }); } } } if (data.paymentOptions != undefined && data.paymentOptionsHash != undefined) { $(‘#payment-options-buy-process input[name=paymentOptions]’).val(data.paymentOptions); $(‘#payment-options-buy-process input[name=paymentOptionsHash]’).val(data.paymentOptionsHash); } /*if (–shopAjaxRunning === 0) { $(‘#nextBtn’).prop(‘disabled’, false).find(“i”).removeClass(“fa-spin fa-refresh fa-fw”).addClass(“fa-chevron-right”); }*/ // Find the info-price field for runtime var runtimeInfoPriceContainer = $(‘.product-slider’).find(‘[data-service-key=”order_runtime”]’).closest(‘.configuration-module’).find(‘.configuration-module-price-box span’); var addonPrice; if (data.fieldList[6] != undefined) { addonPrice = Number(Math.round(data.fieldList[6].runtimeSum.brutto+’e2′)+’e-2′); runtimeInfoPriceContainer.html(priceWithSigns(addonPrice)); $(‘.payment-methods-option-modal-price’).html(priceWithSigns(addonPrice)); } /*if (data.fieldList[164] != undefined) { $(‘.product-checkbox-list-accounting .configuration-module-price-box span’).html(data.fieldList[164] .percent + ‘ %’); } else { $(‘.product-checkbox-list-accounting .configuration-module-price-box span’).html(‘0 %’); }*/ voucherPriceNoteContainer.hide(); var paymentDropdownPrice = ”; // Compare the gross values if no one time product if (! data.isOneTimeProduct && data.runtimeSum.bruttoValue !== data.bruttoValue) { // It looks like a voucher is being applied and there is more than one lifelong runtime paymentDropdownPrice = ” + data.runtimeSum.brutto + ‘ ‘; if (data.couponSetupSum.brutto !== 0) { // The voucher is for the first runtime, tell the customer about the actual price voucherPriceNoteContainer.find(‘.actual-price’).html(data.runtimeSum.brutto); voucherPriceNoteContainer.slideDown(); } } paymentDropdownPrice = paymentDropdownPrice + data.brutto; $(‘.payment-methods-option-modal-price’).hide().html(paymentDropdownPrice).fadeIn(500); $(‘.userbar-info-block-price .userbar-info-block-value’).hide().html(data.brutto).fadeIn(500); $(‘.shop-nav-new-content-textbox-price span:first-of-type’).hide().html(data.brutto).fadeIn(500); if (! Currency.is_default) { $(‘.payment-methods-option-modal-price-after’) .find(‘.original-price’) .hide() .text(‘Original price: ‘ + sprintf(DefaultCurrency.format, data.bruttoEuro, DefaultCurrency.symbol) + ‘ / ‘) .fadeIn(500); } $(‘.productSetupPrice’).html(data.setupSum.brutto); var btnDisabled = false; shopOverlay.runtimeDescription = ‘/ ‘ + data.brutto; if(data.runtime == 1) shopOverlay.runtimeDescription = ‘/ ‘ + data.runtimeDesc; else if(data.runtime == “one-time”) shopOverlay.runtimeDescription = ‘/ ‘ + data.runtime; else shopOverlay.runtimeDescription = ‘/ ‘ + data.runtimeDesc; if (!btnDisabled) { $(‘.payment-methods-option-finish .payment-methods-option-finish-submit’).prop(‘disabled’, false); } shopOverlay.totalRam = data.ram; shopOverlay.premiumHostSelected = data.premiumHostSelected; onHeaderVisibilityChange(); $.post(‘/interface/shop/product/_ajax/json_getOptionPrices.php’, { modules: pricedConfigurationModules, formatMoney: true, }, function (response) { if (response.result === ‘success’) { var prices = response.data; for (var priceKey in prices) { if (prices.hasOwnProperty(priceKey)) { var price = prices[priceKey]; var module = $(‘.configuration-module-priced[data-price-key=’+priceKey+’]’); module.find(‘.configuration-module-price-box span’).html(price); } } } }, ‘json’); }, “json”); } var computePriceTimeout; var updatePriceTimeout; var configuratorContainer = null; function computePrice() { // Configurator container not selected yet if (configuratorContainer === null) { configuratorContainer = $(‘#productConfig’); } let selectedSite = $(‘.field_site input:checked’); if (selectedSite.length > 0 && ! siteSelectorCheckSiteSelection(selectedSite, configuratorContainer)) { return; } clearTimeout(computePriceTimeout); clearTimeout(updatePriceTimeout); shopOverlay.updating = true; $(‘.payment-methods-option-finish .payment-methods-option-finish-submit’).prop(‘disabled’, true); var priceElements = [ ‘.payment-methods-option-modal-price’, ‘.userbar-info-block-price .userbar-info-block-value’, ‘.shop-nav-new-content-textbox-price span:first-of-type’ ]; $.each(priceElements, function(index, element) { $(element).fadeOut(500).promise().done(function () { $(element).html(‘‘).fadeIn(500); }); }); $(‘.configuration-module-priced’).each(function () { $(this).find(‘.configuration-module-price-box span’).html(‘‘); pricedConfigurationModules.push($(this).data(‘price-key’)); }); computePriceTimeout = setTimeout(function () { updatePriceTimeout = setTimeout(updatePrices, 1000); }, 1000) /*if (++shopAjaxRunning === 1) { $(‘.productRuntimePrice’).html(‘‘); $(‘#nextBtn’).prop(‘disabled’, true).find(“i”).addClass(“fa-spin fa-refresh fa-fw”).removeClass(“fa-chevron-right”); }*/ }

Minimum running time not reached

The %option_name% option requires a minimum term of %required_runtime% days. Please choose either another option or make sure that you reach the minimum runtime.

newRuntime) { var minimumsViolating = fieldMinimums.allIndexesOf(highestMinRuntime + “”); var violatingNames = []; for (var i = 0; i < minimumsViolating.length; i++) { violatingNames.push(fieldMinimumNames[minimumsViolating[i]]); } var violatingComplete = violatingNames.join("
“); if (minimumLastDisplay !== minimumsViolating.join(“,”) && minimumClosed === true) { minimumLastDisplay = minimumsViolating.join(“,”); minimumClosed = false; modal = $(‘#runtime-modal’); replacedRuntimeDescription = modal.find(‘#runtime-modal-description’).html().replace(“%option_name%”, violatingComplete).replace(“%required_runtime%”, highestMinRuntime); modal.find(‘#runtime-modal-description’).html(replacedRuntimeDescription); $(document).ready(function () { var priority = 2; var openModalPriority = $(‘.modal.in’).data(‘priority’); if (typeof openModalPriority !== ‘undefined’) { if (priority > openModalPriority || priority === openModalPriority) { $(‘.modal.in’).modal(‘hide’); $(‘.modal#runtime-modal’).modal(‘show’); } } else { $(‘.modal#runtime-modal’).modal(‘show’); } }); minimumClosed = true; } return false; } else { return true; } } function checkMinimumRuntime(fieldKey, optionMinimumRuntime, optionName, isUpdate, altRuntime) { return true; var highestMinRuntime = fieldMinimums.max(); if ($(‘input[name=accounting]’).val() === “none”) { return true; } optionMinimumRuntime = parseInt(optionMinimumRuntime); var runtimeSlider = $(‘.productField[data-service-key=order_runtime]’); var selectedRuntime = parseInt(runtimeSlider.attr(“data-service-key-value”)); if (isUpdate) { selectedRuntime = altRuntime; } if (selectedRuntime >= optionMinimumRuntime) { return true; } else { var minimumsViolating = fieldMinimums.allIndexesOf(highestMinRuntime + “”); var violatingNames = []; for (var i = 0; i < minimumsViolating.length; i++) { violatingNames.push(fieldMinimumNames[minimumsViolating[i]]); } var violatingComplete = violatingNames.join("
“); minimumLastDisplay = fieldKey; minimumClosed = false; modal = $(‘#runtime-modal’); replacedRuntimeDescription = modal.find(‘#runtime-modal-description’).html().replace(“%option_name%”, violatingComplete).replace(“%required_runtime%”, highestMinRuntime); modal.find(‘#runtime-modal-description’).html(replacedRuntimeDescription); $(document).ready(function () { var priority = 2; var openModalPriority = $(‘.modal.in’).data(‘priority’); if (typeof openModalPriority !== ‘undefined’) { if (priority > openModalPriority || priority === openModalPriority) { $(‘.modal.in’).modal(‘hide’); $(‘.modal#runtime-modal’).modal(‘show’); } } else { $(‘.modal#runtime-modal’).modal(‘show’); } }); minimumClosed = true; } return false; } function resetMinimumRuntime() { minimumLastDisplay = “”; } ]]>

Source