We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18608
    • 112 Posts
    Hi,

    I have a site with 500+ product pages. On those resources there is a lot of tv's for product photos and prices. I now have a list with new prices that I need to update the tv's with.
    The list has the resource id number and the new value for the tv's.

    What would be the best approach to update the TV's?

    This question has been answered by gallenkamp. See the first response.

      Mathias Dannevang | Webdesigner at dannevang.org | Tweets @dannevang
    • Ok, once again here instead of twitter smiley

      All of these values are existing TV values, but only changed the values. Just replace the old values, right?
        • 18608
        • 112 Posts
        Ok smiley

        It's both update and create. With some products the tv's already have a value and need to be updated, with others the tv is empty right now.
          Mathias Dannevang | Webdesigner at dannevang.org | Tweets @dannevang
        • Do they contain all currently existing TVs? That - in the end - you can replace the whole table without losing any TVs?
            • 18608
            • 112 Posts
            The list doens't contain all TV's right now, but I could do an export of the resources and merge the current values with the new ones in excel - this was my initial plan. My problem is how to reimport the whole list. I was thinking of using Mark Hamstra's ImportX. But that doesn't work on tv's when you do a update, only if you create.
              Mathias Dannevang | Webdesigner at dannevang.org | Tweets @dannevang
              • 18608
              • 112 Posts
              ...and this got me thinking:

              Since I have all the values I want in the end. If I use phpmyadmin to delete all current tv values that I want to update, and then create a temporary table from my list with the new tv's I could use that temp table to create new tv values directly with sql...
                Mathias Dannevang | Webdesigner at dannevang.org | Tweets @dannevang
              • discuss.answer
                Why yould you like to edit TV values outside of MODX anyway? Wouldnt be "export via phpMyAdmin -> edit in notepad++ -> reimport" the easiest thing to do?
                  • 18608
                  • 112 Posts
                  Outside modx because the new prices is exported from another system.

                  Since I already had the list, formatting it correctly and then importing it directly in phpmyadmin did the trick. Thx for your help!
                    Mathias Dannevang | Webdesigner at dannevang.org | Tweets @dannevang
                    • 38290
                    • 712 Posts
                    I can't remember if ImportX supports updating existing resources rather than just adding knew ones but it could be handy for things like this. Would backup db before trying
                      jpdevries
                      • 18608
                      • 112 Posts
                      Quote from: dinocorn at Dec 27, 2012, 11:58 PM
                      I can't remember if ImportX supports updating existing resources rather than just adding knew ones but it could be handy for things like this. Would backup db before trying

                      It does support updating since 1.1: http://rtfm.modx.com/display/ADDON/ImportX#ImportX-UpdatingDatainsteadofcreatingnewResources But only for the standard values, not tv's. And there is some errors in it as well. (You have to supply the parent directory when updating, otherwise it will revert to the default).

                      It would be a great feature if it could update tv's too. But I think Mark is a bit to busy to update it further, judging from the age of the issue list on github smiley
                        Mathias Dannevang | Webdesigner at dannevang.org | Tweets @dannevang