feat: Enhance product saving functionality with security information and language support
- Added `security_information` parameter to `ShopProduct::save` method. - Refactored language handling in product saving to utilize `Languages::languages_list`. - Updated SEO link handling to ensure proper redirection and canonical URLs. - Improved error handling and logging during the update process in `Update` class. - Enhanced producer and product classes to include additional language data. - Updated version to 0.233 and added update logs for better tracking.
This commit is contained in:
@@ -32,6 +32,7 @@ ob_start();
|
||||
<li><i class="fa fa-exchange"></i>Produkty powiązane</li>
|
||||
<li><i class="fa fa-file-excel-o"></i>XML</li>
|
||||
<li><i class="fa fa-file-o"></i>Dodatkowe pola</li>
|
||||
<li><i class="fa fa-file-o"></i>GPSR</li>
|
||||
</ul>
|
||||
<div class="resp-tabs-container settings-tabs">
|
||||
<div>
|
||||
@@ -407,25 +408,13 @@ ob_start();
|
||||
'value' => $this->product['additional_message_text']
|
||||
]);
|
||||
?>
|
||||
<?
|
||||
$producers[''] = '--- wybierz producenta ---';
|
||||
foreach ($this->producers as $producer)
|
||||
$producers[$producer['id']] = $producer['name'];
|
||||
?>
|
||||
<?= \Html::select([
|
||||
'label' => 'Producent',
|
||||
'name' => 'producer_id',
|
||||
'id' => 'producer_id',
|
||||
'values' => $producers,
|
||||
'value' => $this->product['producer_id']
|
||||
]); ?>
|
||||
</div>
|
||||
<div>
|
||||
<div id="languages-seo">
|
||||
<ul class="resp-tabs-list languages-seo htabs">
|
||||
<? if (is_array($this->languages)) : foreach ($this->languages as $lg) : ?>
|
||||
<? if ($lg['status']) : ?>
|
||||
<li><? if ($lg['id'] == \front\factory\Languages::default_language()) echo '<i class="fa fa-star fa-lg text-system" title="Język domyślny"></i> '; ?><?= $lg['name']; ?></a></li>
|
||||
<li><? if ($lg['id'] == \front\factory\Languages::default_language()) echo '<i class="fa fa-star fa-lg text-system" title="Język domyślny"></i> '; ?><?= $lg['name']; ?></li>
|
||||
<? endif; ?>
|
||||
<?
|
||||
endforeach;
|
||||
@@ -702,6 +691,52 @@ ob_start();
|
||||
<? endforeach; endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<?
|
||||
$producers[''] = '--- wybierz producenta ---';
|
||||
foreach ($this->producers as $producer)
|
||||
$producers[$producer['id']] = $producer['name'];
|
||||
?>
|
||||
<?= \Html::select([
|
||||
'label' => 'Producent',
|
||||
'name' => 'producer_id',
|
||||
'id' => 'producer_id',
|
||||
'values' => $producers,
|
||||
'value' => $this->product['producer_id']
|
||||
]); ?>
|
||||
<div id="gpsr-seo">
|
||||
<ul class="resp-tabs-list gpsr-seo htabs">
|
||||
<? if ( is_array( $this -> languages ) ): foreach ( $this -> languages as $lg ):?>
|
||||
<? if ($lg['status']) : ?>
|
||||
<li><? if ($lg['id'] == \front\factory\Languages::default_language()) echo '<i class="fa fa-star fa-lg text-system" title="Język domyślny"></i> '; ?><?= $lg['name']; ?></li>
|
||||
<? endif; ?>
|
||||
<? endforeach; endif; ?>
|
||||
</ul>
|
||||
<div class="resp-tabs-container gpsr-seo">
|
||||
<? if ( is_array ($this -> languages ) ): foreach ( $this -> languages as $lg ):?>
|
||||
<? if ( $lg['status'] ):?>
|
||||
<div>
|
||||
<?= \Html::textarea( [
|
||||
'label' => 'Informacje o bezpieczeństwie ('.$lg['name'].')',
|
||||
'name' => 'security_information[' . $lg['id'] . ']',
|
||||
'id' => 'security_information_' . $lg['id'],
|
||||
'value' => $this->product['languages'][$lg['id']]['security_information']
|
||||
] );?>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$( '#security_information_<?= $lg[ 'id' ];?>').ckeditor({
|
||||
toolbar: 'MyToolbar',
|
||||
height: '250'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<? endif; ?>
|
||||
<? endforeach; endif;?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
@@ -951,6 +986,12 @@ echo $grid->draw();
|
||||
tabidentify: 'languages-seo'
|
||||
});
|
||||
|
||||
$('#gpsr-seo').easyResponsiveTabs({
|
||||
width: 'auto',
|
||||
fit: true,
|
||||
tabidentify: 'gpsr-seo'
|
||||
});
|
||||
|
||||
$('#languages-tabs').easyResponsiveTabs({
|
||||
width: 'auto',
|
||||
fit: true,
|
||||
|
||||
Reference in New Issue
Block a user