This commit is contained in:
2024-11-16 10:57:09 +01:00
parent 144df6abf5
commit f419f693e4
15 changed files with 78 additions and 50 deletions

View File

@@ -131,13 +131,12 @@ ob_start();
'id' => 'free_delivery',
'value' => $this -> settings['free_delivery']
] );?>
<?= \Html::textarea( [
'label' => 'Ankieta Ekomi',
'name' => 'ekomi_survey',
'id' => 'ekomi_survey',
'value' => $this -> settings['ekomi_survey'],
'rows' => 10
] );?>
<?= \Html::input( [
'label' => 'Orlen Paczka map token',
'name' => 'orlen_paczka_map_token',
'id' => 'orlen_paczka_map_token',
'value' => $this -> settings['orlen_paczka_map_token']
] );?>
</div>
<div>
<div id="languages-main">

View File

@@ -18,9 +18,7 @@ ob_start();
)
);?>
<?
$ver_new = $this->new_ver;
$ver= $this->ver;
$valuemax = ($ver_new - $ver)*1000;
$valuemax = ( $this -> new_ver - $this -> ver ) * 1000;
?>
<div class="progress-box hidden">
<div class="version">

View File

@@ -29,7 +29,7 @@ class Settings
\admin\factory\Settings::settings_update( 'piksel', $values['piksel'] );
\admin\factory\Settings::settings_update( 'generate_webp', $values['generate_webp'] == 'on' ? 1 : 0 );
\admin\factory\Settings::settings_update( 'lazy_loading', $values['lazy_loading'] == 'on' ? 1 : 0 );
\admin\factory\Settings::settings_update( 'ekomi_survey', $values['ekomi_survey'] );
\admin\factory\Settings::settings_update( 'orlen_paczka_map_token', $values['orlen_paczka_map_token'] );
\admin\factory\Settings::settings_update( 'google_tag_manager_id', $values['google_tag_manager_id'] );
\admin\factory\Settings::settings_update( 'infinitescroll', $values['infinitescroll'] == 'on' ? 1 : 0 );
// own_gtm_js

View File

