I modify the module revolution slider under prestashop to include the possibility of displaying some slides to certain groups of users. I'm currently blocking on the recovery of select values from the revslider BO.
this recover well in the XHR call the select values
on the other hand it is PHP where I do not see how to do ....
here is the function that inserts the data of the slide.
public function updateSlideFromData($data)
{
$group = $data['params'];
if (strpos($group, 'group_slide_') == true) {
ddd($group);
}
$slideID = RevSliderFunctions::getVal($data, "slideid");
$this->initByID($slideID);
//treat params
$params = RevSliderFunctions::getVal($data, "params");
$params = $this->normalizeParams($params);
//preserve old data that not included in the given data
$params = array_merge($this->params, $params);
//treat layers
$layers = RevSliderFunctions::getVal($data, "layers");
if (gettype($layers) == "string") {
$layersStrip = Tools::stripslashes($layers);
$layersDecoded = Tools::jsonDecode($layersStrip);
if (empty($layersDecoded)) {
$layersDecoded = Tools::jsonDecode($layers);
}
$layers = RevSliderFunctions::convertStdClassToArray($layersDecoded);
}
if (empty($layers) || gettype($layers) != "array") {
$layers = array();
}
$layers = $this->normalizeLayers($layers);
$settings = RevSliderFunctions::getVal($data, "settings");
$arrUpdate = array();
$arrUpdate["layers"] = Tools::jsonEncode($layers);
$arrUpdate["params"] = Tools::jsonEncode($params);
$arrUpdate["settings"] = Tools::jsonEncode($settings);
$this->db->update(RevSliderGlobals::$table_slides, $arrUpdate, array("id" => $this->id));
// RevOperations::updateDynamicCaptions();
}
I attempt with a strpos to retrieve only the values that start with group_slide and then inject into my base the values select by separating them with commas, like this: 16,17,18
How?