This commit is contained in:
2025-03-09 23:50:32 +01:00
parent 1e498b41c7
commit 67c05416ac
190 changed files with 8061 additions and 3363 deletions

View File

@@ -0,0 +1,34 @@
<?php
/**
* 2007-2021 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2021 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,137 @@
function jakKupicEhp() {
window.open('https://www.santanderconsumer.pl/raty-jak-kupic', 'jakKupic', 'width=710,height=500,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');
return false;
}
function obliczRateEhp(nrSklepu, symUrl, qtySelector, basketSelector) {
let koszyk, ilo, qty, basket, scbQty, scbPrice;
scbQty = -1;
scbPrice = -1;
if ($("#scb_price") && typeof($("#scb_price")) == 'object') {
scbPrice = $("#scb_price").text();
}
if ($("#scb_quantity") && typeof($("#scb_quantity")) == 'object') {
scbQty = $("#scb_quantity").text();
}
if (scbQty > 0 && scbPrice > 0) {
qty = $(qtySelector);
basket = $(basketSelector);
if(qty.length == 1 && basket.length == 1) {
scbQty = qty.val();
scbPrice = basket.attr('content');
}
scbPrice = scbPrice * scbQty;
scbPrice = Math.round(scbPrice * 100, 2) / 100; //some stupid code just to solve strange js numeric results problem
if (scbPrice > 100) {
window.open(symUrl + 'numerSklepu/' + nrSklepu + '/wariantSklepu/1/typProduktu/0/wartoscTowarow/' + scbPrice);
} else {
alert("Kredytujemy zakupy w cenie powyżej 100zł");
}
} else {
alert('Wrong parameters for calculate');
}
}
function simulationEhp(displayModal, shopNumber, symUrl, quantity, price) {
let scbQty, scbPrice;
scbQty = -1;
scbPrice = -1;
if ($("#scb_price") && typeof($("#scb_price")) == 'object') {
scbPrice = $("#scb_price").text();
}
if ($("#scb_quantity") && typeof($("#scb_quantity")) == 'object') {
scbQty = $("#scb_quantity").text();
}
if (scbQty > 0 && scbPrice > 0) {
/**
* if quantity an price are ok then use it for simulation. Otherwise - use defaults(
* scbQty and scbPrice) set on server side as smarty value
*/
if(quantity >= scbQty) {
scbQty = quantity;
// scbPrice = price;
}
if(price > 0){
scbPrice = price;
}
eHpSimRequestPrepare(displayModal, shopNumber, symUrl, scbPrice, scbQty);
} else {
alert('Wrong parameters for calculate');
}
}
function eHpSimRequestPrepare(displayModal, shopNumber, symUrl, unitPrice, orderQuantity){
let modal = document.getElementById('simInputModal');
/**
* tu - dialog z edycją unitPrice i orderQuantity. Pokazywany w zależności od parametru w konfiguracji wtyczki.
*
*/
if(displayModal == 1){
$('#ehpModalPrice').val(unitPrice);
$('#ehpModalQuantity').val(orderQuantity);
//display modal
modal.style.display = "block";
} else {
orderPrice = ehpCalcOrderPrice(unitPrice, orderQuantity);
/*
Jeśli w konfiguracji określono że dialog nie ma być pokazywany - wywołanie ehpSimRequest będzie robione stąd a nie z onclick
*/
ehpSimRequest(shopNumber, symUrl, orderPrice);
}
}
function ehpSimRequest(shopNumber, symUrl, orderPrice){
let modal = document.getElementById('simInputModal');
modal.style.display = "none";
if(!isNaN(orderPrice)){
if (orderPrice <= 100) {
alert("Uwaga, niewielka wartość towarów. Bank może nie udzielić tak niskiego kredytu.");
}
window.open(symUrl + 'numerSklepu/' + shopNumber + '/wariantSklepu/1/typProduktu/0/wartoscTowarow/' + orderPrice);
} else {
alert("Pola cena i ilość muszą zawierać liczby.");
}
}
function ehpCalcOrderPrice(unitPrice, qty){
let op = NaN;
unitPrice = parseFloat(unitPrice);
qty = parseFloat(qty);
if(!isNaN(qty) && !isNaN(unitPrice)){
op = unitPrice * qty;
op = Math.round(op * 100, 2) / 100;
}
return op;
}
function santanderCreditValidateForm() {
if ($('#santanderAgreement').is(':checked')) {
$('#scbSubmitBtn').removeAttr('disabled');
} else {
$('#scbSubmitBtn').attr('disabled','disabled');
}
}
function ehpStateRefresh() {
$('#busy').css('visibility','visible');
$('#refreshBtn').prop('disabled', true);
$.ajax({
type: 'POST',
url: $('#refreshCommand').val()+'?id_order=' + $('#ehp_id_order').val(),
// data: 'id_order=' + $('#id_order').val(),
// dataType: 'json',
timeout: 30000
}).done(function(json) {
location.reload(true);
// alert('done');
}).fail(function(json){
alert("Błąd przy wywołaniu serwisu bankowego.");
});
};