@@ -4,7 +4,7 @@ class ShopTransport
{
public static function lowest_transport_price( $wp ) {
global $mdb;
return $mdb -> get( 'pp_shop_transports', 'cost', [ 'AND' => [ 'status' => 1, 'id' => [ 2, 4, 6, 8 ], 'max_wp[>=]' => $wp ], 'ORDER' => [ 'cost' => 'ASC' ] ] );
return $mdb -> get( 'pp_shop_transports', 'cost', [ 'AND' => [ 'status' => 1, 'id' => [ 2, 4, 6, 8, 9 ], 'max_wp[>=]' => $wp ], 'ORDER' => [ 'cost' => 'ASC' ] ] );
}
public static function transport_save( $transport_id, $name, $name_visible, $description, $status, $cost, $payment_methods, $max_wp, $default, $apilo_carrier_account_id, $sellasist_shipment_method_id, $delivery_free )

View File

@@ -15,7 +15,7 @@ class Update
foreach ( $versions as $ver )
{
$ver = trim( $ver );
if ( (float)$ver > (float)\S::get_version() )
if ( floatval( $ver ) > (float)\S::get_version() )
{
if ( strlen( $ver ) == 5 )
$dir = substr( $ver, 0, strlen( $ver ) - 2 ) . 0;
@@ -34,29 +34,47 @@ class Update
else
{
/* aktualizacja bazy danych */
$sql = file_get_contents( 'http://www.shoppro.project-dc.pl/updates/' . $dir . '/ver_' . $ver . '_sql.txt' );
$sql = explode( PHP_EOL, $sql );
$url = 'http://www.shoppro.project-dc.pl/updates/' . $dir . '/ver_' . $ver . '_sql.txt';
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HEADER, true );
$response = curl_exec( $ch );
$content_type = curl_getinfo( $ch, CURLINFO_CONTENT_TYPE );
if ( $response and strpos( $content_type, 'text/plain' ) !== false )
$sql = explode( PHP_EOL, $response );
if ( is_array( $sql ) and !empty( $sql ) ) foreach ( $sql as $query )
{
if ( $sql )
{
$result = $mdb -> query( $query );
}
}
/* usuwanie zbędnych plików */
$lines = file_get_contents( 'http://www.shoppro.project-dc.pl/updates/' . $dir . '/ver_' . $ver . '_files.txt' );
$lines = explode( PHP_EOL, $lines );
if ( is_array( $lines ) ) foreach ( $lines as $line )
$url = 'http://www.shoppro.project-dc.pl/updates/' . $dir . '/ver_' . $ver . '_files.txt';
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_HEADER, true );
$response = curl_exec( $ch );
$content_type = curl_getinfo( $ch, CURLINFO_CONTENT_TYPE );
if ( $response and strpos( $content_type, 'text/plain' ) !== false )
$files = explode( PHP_EOL, $response );
if ( is_array( $files ) and !empty( $files ) ) foreach ( $files as $file )
{
if ( strpos( $line, 'F: ' ) !== false )
if ( strpos( $file, 'F: ' ) !== false )
{
$file = substr( $line, 3, strlen( $line ) );
$file = substr( $file, 3, strlen( $file ) );
if ( file_exists( $file ) )
unlink( $file );
}
if ( strpos( $line, 'D: ' ) !== false )
if ( strpos( $file, 'D: ' ) !== false )
{
$dir = substr( $line, 3, strlen( $line ) );
$dir = substr( $file, 3, strlen( $file ) );
if ( is_dir( $dir ) )
\S::delete_dir( $dir );
}

View File

@@ -394,9 +394,15 @@ class S
if ( $version = \S::get_session( 'new-version' ) )
return $version;
$version = 0;
$versions = file_get_contents( 'http://www.shoppro.project-dc.pl/updates/versions.php?key=' . $settings['update_key'] );
$versions = explode( PHP_EOL, $versions );
$version = (float)max( $versions );
foreach ( $versions as $key => $version_tmp )
{
$version_tmp = floatval( $version_tmp );
if ( $version_tmp > $version and $version_tmp )
$version = $version_tmp;
}
\S::set_session( 'new-version', $version );

View File

@@ -829,11 +829,14 @@ if ( $baselinker_settings['enabled'] and $baselinker_settings['sync_orders'] an
$results = $mdb -> select( 'pp_shop_products', [ 'id', 'price_brutto', 'price_brutto_promo' ], [ 'OR' => [ 'price_history_date[!]' => date( 'Y-m-d' ), 'price_history_date' => null ], 'ORDER' => [ 'price_history_date' => 'ASC' ], 'LIMIT' => 100 ] );
foreach ( $results as $row )
{
$mdb -> insert( 'pp_shop_product_price_history', [
'id_product' => $row['id'],
'price' => $row['price_brutto_promo'] > 0 ? $row['price_brutto_promo'] : $row['price_brutto'],
'date' => date( 'Y-m-d' )
] );
if ( $price )
{
$mdb -> insert( 'pp_shop_product_price_history', [
'id_product' => $row['id'],
'price' => $row['price_brutto_promo'] > 0 ? $row['price_brutto_promo'] : $row['price_brutto'],
'date' => date( 'Y-m-d' )
] );
}
$mdb -> update( 'pp_shop_products', [ 'price_history_date' => date( 'Y-m-d' ) ], [ 'id' => $row['id'] ] );

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -2317,6 +2317,10 @@ ul.pager {
margin-left: 15px;
@include transition;
&.hidden {
display: none;
}
&:hover {
text-decoration: none;
background: $cBlue;

View File

@@ -36,23 +36,19 @@ if ( is_array( $this -> transports_methods ) )
<? if ( $transport_method['id'] == 1 or $transport_method['id'] == 2 ):?>
<div class="inpost-info inpost-info-<?= $transport_method['id'];?>">
<? if ( $transport_method['id'] == $this -> transport_id ):?><?= \S::get_session( 'basket-inpost-info' );?>
<? if ( \S::get_session( 'basket-inpost-info' ) ):?>
<a href="#" onclick="inpost_map( <?= $transport_method['id'];?> ); return false;"><?= \S::lang( 'zmien' );?></a>
<? else:?>
<a href="#" onclick="inpost_map( <?= $transport_method['id'];?> ); return false;"><?= \S::lang( 'wybierz' );?></a>
<? endif;?>
<a href="#" onclick="inpost_map( <?= $transport_method['id'];?> ); return false;"><?= \S::lang( 'wybierz' );?></a>
<? endif;?>
</div>
<? endif;?>
<? if ( $transport_method['id'] == 9 ):?>
<div class="orlen-info orlen-info-<?= $transport_method['id'];?>">
<input type="hidden" name="orlen_point_id" id="orlen_point_id" value="<?= \S::get_session( 'basket_orlen_point_id' );?>">
<span id="orlen_point_info" <? if ( \S::get_session( 'basket-transport-method-id' ) != 9 ):?>style="display: none;" <? endif;?>><?= \S::get_session( 'basket_orlen_point_info' );?></span>
<? if ( \S::get_session( 'basket_orlen_point_info' ) ):?>
<a href="#" class="orlen-widget" data-target="#orlen_point_id" data-label="#orlen_point_info" data-type="all" data-layout="tabs" onclick="return false;"><?= \S::lang( 'zmien' );?></a>
<? else:?>
<a href="#" class="orlen-widget" data-target="#orlen_point_id" data-label="#orlen_point_info" data-type="all" data-layout="tabs" onclick="return false;"><?= \S::lang( 'wybierz' );?></a>
<? endif;?>
<?
if ( \S::get_session( 'basket-transport-method-id' ) != 9 )
$class = 'hidden';
?>
<span id="orlen_point_info" class="<?= $class;?>"><?= \S::get_session( 'basket_orlen_point_info' );?></span>
<a href="#" class="orlen-widget <?= $class;?>" data-target="#orlen_point_id" data-label="#orlen_point_info" data-type="all" data-layout="tabs" onclick="return false;"><?= \S::lang( 'wybierz' );?></a>
</div>
<? endif;?>
<? endforeach; endif;?>

View File

@@ -1,3 +1,4 @@
<? global $settings; ?>
<div id="basket-container">
<div id="content">
<?= $this->basket_details; ?>
@@ -40,7 +41,7 @@
j.async = true;
j.src = e + 'widget.js?token=' + n + '&v=1.0.0&t=' + Math.floor(new Date().getTime() / 1000);
f.insertBefore(j, f.firstChild);
})(window, document, 'orlenpaczka', 'https://mapa.orlenpaczka.pl/', '0e365de8e228096aaf033ca8e43db5603132d8d5659788dbcb4bd936c852753e51b5382036641163788c1644ea631564f90a445402cd756ed40b491d');
})(window, document, 'orlenpaczka', 'https://mapa.orlenpaczka.pl/', '<?= $settings['orlen_paczka_map_token'];?>');
</script>
<link class="footer" rel="stylesheet" type="text/css" href="/libraries/grid/plugins/icheck/skins/square/_all.css">
<link class="footer" rel="stylesheet" type="text/css" href="https://geowidget.easypack24.net/css/easypack.css">
@@ -164,17 +165,17 @@
success: function(response) {}
});
$( '#orlen_point_id' ).val( '' );
$( '#orlen_point_info' ).html( '' );
$( '.orlen-widget' ).hide();
$( '#orlen_point_info' ).addClass( 'hidden' );
$( '.orlen-widget' ).addClass( 'hidden' );
inpost_map( transport_method_id )
}
if ( event_click && transport_method_id == '9' )
{
$( '.inpost-info' ).html( '' );
$( '#orlen_point_info' ).show();
$( '#orlen_point_info' ).removeClass( 'hidden' );
$( '.orlen-widget' ).removeClass( 'hidden' );
document.querySelectorAll('.orlen-widget').forEach(function(element) {
element.style.display = 'inline-block'; // Ustawia widoczność elementu
element.click(); // Wywołuje kliknięcie na elemencie
});
}
@@ -198,7 +199,7 @@
{
$( '#orlen_point_id' ).val( '' );
$( '#orlen_point_info' ).html( '' );
$( '.orlen-widget' ).hide();
$( '.orlen-widget' ).addClass( 'hidden' );
}
}
});
@@ -242,10 +243,10 @@
$.alert({
title: '<?= ucfirst(\S::lang('uwaga')); ?>',
content: 'Proszę wybrać punkt odbioru.',
content: 'Proszę wybrać punkt odbioru',
type: 'blue',
closeIcon: true,
closeIconClass: 'fas fa-times',
closeIconClass: 'fa fa-times',
typeAnimated: true,
animation: 'opacity',
useBootstrap: false,

BIN
updates/0.20/ver_0.223.zip Normal file

Binary file not shown.

View File

@@ -1,3 +1,6 @@
<b>ver. 0.223</b><br />
- FIX - integracja z Orlen Paczka
<hr>
<b>ver. 0.222</b><br />
- NEW - integracja z Orlen Paczka
<hr>

View File

@@ -1,5 +1,5 @@
<?
$current_ver = 222;
$current_ver = 223;
for ($i = 1; $i <= $current_ver; $i++)
{