Jump to content

Language Text Not updating for custom module in hookActionProductUpdate


ilmtech

Recommended Posts

Hi,

I'm trying to add or update the value but langaue doesn't update I don't know what is the problem kindly help

 

public function hookActionProductUpdate($params)
    {
        $default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
        $id_product = Tools::getValue('id_product');
        $ilmmintext = array();
        $ilmmaxtext = array();
        $ilmminmaxorderqty_obj = IlmOrderQty::loadByIdProduct($id_product, $default_lang);
        $ilmminmaxorderqty_obj->ilmmin = Tools::getValue('ilmmin');
        $ilmminmaxorderqty_obj->ilmmax = Tools::getValue('ilmmax');
        $ilmminmaxorderqty_obj->ilmatt = Tools::getValue('ilmatt');
        $ilmminmaxorderqty_obj->id_product = $id_product;
        $languages = Language::getLanguages(false);
        foreach ($languages as $lang) {
            $ilmmintext[$lang['id_lang']] = Tools::getValue('ilmmintext_' . $lang['id_lang']);
            $ilmmaxtext[$lang['id_lang']] = Tools::getValue('ilmmaxtext_' . $lang['id_lang']);
        }
        $ilmminmaxorderqty_obj->ilmmintext = $ilmmintext;
        $ilmminmaxorderqty_obj->ilmmaxtext = $ilmmaxtext;
 
        if (!empty($ilmminmaxorderqty_obj) && isset($ilmminmaxorderqty_obj->id_ilmminmaxorderqty)) {
            $ilmminmaxorderqty_obj->update();
        } else {
            $ilmminmaxorderqty_obj->add();
        }
    }
Edited by ilmtech (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...