News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Partial Solution to Migration of Product Attributes

Started by raycarter, May 01, 2012, 17:34:52 PM

Previous topic - Next topic

raycarter

Quote from: hoseonline on May 14, 2013, 10:00:35 AM
Hi,
it doesnt run.
When I start the script it says
Connted to DB - Beginning operation

INSERT INTO jos__virtuemart_customs (custom_title,custom_tip,field_type,is_cart_attribute,published) VALUES
        ('Größe',"","V","1","1")
all end

There are no attributes in the new tables of VM2.

Can you help?

Did you adjust the configurations in the beginning of the code?
The new database name, the old database name.

Also make sure old database tables are present side by side the new tables.


vragec

Hi,

Great script, but it doesnt work for me.

It writes out message:


Connted to DB - Beginning operation



Warning:  mysql_result() expects parameter 1 to be resource, boolean given in /home/ortopeds/public_html/xxxx/xxxx/importer.php on line 132



Warning:  mysql_result() expects parameter 1 to be resource, boolean given in /home/ortopeds/public_html/xxxx/xxxx/importer.php on line 132

INSERT INTO j25_virtuemart_customs (custom_title,custom_tip,field_type,is_cart_attribute,published) VALUES
        ('Barva',"","V","1","1")
all end



Any ideas?

raycarter

Quote from: vragec on May 16, 2013, 18:06:25 PM
Hi,

Great script, but it doesnt work for me.

It writes out message:


Connted to DB - Beginning operation



Warning:  mysql_result() expects parameter 1 to be resource, boolean given in /home/ortopeds/public_html/xxxx/xxxx/importer.php on line 132



Warning:  mysql_result() expects parameter 1 to be resource, boolean given in /home/ortopeds/public_html/xxxx/xxxx/importer.php on line 132

INSERT INTO j25_virtuemart_customs (custom_title,custom_tip,field_type,is_cart_attribute,published) VALUES
        ('Barva',"","V","1","1")
all end



Any ideas?

Hi, its unfortunate that it didnt work. Can you follow the last post and tell me if you made sure that all new and old tables were in place? and you already imported the products to new VM.

jgentles

Thank you very much for this solution. It worked perfectly for me and saved me so much time. Thank you! Thank you! Thank you!

Janice Gentles-Jones
JGJ Consulting
www.onlinesuccessmap.com

Milbo

Looks good. I took the code and added it to the core, to the migrations tab. But I cannot test it. The code is just roughly added and made working with the joomla db. It would be cool if someone could enhance it in future there, so it is directly in the code :-) Please check 2.0.21E http://dev.virtuemart.net/projects/virtuemart/files
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

raycarter

#35
Quote from: Milbo on June 14, 2013, 15:06:27 PM
Looks good. I took the code and added it to the core, to the migrations tab. But I cannot test it. The code is just roughly added and made working with the joomla db. It would be cool if someone could enhance it in future there, so it is directly in the code :-) Please check 2.0.21E http://dev.virtuemart.net/projects/virtuemart/files

Hello Milbo. Thats a good news.  But i dont see any 2.0.21E yet.


I had done this script for one of my sites and thought i would share it. The script is not complete and is missing atleast 2 things:

1. it shouldnt keep importing attributes over and over again if ran more than once.

2. Someone asked before that how could they import attributes defined like the following :

Size,110 x 170cm[=104.17],140 x 200cm[=158.33],170 x 240cm - SOLD OUT[=208.33],200 x 300m - SOLD OUT[=283.33],250 x 350cm[=483.33]

You'll notice that the price is the final value price not an addition to the base price and i have not handled this in my code. I can do this if i only i knew what such products become in Virtuemart 2.  Do they become cart variants?


Let me know if there is anything else that i missed and i will do it.

Thanks


Milbo

Here http://forum.virtuemart.net/index.php?topic=115877.0

We had this code also already in the migrator, but it was leading to errors sometimes. So I think it is better to have it in independend tasks. Your function is in the BE/helpers/migrator.php. At the end of the line is your function. I just added the resume, please check it. It would be also nice if someone debugs the migrate related products solution.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

Please test http://forum.virtuemart.net/index.php?topic=115877.0 Version G is now also importing the values correctly. But we had to drop the =values, because they make not really sense (would just change the baseprice)
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

raycarter

Quote from: Milbo on June 26, 2013, 23:02:03 PM
Please test http://forum.virtuemart.net/index.php?topic=115877.0 Version G is now also importing the values correctly. But we had to drop the =values, because they make not really sense (would just change the baseprice)

I had started to work on it to improve the code. i had fixed it for + and - scenario. I worked on the = case as well but according to my knowledge those are child products (if i am not wrong). so one can create child products out of them. i wrote some more code and then left the country for some days and could never get back to it.
I will come back to it soon and share my code.

_dj

Your code is working fine for "Attribute List" but for "Custom Attribute List" it doesn't working. Will you please add some code or comments to make this.

_dj

One more thing, after selecting "Attribute List" the price is not updated according to the selected items, in the cart.
As in attached pics. pic 11 shows the old version attribute list and pic 10 shows the updated one but haven't migrate price. Please have a look on it.

[attachment cleanup by admin]

Maxim Pishnyak

You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

_dj

raycarter i'm waiting for your reply. Please give me way how i can use your code to migrate "Custom Attribute List".

Maxim Pishnyak

Quote from: Maxim Pishnyak on September 17, 2013, 17:16:34 PM
CSVI Improved is the way to go.
Why even don't try proposed solution? Solution which will be supported for you by VM and CSVI strong support forums?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

_dj

Maxim Pishnyak my client doesn't want any paid extension. Everything has been migrated. Just for Custom attribute i have to purchase a new extension. That doesn't make any sense.