PLZ HELP: How to transfer values from one column to another (of another table) in database

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
My website was based on 1.4v and that time there was no cost price field in the product table so that time i created another table and on the bases of product ID i used to enter the cost price to keep product details.

Now I have upgraded to 1.9v but now product information includes cost price.

Now my question is how can I transfer the cost price from my table(that I added in 1.4) to the product table cost price column ?

plz help
13 years ago
PLZ HELP
13 years ago
*bump
13 years ago
You have two options

1. Add the field on NopProductVariant Table (so you have to add the field in every where, where nop update,delete,insert, view)

2. Keep your customize table. Just add your table in nopcommerce entity framwork

If you need my help just email me.

Thanks
Noman Mansoor
13 years ago
Noman wrote:
You have two options

1. Add the field on NopProductVariant Table (so you have to add the field in every where, where nop update,delete,insert, view)

2. Keep your customize table. Just add your table in nopcommerce entity framwork

If you need my help just email me.

Thanks
Noman Mansoor


Is there any script or SQL command that I can run on my database so that cost price from my additional table gets copies to respective product in the product variant table ?

This is the table I added: http://img254.imageshack.us/img254/707/varianttablename.jpg

This is the table structure : http://img810.imageshack.us/img810/7601/varianttablestructure.jpg

I haven't linked this table with any other table, I used to update/add cost price on the bases of product ID So I guess there must be some SQL Command by which I can transfer the cost price value to it's respective product in product variant table instead of going the long way of updating it in  nopcommerce entity framwork or update,delete,insert, view.

Plz help me
13 years ago
If you want to only update one colum from your table to Nop_ProductVaraint Table so runthe query of update.

/*For View */
========
select npv.ProductCost, pvad.Cost
from Nop_ProductVariant npv INNER JOIN ProductVariant_AdditionalFields pvad
on npv.ProductVariantId = pvad.ProductVariantId
and npv.ProductID = pvad.ProductID


/*to update the record */
================
update npv set  npv.ProductCost = pvad.Cost
from Nop_ProductVariant npv INNER JOIN ProductVariant_AdditionalFields pvad
on npv.ProductVariantId = pvad.ProductVariantId
and npv.ProductID = pvad.ProductID



Thanks
Noman Mansoor
13 years ago
thank you so much Noman that command worked !!!

could you plz pm me your e-mail address incase if i need any help in future from your side.

can you also help me with this ? : https://www.nopcommerce.com/boards/t/6968/i-need-help-in-adding-extra-product-fields-in-database.aspx?p=1

I have been struggling with this issue since a long time and still I am not been able to do it.
13 years ago
i can help you. no problem

[email protected]
[email protected]

Thanks
Noman Mansoor
13 years ago
Noman wrote:
i can help you. no problem

[email protected]
[email protected]

Thanks
Noman Mansoor


Thank you so much noman, can't wait for the solution, i have been struggling with it since last 2 months.

I will keep an eye on that thread for your reply.

you are the best!
13 years ago
Supper

To add the entity in nopcommerce and setup all thing its a long process . I Give you option.
Do one thing give me your access of your pc  i developed for you on your pc so  you see how can you add the entity in nopcommerce. Set on your pc teamviewer and give me the your teamviewer id and password.

Tell me the time. and give me the you email id so we can talk easily

Thanks
Noman Mansoor
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.