Jump to content

Added price field to ps_attribute_lang


warleb

Recommended Posts

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`;


image.thumb.png.fea94b1fcacb7b52d7ccaa72856ff784.png

any help would be great

Link to comment
Share on other sites

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

 

image.thumb.png.1bcd3f6b595008fd779792184ac2f128.png

Link to comment
Share on other sites

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

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