warleb Posted April 1, 2023 Share Posted April 1, 2023 How do I now show that field on the product attribute form so that I can update this and add it to the table. Not sure which template I need to update. I used following sql to add the new field. ALTER TABLE `ps_attribute_lang` ADD `price` DECIMAL(20,6) NULL DEFAULT NULL COLLATE 'utf8_general_ci' AFTER `name`; any help would be great Link to comment Share on other sites More sharing options...
warleb Posted April 1, 2023 Author Share Posted April 1, 2023 so now I have the price added. This is presta 8.0.2 The idea now is to maintain a price against each attribute that needs it. Then when I come to generate the combinations it adds up the price automatically for me. No way am I keying in 5000 prices.... Link to comment Share on other sites More sharing options...
warleb Posted April 1, 2023 Author Share Posted April 1, 2023 I added this code in admin/controllers/admin/AdminAttributesGroupsController.php Directly after [ 'type' => 'text', 'label' => $this->trans('Value', [], 'Admin.Global'), 'name' => 'name', 'lang' => true, 'required' => true, 'hint' => $this->trans('Invalid characters:', [], 'Admin.Notifications.Info') . ' <>;=#{}', ], I added [ 'type' => 'text', 'label' => $this->trans('Price', [], 'Admin.Global'), 'name' => 'price', 'lang' => true, 'required' => false, 'hint' => $this->trans('Set a price for this attribute value.', [], 'Admin.Catalog.Help'), ], So now I need to work out how to update that field to the database if a price is added. Also to display the price when editing a attribute. 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