Closed ilyasovivan closed 5 years ago
Problem with name="feature_{$available_feature.id_feature|intval}_value[]" Customized value is not array [].
And I found another small bug. If the Customized Value is filling, the Pre-Defined values are not clearing. Solution for this small issue: onchange="$('custom{$available_feature.idfeature|intval}).val('');">_ to onchange="$('[class^=custom{$available_feature.idfeature|intval}]').val('');">_
Feel free to submit PR.
Problem is that empty variables are not being sent anymore with PHP. So the loop through features if not selected, will fail if not selected (thus custom). Solution is to loop through the custom fields instead.
File: override/controllers/admin/AdminProductsController.php
Replace (line 100):
if (preg_match('/^feature_([0-9]+)_value/i', $key, $match)) {
For:
if (preg_match('/^custom_([0-9]+)_([0-9]+)/i', $key, $match)) {
$val = $_POST['feature_'. $match[1] . '_value'];
As always, backup first!
Prestashop 1.6.1.18 Information from Prestashop forum about this issue: "When I try to fill customized value, when there is already pre-defined ones, then it simply dont save to DB. When there is no pre-defined values, then cutomized value works fine."