solidsteak Posted February 2, 2017 Share Posted February 2, 2017 I am overriding a function that takes a certain set of parameters. In my override, I wish to add an additional parameter. In dev mode, I get the error: [2048] Declaration of Product::addAttribute() should be compatible with ProductCore::addAttribute($price, $weight, $unit_impact, $ecotax, $id_images, $reference, $ean13, $default, $location = NULL, $upc = NULL, $minimal_quantity = 1, array $id_shop_list = Array, $available_date = NULL) I'm assuming that because of the additional parameter, the override is not matching up with the original function. If so, what are possible solutions? Or do I have to modify the core files? Link to comment Share on other sites More sharing options...
JeredBolton Posted February 2, 2017 Share Posted February 2, 2017 I'm assuming that because of the additional parameter, the override is not matching up with the original function. Correct. If so, what are possible solutions? What's the extra parameter you're trying to add? Or do I have to modify the core files? No - don't modify the core files. If you explain what you're trying to add, or what you're hoping to achieve, then a solution may be found. Link to comment Share on other sites More sharing options...
solidsteak Posted February 3, 2017 Author Share Posted February 3, 2017 I'm basically following this guy https://www.prestashop.com/forums/topic/442471-adding-custom-fields-for-combinations-ps16/ Trying to add an extra field for product combinations. Only need 1 parameter added to a few functions. Link to comment Share on other sites More sharing options...
JeredBolton Posted February 3, 2017 Share Posted February 3, 2017 The linked thread appears to be modifying the core files - not an ideal approach. If you explain what this extra parameter is for and what you're hoping to add to the attributes page, it may be possible to suggest a solution. Link to comment Share on other sites More sharing options...
solidsteak Posted February 3, 2017 Author Share Posted February 3, 2017 (edited) My understanding is the parameter is just for passing the value of the new field. For example in Product.php addAttribute($price, $weight, $unit_impact, $ecotax, $id_images, $reference, $ean13, $default, $location = NULL, $upc = NULL, $minimal_quantity = 1, array $id_shop_list = Array, $available_date = NULL) { ... } Much like $upc, $reference, or $ean13, I'm just adding an additional field. Edited February 3, 2017 by solidsteak (see edit history) 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