title: Prestashop 1.7 accommodate overrides from multiple modules
body: <p>I've created 2 custom modules module_one and module_two. these modules directly affects the ps_product_lang table, so I made overrides to the class Product.php. Now, I can install both the module, but the last of the two modules I am going to install can't be enabled due to conflict of overriding the Product.php class. </p>
  
  <p>To make my modules to work, I temporarily deleted the overrides in my custom modules, then directly editing the root_file/override/classes/Product.php. But my ideal setup is to have the overrides inside the modules so I can easily update them individually. How do I do that?</p>
  
  <p>here's my directory:</p>
  
  <ul>
  <li>root_dir:
  
  <ul>
  <li>override:
  
  <ul>
  <li>classes:
  
  <ul>
  <li>Product.php</li>
  </ul></li>
  </ul></li>
  <li>modules:
  
  <ul>
  <li>module_one:
  
  <ul>
  <li>override:
  
  <ul>
  <li>classes:
  
  <ul>
  <li>Product.php</li>
  </ul></li>
  </ul></li>
  <li>views:</li>
  <li>module_one.php</li>
  </ul></li>
  <li>module_two:
  
  <ul>
  <li>override:
  
  <ul>
  <li>classes:
  
  <ul>
  <li>Product.php</li>
  </ul></li>
  </ul></li>
  <li>views:</li>
  <li>module_two.php</li>
  </ul></li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>Here's my module_one/override/classes/Product.php code:</p>
  
  <pre><code>&lt;?php
  class Product extends ProductCore {
      public $cus_field_1;
      public $cus_field_2;
  
      public function __construct($id_product = null, $full = false, $id_lang = null, $id_shop = null, Context $context = null){
  
              self::$definition['fields']['cus_field_1'] = [
                  'type' =&gt; self::TYPE_STRING,
                  'lang' =&gt; true,
                  'required' =&gt; false, 'size' =&gt; 255
              ];
              self::$definition['fields']['cus_field_2'] = [
                  'type' =&gt; self::TYPE_STRING,
                  'lang' =&gt; true,
                  'required' =&gt; false, 'size' =&gt; 255
              ];
              parent::__construct($id_product, $full, $id_lang, $id_shop, $context);
      }
  }
  </code></pre>
  
  <p>Here's my module_two/override/classes/Product.php code:</p>
  
  <pre><code>&lt;?php
  class Product extends ProductCore {
      public $cus_field_3;
      public $cus_field_4;
  
      public function __construct($id_product = null, $full = false, $id_lang = null, $id_shop = null, Context $context = null){
  
              self::$definition['fields']['cus_field_3'] = [
                  'type' =&gt; self::TYPE_STRING,
                  'lang' =&gt; true,
                  'required' =&gt; false, 'size' =&gt; 255
              ];
              self::$definition['fields']['cus_field_4'] = [
                  'type' =&gt; self::TYPE_STRING,
                  'lang' =&gt; true,
                  'required' =&gt; false, 'size' =&gt; 255
              ];
              parent::__construct($id_product, $full, $id_lang, $id_shop, $context);
      }
  }
  </code></pre>