View File

@@ -0,0 +1,143 @@
window.onload = function () {
(function () {
// will be executed after page loading
if (!isNaN(parseFloat($("#downpaymentEhp").text()))){
let downpayment = parseFloat($("#downpaymentEhp").text());
if(downpayment > 0) {
$('#downpaymentEhp').css('background-color','red');
$('#downpaymentEhp').css('color','white');
$('#downpaymentEhp').css('font-weight','bold');
}
}
$("#refreshBtn").click(function(){
$('#busy').css('visibility','visible');
$('#refreshBtn').prop('disabled', true);
$.ajax({
type: 'POST',
url: $('#refreshCommand').val()+'?id_order=' + $('#id_order').val(),
// data: 'id_order=' + $('#id_order').val(),
// dataType: 'json',
timeout: 30000
}).done(function(json) {
location.reload(true);
// alert('done');
}).fail(function(json){
alert("Błąd przy wywołaniu serwisu bankowego.");
});
});
$("#OrderMapBtn").click(function(){
alert($('#OrderMapCmd').val());
});
$("[name='SCB_EHP_defaultQUeries']").on('change', function(){
if(this.value == 1){
try {
$("[name='SANTANDERCREDIT_QTY_QUERY']")[0].value = $('#EHP_CURRENT_QTY_QUERY').val();
$("[name='SANTANDERCREDIT_PRICE_QUERY']")[0].value = $('#EHP_CURRENT_PRICE_QUERY').val();
} catch (error) {
}
} else {
try {
$("[name='SANTANDERCREDIT_QTY_QUERY']")[0].value = $('#EHP_DEF_QTY_QUERY').val();
$("[name='SANTANDERCREDIT_PRICE_QUERY']")[0].value = $('#EHP_DEF_PRICE_QUERY').val();
} catch (error) {
}
}
});
$("#SCB_EHP_defaultUrls").on('change', function(){
if(this.value == 1){
try {
$("[name='SANTANDERCREDIT_URL_SYMULATOR']")[0].value = $('#EHP_CURRENT_URL_SYMULATOR').val();
$("[name='SANTANDERCREDIT_URL_WNIOSEK']")[0].value = $('#EHP_CURRENT_URL_WNIOSEK').val();
$("[name='SANTANDERCREDIT_SVC_LOCATION']")[0].value = $('#EHP_CURRENT_SVC_LOCATION').val();
} catch (error) {
}
} else {
try {
$("[name='SANTANDERCREDIT_URL_SYMULATOR']")[0].value = $('#EHP_DEF_URL_SYMULATOR').val();
$("[name='SANTANDERCREDIT_URL_WNIOSEK']")[0].value = $('#EHP_DEF_URL_WNIOSEK').val();
$("[name='SANTANDERCREDIT_SVC_LOCATION']")[0].value = $('#EHP_DEF_SVC_LOCATION').val();
} catch (error) {
}
}
});
$('#configuration_form').on('submit', function(){
scbQueryEncode($('#EHP_CURRENT_QTY_QUERY'));
scbQueryEncode($('#EHP_CURRENT_PRICE_QUERY'));
scbQueryEncode($('#EHP_DEF_QTY_QUERY'));
scbQueryEncode($('#EHP_DEF_PRICE_QUERY'));
scbQueryEncode($('#SANTANDERCREDIT_QTY_QUERY'));
scbQueryEncode($('#SANTANDERCREDIT_PRICE_QUERY'));
});
function scbQueryEncode(jqObj){
let tmpVal = jqObj.val();
tmpVal = tmpVal.replaceAll(')', '_nawiasP_',tmpVal).replaceAll('(','_nawiasL_',tmpVal);
// tmpVal = window.btoa(tmpVal);
jqObj.val(tmpVal);
};
$('#pshPassButton').on('click',function pshPassChange(){
let currentPass = $('#SANTANDERCREDIT_PSH_PASS').val();
let modal = document.getElementById('pshPassModal');
$('#pshPass1').val(currentPass);
$('#pshPass2').val(currentPass);
modal.style.display = "block";
});
$('#pshPassSaveBtn').on('click',function pshPassSave(){
let modal = document.getElementById('pshPassModal');
let pass1 = $('#pshPass1').val();
let pass2 = $('#pshPass2').val();
if(pass1 == pass2){
modal.style.display = "none";
$('#SANTANDERCREDIT_PSH_PASS').val(pass1);
$('#configuration_form_submit_btn').click();
} else {
alert('Różne hasła w obu polach!');
}
});
$('#pshTestButton').on('click',function pshTestConn(){
let modal = document.getElementById('pshTestModal');
let msgText = "Test 1 - Łączność z serwisem: ";
$('#pshTestResult').text('Trwa weryfikacja połączenia...');
modal.style.display = "block";
$.ajax({
type: 'POST',
url: $('#pshIsActiveCommand').val(),
timeout: 30000
}).done(function(json) {
msgText = msgText + json;
msgText = msgText + ', Test 2 - Logowanie do usługi: ';
$.ajax({
type: 'POST',
url: $('#pshLoginChckCommand').val()+'?id_order=nosuchorder',
timeout: 30000
}).done(function(json) {
msgText = msgText + ' ' + json;
$('#pshTestResult').text(msgText);
}).fail(function(json){
msgText = msgText + " Błąd przy wywołaniu serwisu bankowego.";
$('#pshTestResult').text(msgText);
});
}).fail(function(json){
msgText = msgText + " Błąd przy wywołaniu serwisu bankowego.";
$('#pshTestResult').text(msgText);
});
});
})();
};

