Jump to content

Uso de la clase AdminProductWrapper()


Ezequiel López

Recommended Posts

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.

182762359-d589c3bc-e223-4162-ad3a-e401ec

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

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...