Integrations DI refactor, remove Sellasist/Baselinker, fix product-edit encoding (0.263)
- New: Domain\Integrations\IntegrationsRepository + admin\Controllers\IntegrationsController (DI) - Cleanup: removed all Sellasist and Baselinker integrations from entire project - Fix: product-edit.php Polish characters (UTF-8/CP1250 double-encoding) - Update: factory\Integrations as facade (Apilo + ShopPRO only) - Tests: 212 tests, 577 assertions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
<th>Stan magazynowy</th>
|
||||
<th>Cena netto</th>
|
||||
<th>Zam. SM 0</th>
|
||||
<th>Baselinker</th>
|
||||
<th style="width: 100px;">Opcje</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -50,14 +49,6 @@
|
||||
<td>
|
||||
<input type="checkbox" name="stock_0_buy" <? if ( $product['stock_0_buy'] ): echo 'checked="checked"'; endif;?> onchange="$.ajax({ type: 'POST', cache: false, url: '/admin/shop_product/product_combination_stock_0_buy_save/', data: { product_id: <?= $product['id'];?>, stock_0_buy: $( this ).is( ':checked' ) } } );">
|
||||
</td>
|
||||
<td>
|
||||
<?
|
||||
if ( $product['baselinker_product_name'] != "" )
|
||||
echo "<span title='" . $product['baselinker_product_name'] . "'>" . substr( $product['baselinker_product_name'], 0, 25 ) . "...</span>";
|
||||
else
|
||||
echo "<span class='text-danger baselinker-product-search' product-id='" . $product['id'] . "'>nie przypisano <i class='fa fa-search'></i></span>";
|
||||
?>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a href="/admin/shop_product/delete_combination/combination_id=<?= $product['id'];?>&product_id=<?= $product['parent_id'];?>" class="btn btn-danger btn-delete-permutation"><i class="fa fa-trash"></i></a>
|
||||
</td>
|
||||
@@ -138,86 +129,5 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
$( 'body' ).on( 'click', '.baselinker-product-search', function() {
|
||||
var product_id = $( this ).attr( 'product-id' );
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/admin/shop_product/baselinker_product_search/',
|
||||
data: {
|
||||
product_id: product_id
|
||||
},
|
||||
beforeSend: function() {
|
||||
$( '#overlay' ).show();
|
||||
},
|
||||
success: function( response ) {
|
||||
data = jQuery.parseJSON( response );
|
||||
|
||||
if ( data.status == 'SUCCESS' ) {
|
||||
$('.baselinker-found-products').remove();
|
||||
var html = '<div class="baselinker-found-products">';
|
||||
html += '<p>Znaleziono ' + data.products.length + ' produktów</p>';
|
||||
html += '<select class="form-control baselinker-product-select" product-id="' + product_id + '">';
|
||||
$.each( data.products, function( index, value ) {
|
||||
html += '<option value="' + value.product_id + '">' + value.name + ' SKU: ' + value.sku + '</option>';
|
||||
});
|
||||
html += '</select>';
|
||||
html += '<button class="btn btn-success baselinker-product-select-save" product-id="' + product_id + '">Zapisz</button>';
|
||||
html += '</div>';
|
||||
$( 'span[product-id="' + product_id + '"]' ).closest( 'td' ).append( html );
|
||||
} else if ( data.status == 'error' ) {
|
||||
$.alert({
|
||||
title: 'Błąd',
|
||||
content: data.msg,
|
||||
type: 'red',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fa fa-times',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
columnClass: 'col-12 col-lg-10',
|
||||
theme: 'modern',
|
||||
icon: 'fa fa-exclamation-triangle',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: 'OK',
|
||||
btnClass: 'btn-danger',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$( 'body' ).on( 'click', '.baselinker-product-select-save', function(){
|
||||
var product_id = $( this ).attr( 'product-id' );
|
||||
var baselinker_product_id = $( '.baselinker-product-select[product-id="' + product_id + '"]' ).val();
|
||||
var baselinker_product_name = $( '.baselinker-product-select[product-id="' + product_id + '"] option:selected' ).text();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/admin/shop_product/baselinker_product_select_save/',
|
||||
data: {
|
||||
product_id: product_id,
|
||||
baselinker_product_id: baselinker_product_id,
|
||||
baselinker_product_name: baselinker_product_name
|
||||
},
|
||||
beforeSend: function() {
|
||||
$( '#overlay' ).show();
|
||||
},
|
||||
success: function( response ) {
|
||||
data = jQuery.parseJSON( response );
|
||||
|
||||
if ( data.status == 'ok' ) {
|
||||
$( '.baselinker-product-select[product-id="' + product_id + '"]' ).closest( '.baselinker-found-products' ).remove();
|
||||
$( 'span[product-id="' + product_id + '"]' ).html( '<span title="' + baselinker_product_name + '">' + baselinker_product_name.substr( 0, 25 ) + '...</span>' ).removeClass( 'baselinker-product-search' ).removeClass( 'text-danger' );
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user