Ezequiel López Posted August 4, 2022 Share Posted August 4, 2022 Hello! Now i'm migrating my module to the latest pretashop version and i have problems creating the constructor of class AdminProductWrapper. In older versions the class AdminProductWrapper had two attributes. Now have four. I need an example about to how implement an instance of this class like this: $this->adminProductWrapper = new \PrestaShop\PrestaShop\Adapter\Product\AdminProductWrapper(Context::getContext()->getTranslator(),$this->localization); I use this class from get data from customTextField : private function processProductCustomization($product) { $default_lang = (int) Configuration::get('PS_LANG_DEFAULT'); $fields = array(); $customization_field = array(); $customization_field["type"] = Product::CUSTOMIZE_TEXTFIELD; $customization_field["label"] = array(); foreach (Language::getLanguages() as $language) { $customization_field["label"][$language['id_lang']] = $this->customizationFieldText; } $customization_field["require"] = false; $customization_field["id_product"] = $product->id; $customization_field["id_customization_field"] = null; $fields[] = $customization_field; $this->adminProductWrapper->processProductCustomization($product,$fields); Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now