Answer the question
In order to leave comments, you need to log in
How to create a subform in Symfony 1.2 in the admin panel (on the Orders page, show the list of products)?
Greetings.
There is an online store written in the old Symfony 1.2 framework.
Site users can create orders. On the user side, everything works fine.
I want to add the ability to edit orders in the admin panel. So that you can change the number of selected goods in orders, their price, as well as delete and add positions.
In the database, the fields are stored in two tables: "orders" - orders, "order_position" - ordered goods.
Scheme below:
orders:
_attributes: { phpName: Order }
id: { type: INTEGER, size: '11', primaryKey: true, autoIncrement: true, required: true }
user_id: { type: integer, foreignTable: user, foreignReference: id, onDelete: setNull }
guest_id: { type: integer, foreignTable: guest, foreignReference: id, onDelete: setNull }
cost: { type: decimal, size: 9, scale: 2 }
comments: { type: longvarchar }
action: { type: varchar(255) }
created_at:
order_position:
id: { type: INTEGER, size: '11', primaryKey: true, autoIncrement: true, required: true }
order_id: { type: integer, foreignTable: orders, foreignReference: id, onDelete: cascade }
item_id: { type: integer, foreignTable: catalog_item, foreignReference: id, onDelete: setNull }
quantity: { type: decimal, size: 9, scale: 2 }
cost: { type: decimal, size: 9, scale: 2 }
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question