Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. public function Savefavorite($supplier, $id_shop, $id_supplier, $favActive)
  2. {
  3. $four = json_decode(Configuration::get('imp_favorite_'.$id_shop), true); // load
  4. if (!empty($favActive)) { // if 1 exist
  5. // ??????? DELETE element ???????
  6. }else { // if 0 no exist ok next
  7. $four['Suppliers'][$id_supplier]['supplier'] = $supplier;
  8. }
  9. Configuration::updateValue('imp_favorite_'.$id_shop, json_encode($four)); //save
  10. }
  11.  
  12. {"Suppliers":{"1":{"supplier":"blablabliblou"},"2":{"supplier":"papapipipupi"}}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement