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', 'id' => 'free_delivery',
'value' => $this -> settings['free_delivery'] 'value' => $this -> settings['free_delivery']
] );?> ] );?>
<?= \Html::textarea( [ <?= \Html::input( [
'label' => 'Ankieta Ekomi', 'label' => 'Orlen Paczka map token',
'name' => 'ekomi_survey', 'name' => 'orlen_paczka_map_token',
'id' => 'ekomi_survey', 'id' => 'orlen_paczka_map_token',
'value' => $this -> settings['ekomi_survey'], 'value' => $this -> settings['orlen_paczka_map_token']
'rows' => 10 ] );?>
] );?>
</div> </div>
<div> <div>
<div id="languages-main"> <div id="languages-main">

View File

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

View File

@@ -29,7 +29,7 @@ class Settings
\admin\factory\Settings::settings_update( 'piksel', $values['piksel'] ); \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( '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( '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( 'google_tag_manager_id', $values['google_tag_manager_id'] );
\admin\factory\Settings::settings_update( 'infinitescroll', $values['infinitescroll'] == 'on' ? 1 : 0 ); \admin\factory\Settings::settings_update( 'infinitescroll', $values['infinitescroll'] == 'on' ? 1 : 0 );
// own_gtm_js // own_gtm_js

View File

@@ -4,7 +4,7 @@ class ShopTransport
{ {
public static function lowest_transport_price( $wp ) { public static function lowest_transport_price( $wp ) {
global $mdb; 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 ) 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 ) foreach ( $versions as $ver )
{ {
$ver = trim( $ver ); $ver = trim( $ver );
if ( (float)$ver > (float)\S::get_version() ) if ( floatval( $ver ) > (float)\S::get_version() )
{ {
if ( strlen( $ver ) == 5 ) if ( strlen( $ver ) == 5 )
$dir = substr( $ver, 0, strlen( $ver ) - 2 ) . 0; $dir = substr( $ver, 0, strlen( $ver ) - 2 ) . 0;
@@ -34,29 +34,47 @@ class Update
else else
{ {
/* aktualizacja bazy danych */ /* aktualizacja bazy danych */
$sql = file_get_contents( 'http://www.shoppro.project-dc.pl/updates/' . $dir . '/ver_' . $ver . '_sql.txt' ); $url = 'http://www.shoppro.project-dc.pl/updates/' . $dir . '/ver_' . $ver . '_sql.txt';
$sql = explode( PHP_EOL, $sql ); $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 ( is_array( $sql ) and !empty( $sql ) ) foreach ( $sql as $query )
{ {
if ( $sql ) if ( $sql )
{
$result = $mdb -> query( $query ); $result = $mdb -> query( $query );
}
} }
/* usuwanie zbędnych plików */ /* usuwanie zbędnych plików */
$lines = file_get_contents( 'http://www.shoppro.project-dc.pl/updates/' . $dir . '/ver_' . $ver . '_files.txt' ); $url = 'http://www.shoppro.project-dc.pl/updates/' . $dir . '/ver_' . $ver . '_files.txt';
$lines = explode( PHP_EOL, $lines ); $ch = curl_init( $url );
if ( is_array( $lines ) ) foreach ( $lines as $line ) 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 ) ) if ( file_exists( $file ) )
unlink( $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 ) ) if ( is_dir( $dir ) )
\S::delete_dir( $dir ); \S::delete_dir( $dir );
} }

View File

@@ -394,9 +394,15 @@ class S
if ( $version = \S::get_session( 'new-version' ) ) if ( $version = \S::get_session( 'new-version' ) )
return $version; return $version;
$version = 0;
$versions = file_get_contents( 'http://www.shoppro.project-dc.pl/updates/versions.php?key=' . $settings['update_key'] ); $versions = file_get_contents( 'http://www.shoppro.project-dc.pl/updates/versions.php?key=' . $settings['update_key'] );
$versions = explode( PHP_EOL, $versions ); $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 ); \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 ] ); $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 ) foreach ( $results as $row )
{ {
$mdb -> insert( 'pp_shop_product_price_history', [ if ( $price )
'id_product' => $row['id'], {
'price' => $row['price_brutto_promo'] > 0 ? $row['price_brutto_promo'] : $row['price_brutto'], $mdb -> insert( 'pp_shop_product_price_history', [
'date' => date( 'Y-m-d' ) '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'] ] ); $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; margin-left: 15px;
@include transition; @include transition;
&.hidden {
display: none;
}
&:hover { &:hover {
text-decoration: none; text-decoration: none;
background: $cBlue; background: $cBlue;

View File

@@ -36,23 +36,19 @@ if ( is_array( $this -> transports_methods ) )
<? if ( $transport_method['id'] == 1 or $transport_method['id'] == 2 ):?> <? if ( $transport_method['id'] == 1 or $transport_method['id'] == 2 ):?>
<div class="inpost-info inpost-info-<?= $transport_method['id'];?>"> <div class="inpost-info inpost-info-<?= $transport_method['id'];?>">
<? if ( $transport_method['id'] == $this -> transport_id ):?><?= \S::get_session( 'basket-inpost-info' );?> <? 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( 'wybierz' );?></a>
<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;?>
<? endif;?> <? endif;?>
</div> </div>
<? endif;?> <? endif;?>
<? if ( $transport_method['id'] == 9 ):?> <? if ( $transport_method['id'] == 9 ):?>
<div class="orlen-info orlen-info-<?= $transport_method['id'];?>"> <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' );?>"> <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' ) ):?> if ( \S::get_session( 'basket-transport-method-id' ) != 9 )
<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> $class = 'hidden';
<? 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> <span id="orlen_point_info" class="<?= $class;?>"><?= \S::get_session( 'basket_orlen_point_info' );?></span>
<? endif;?> <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> </div>
<? endif;?> <? endif;?>
<? endforeach; endif;?> <? endforeach; endif;?>

View File

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

View File

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