Jump to content

Override AdminProductsController to add product_attribute field


drolex

Recommended Posts

I have PS version 1.6. I want to add a field to the DB table product_attribute and be able to enter the value on the Combinations tab of Products in the back office. I think I need to override the function processProductAttribute in AdminProductsController as well as a tpl file. This new field will allow me to define different dimensions and weight for each attribute combination.

 

  1. To override the controller function, do I copy the entire function and modify it in my override file?

Thank you for helping!

 

EDIT: I already figured this out, but I didn't use overrides, so I still want the answer to that question.

 

This required substantial modification of the following files:

  • controllers/admin/AdminProductsController.php
  • classes/Product.php
  • classes/Combination.php
  • admin/themes/default/template/controllers/products/combinations.tpl
  • js/admin-products.js
  • classes/Cart.php

I also have a modified shipping module to make use of the new field.

Edited by drolex (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...
  • 4 months later...
  • 6 months later...

Hi Drolex,

 

Well that's depend what u want change in the function u can copy the entire to ur override and change it (in this case if in your function u have an parent::callToTheParentFunction();

you have to jump and call the parent parent )

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