View File

@@ -0,0 +1,60 @@
function jakKupicEhp() {
window.open('https://www.santanderconsumer.pl/raty-jak-kupic', 'jakKupic', 'width=710,height=500,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');
return false;
}
function obliczRateEhp(nrSklepu, symUrl, qtySelector, basketSelector) {
let koszyk, ilo, qty, basket, scbQty, scbPrice;
scbQty = -1;
scbPrice = -1;
if ($("#scb_price") && typeof($("#scb_price")) == 'object') {
scbPrice = $("#scb_price").text();
}
if ($("#scb_quantity") && typeof($("#scb_quantity")) == 'object') {
scbQty = $("#scb_quantity").text();
}
if (scbQty > 0 && scbPrice > 0) {
qty = $(qtySelector);
basket = $(basketSelector);
if(qty.length == 1 && basket.length == 1) {
scbQty = qty.val();
scbPrice = basket.attr('content');
}
scbPrice = scbPrice * scbQty;
scbPrice = Math.round(scbPrice * 100, 2) / 100; //some stupid code just to solve strange js numeric results problem
if (scbPrice > 100) {
window.open(symUrl + 'numerSklepu/' + nrSklepu + '/wariantSklepu/1/typProduktu/0/wartoscTowarow/' + scbPrice);
} else {
alert("Kredytujemy zakupy w cenie powyżej 100zł");
}
} else {
alert('Wrong parameters for calculate');
}
}
function santanderCreditValidateForm() {
if ($('#santanderAgreement').is(':checked')) {
$('#scbSubmitBtn').removeAttr('disabled');
} else {
$('#scbSubmitBtn').attr('disabled','disabled');
}
}
function ehpStateRefresh() {
$('#busy').css('visibility','visible');
$('#refreshBtn').prop('disabled', true);
$.ajax({
type: 'POST',
url: $('#refreshCommand').val()+'?id_order=' + $('#ehp_id_order').val(),
// data: 'id_order=' + $('#id_order').val(),
// dataType: 'json',
timeout: 30000
}).done(function(json) {
location.reload(true);
// alert('done');
}).fail(function(json){
alert("Błąd przy wywołaniu serwisu bankowego.");
});
};

View File

