Files
shopPRO/admin/templates/shop-product/product-combination.php
Jacek Pyziak d824ba3909 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>
2026-02-13 21:59:26 +01:00

133 lines
6.2 KiB
PHP

<div class="g-container" data="table:order-details">
<div class="panel panel-info panel-border top">
<div class="panel-heading">
<span class="panel-title">Kobinacje produktu: <?= $this -> product['languages'][ $this -> default_language ]['name'];?></span>
</div>
<div class="panel-heading p10 pl15" id="g-menu" style="height: auto;">
<a class="btn btn btn-dark btn-sm mr5 btn-sm mr5" href="/admin/shop_product/view_list/"><i class="fa fa-reply mr5"></i>Wstecz</a>
</div>
<div class="panel-body">
<div class="row">
<div class="col-lg-7 col-xl-9">
<div class="table-responsive">
<table class="table table-hover table-bordered table-condensed">
<thead>
<tr>
<th></th>
<th>Kombinacja</th>
<th>SKU</th>
<th>Stan magazynowy</th>
<th>Cena netto</th>
<th>Zam. SM 0</th>
<th style="width: 100px;">Opcje</th>
</tr>
</thead>
<tbody>
<? if ( \S::is_array_fix( $this -> product_permutations ) ): foreach ( $this -> product_permutations as $product ):?>
<tr>
<td></td>
<td>
<?
$attributes = explode( '|', $product['permutation_hash'] );
foreach ( $attributes as $attribute ):
$attribute_tmp = explode( '-', $attribute );
echo \admin\factory\ShopAttribute::get_attribute_name_by_id( $attribute_tmp[0] ) . ' - <b>' . \admin\factory\ShopAttribute::get_attribute_value_by_id( $attribute_tmp[1] ) . '</b>';
if ( $attribute != end( $attributes ) )
echo ', ';
endforeach;
?>
</td>
<td>
<input type="text" name="sku" value="<?= $product['sku'];?>" class="form-control" style="max-width: 100px;" onchange="$.ajax({ type: 'POST', cache: false, url: '/admin/shop_product/product_combination_sku_save/', data: { product_id: <?= $product['id'];?>, sku: $( this ).val() } } );">
</td>
<td>
<input type="text" name="quantity" value="<?= $product['quantity'];?>" class="form-control" style="max-width: 100px;" onchange="$.ajax({ type: 'POST', cache: false, url: '/admin/shop_product/product_combination_quantity_save/', data: { product_id: <?= $product['id'];?>, quantity: $( this ).val() } } );">
</td>
<td>
<input type="text" name="price" value="<?= $product['price_netto'];?>" class="form-control" style="max-width: 100px;" onchange="$.ajax({ type: 'POST', cache: false, url: '/admin/shop_product/product_combination_price_save/', data: { product_id: <?= $product['id'];?>, price: $( this ).val() } } );">
</td>
<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 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>
</tr>
<? endforeach; endif;?>
</tbody>
</table>
</div>
</div>
<div class="col-lg-5 col-xl-3">
<form action="/admin/shop_product/generate_combination/product_id=<?= $this -> product['id'];?>" method="POST">
<button type="submit" class="btn btn-success" style="margin-bottom: 25px;">Wygeneruj kombinacje</button>
<? foreach ( $this -> attributes as $attribute ):?>
<div class="combination-attribute">
<div class="title">
<?= $attribute['languages'][ $this -> default_language ]['name'];?>
</div>
<ul class="values">
<? foreach ( $attribute['values'] as $value ):?>
<li>
<input type="checkbox" class="g-checkbox" name="attribute_<?= $attribute['id'];?>[]" value="<?= $value['id'];?>"> <?= $value['languages'][ $this -> default_language ]['name'];?>
</li>
<? endforeach;?>
</ul>
</div>
<? endforeach;?>
</form>
</div>
</div>
</div>
</div>
</div>
<link rel="stylesheet" type="text/css" href="/libraries/grid/plugins/icheck/skins/minimal/minimal.css">
<link rel="stylesheet" type="text/css" href="/libraries/grid/plugins/icheck/skins/minimal/blue.css">
<script type="text/javascript" src="/libraries/grid/plugins/icheck/icheck.min.js"></script>
<script type="text/javascript">
$( function()
{
$( '.g-checkbox, .g-radio' ).iCheck({
checkboxClass: 'icheckbox_minimal-blue',
radioClass: 'iradio_minimal-blue'
});
$( 'body' ).on( 'click', '.btn-delete-permutation', function(e)
{
e.preventDefault();
var href = $( this ).attr( 'href' );
$.alert(
{
title: 'Pytanie',
content: 'Na pewno chcesz usunąć wybraną kombinację?',
type: 'orange',
closeIcon: true,
closeIconClass: 'fa fa-times',
typeAnimated: true,
animation: 'opacity',
columnClass: 'col-12 col-lg-10',
theme: 'modern',
icon: 'fa fa-question',
buttons: {
cancel: {
text: 'Nie',
btnClass: 'btn-dark',
action: function() {}
},
confirm: {
text: 'Tak',
btnClass: 'btn-danger',
keys: ['enter'],
action: function() {
document.location.href = href;
}
}
}
});
return false;
});
});
</script>