Jump to content

Add second free shipping by price variable into Preffences controller in Back Office


Recommended Posts

Hello everybody,

my prestashop version 1.7.7.5.

I would like to add second variable for free shipping by price into the Admin Shipping Preferences controller. I have created custom module and decided to decorate/extend the PreferencesController into the Prestashopbundle/Controller/Admin/Improve/Shipping folder. But as i saw the controller - it does not declares the variables for handling tab in Shipping in BackOffice. So how or where can i find this variables - which file creates them, so i could create a new variable by extending the file/controller. I have only found that these variables are validated in the PreferencesFormDataprovider.php file in the Prestashopbundle/Form/Admin/Inmprove/Shipping/Preferences folder. But where is the file that creates them (what type is it in this version) and can i extend it from my module to add the custom variable? 

Link to comment
Share on other sites

Hello, i have found the declaration of the variables, which is done in the folowing file: src/PrestaShopBundle/Form/Admin/Improve/Shipping/Preferences/HandlingType.php.

Also i found the file, which is responsible for saving, loading or validating the handling options configuratuion: src/Adapter/Carrier/HandlingConfiguration.php

But here i am a bit confused - can i extend this class 'HandlingConfiguration' as it is in Adapter folder - so no controller or no class. I am trying to extend it and not override, as to be safe for future update prestashop version. But when i create the extended class - where should i place it in my module. Is it the same logic as for extending controllers or classes?

Regards

 

  • Like 1
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...