@@ -0,0 +1,136 @@
{
"applicationURL": "https://wniosek.eraty.pl/formularz/",
"jq_qtySelector": "#quantity_wanted",
"jq_priceSelector": "div.current-price > span[itemprop="price"],div.current-price > span.current-price-value",
"orderId": "13_odt_2023_11_26_16_34_22",
"shopId": "99995",
"shopName": "ps811b",
"shopMailAdress": "rklepacz@gmail.com",
"shopPhone": false,
"shopHttp": "http://localhost/presta/ps811b/",
"returnTrue": "http://localhost/presta/ps811b/module/santandercredit/santanderCreditReturn?status=true&orderId=",
"returnFalse": "http://localhost/presta/ps811b/module/santandercredit/santanderCreditReturn?status=false&orderId=",
"email": "alfa@beta.com",
"imie": "Jan",
"nazwisko": "Test",
"telKontakt": "",
"ulica": "ul. Legnicka 1",
"ulica2": "",
"miasto": "Wrocu0142aw",
"kodPocz": "54-216",
"shipping": 0,
"products": [
{
"id_product_attribute": 1,
"id_product": 1,
"cart_quantity": 26,
"id_shop": 1,
"id_customization": null,
"name": "Hummingbird printed t-shirt",
"is_virtual": 0,
"description_short": "<p>Regular fit, round neckline, short sleeves. Made of extra long staple pima cotton. </p><br /><p></p>",
"available_now": "",
"available_later": "",
"id_category_default": 4,
"id_supplier": 1,
"id_manufacturer": 1,
"manufacturer_name": "Studio Design",
"on_sale": 0,
"ecotax": "0.000000",
"additional_shipping_cost": "0.000000",
"available_for_order": 1,
"show_price": 1,
"price": 19.120000000000000994759830064140260219573974609375,
"active": 1,
"unity": "",
"unit_price": 0,
"quantity_available": 253,
"width": "0.000000",
"height": "0.000000",
"depth": "0.000000",
"out_of_stock": 2,
"weight": 0.299999999999999988897769753748434595763683319091796875,
"available_date": "0000-00-00",
"date_add": "2023-11-17 18:30:47",
"date_upd": "2023-11-17 18:30:47",
"quantity": 26,
"link_rewrite": "hummingbird-printed-t-shirt",
"category": "men",
"unique_id": "0000000001000000000170",
"id_address_delivery": 7,
"advanced_stock_management": 0,
"supplier_reference": "demo_1_46",
"customization_quantity": null,
"price_attribute": "0.000000",
"ecotax_attr": "0.000000",
"reference": "demo_1",
"weight_attribute": 0.299999999999999988897769753748434595763683319091796875,
"ean13": "",
"isbn": "",
"upc": "",
"mpn": "",
"minimal_quantity": 1,
"wholesale_price": "5.490000",
"id_image": "1-2",
"legend": "Hummingbird printed t-shirt",
"reduction_type": "percentage",
"is_gift": false,
"reduction": 5.879400000000000403588273911736905574798583984375,
"reduction_without_tax": 4.78000000000000024868995751603506505489349365234375,
"price_without_reduction": 29.39699999999999846522769075818359851837158203125,
"specific_prices": {
"id_specific_price": 1,
"id_specific_price_rule": 0,
"id_cart": 0,
"id_product": 1,
"id_shop": 0,
"id_shop_group": 0,
"id_currency": 0,
"id_country": 0,
"id_group": 0,
"id_customer": 0,
"id_product_attribute": 0,
"price": "-1.000000",
"from_quantity": 1,
"reduction": "0.200000",
"reduction_tax": 1,
"reduction_type": "percentage",
"from": "0000-00-00 00:00:00",
"to": "0000-00-00 00:00:00",
"score": 0
},
"unit_price_ratio": 0,
"unit_price_tax_excluded": 0,
"unit_price_tax_included": 0,
"stock_quantity": 253,
"price_without_reduction_without_tax": 23.89999999999999857891452847979962825775146484375,
"price_with_reduction": 23.5176000000000016143530956469476222991943359375,
"price_with_reduction_without_tax": 19.120000000000000994759830064140260219573974609375,
"total": 497.1200000000000045474735088646411895751953125,
"total_wt": 611.4600000000000363797880709171295166015625,
"price_wt": 23.5176000000000016143530956469476222991943359375,
"reduction_applies": true,
"quantity_discount_applies": true,
"allow_oosp": 0,
"features": [
{
"id_feature": 1,
"id_product": 1,
"id_feature_value": 4
},
{
"id_feature": 2,
"id_product": 1,
"id_feature_value": 8
}
],
"attributes": "Rozmiar: S - Kolor: Biau0142y",
"attributes_small": "S - Biau0142y",
"rate": 23,
"tax_name": "PTU PL 23%"
}
],
"totalOrder": 611.4600000000000363797880709171295166015625,
"ehpToken": "3121f0a09e529984670b5456036194ce_2023_11_26_16_34_25",
"modDir": "http://localhost/presta/ps811b/modules/santandercredit"
}