Announcement

Collapse
No announcement yet.

deleting product with xml provisioning import file, how to?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    deleting product with xml provisioning import file, how to?

    I have found in the
    latest XML Provide file: http://www.mivamerchant.com/assets/master_provide.zip
    example of deleting images and attributes and categories and lots of other things.
    I did not find an example of deleting a product.

    is it similar to the update or add xml tags?
    <Product_Update code="existing_code">
    or something more like
    <Product_Add>
    <code></code>
    </Product_Add>
    where I would replace the update or add with the word delete?

    I need to delete a bunch of products and also the associated physical image files from my site.
    so a 2nd set of related questions regarding product images is how do these function exactly?

    Does this delete a physical file off the server even if it isn't in the store databases?
    <Image_Delete filepath="graphics/00000001/s2k_red_front.jpg" />


    Does this do more than just delete the physical image, does it remove references in the database too?
    <ProductImage_Delete product_code="test" filepath="graphics/00000001/s2k_silver_front.jpg" />

    Or does this just remove only the physical file same as image_delete does? how is this different than image_delete
    <ProductImage_Delete_File product_code="test" filepath="graphics/00000001/s2k_silver_front.gif" />

    I"m guess this one just removes all images from a product. Does it also remove the files?
    <ProductImage_Delete_All_Product product_code="p1" />
    if it doesn't remove files is there a xml tag which you have to run before that to also remove the physical files first?

    #2
    Re: deleting product with xml provisioning import file, how to?

    okay i figured out the first part... <Product_Delete code="AA432"/></Product_Delete>
    works.
    I still wonder if this will delete all the attributes custom field data and all the other junk associated with that product code out of the db? will it?

    BUT what about the associated image files on the server? those questions from my original post remain, what do I do for those?

    Comment


      #3
      Re: deleting product with xml provisioning import file, how to?

      Product_Delete will delete all information associated with the product (attributes, options, etc...)
      The ProductImage_Delete tags only remove the image from the product, they do not delete the image files from the server. If you want to delete the image files, you should use the delete unreferenced image feature in the image management module (which cannot be triggered through provisioning).

      Comment


        #4
        Re: deleting product with xml provisioning import file, how to?

        a ha! okay. good to know. glad you put in a feature to remove unreferenced images. though that does throw a little bit of a curve ball to our work arounds for non product/non category images we use on the site.

        Since htmlscript/openui/miva2/3.x/4.x/5.5 days we have had our staff use the upload image upload feature on the products or category admins to put up images that we used in static html on our storefront or in headers and footers... It was really convenient. I didn't have to teach them another piece of software like an ftp program, and risk them messing up by overwriting, or deleting something... etc. It sure saved on that headache. Also meant I didn't need to give ftp to anyone, in fact, we've got it turned off on most of our stores server configurations, we only gave out ssl and sftp access to developers only. it made pci compliance easier too. The less type of access to a server, the better!

        So now that we shouldn't use that work around for uploading images (because they wouldn't be 'referenced' and might get deleted).
        I will add to the wish list.. that you should have a separate extra store images admin area. It would have the image upload button, for images not related to products, categories, buttons, etc. it would keep a list and display a little thumbnail so we know what it is and allow us to have a text field so if we want we can have a reminder of what it is. that way they can be 'referenced' and not get deleted. Lots of us have images on our sfnt page we change out regularly and i know mine aren't referenced but they are in the graphics\00000001\ folder.

        For now, I guess I'll create a dummy product and just have a whole bunch of additional images assigned to it for this usage.
        That is the only way I can think of to get around this 'cleanup' of unreferenced images think - which I think is GREAT by the way. But kinda of a pita to accomodate (at least temporarily)

        Comment


          #5
          Re: deleting product with xml provisioning import file, how to?

          Hello,

          I tried using some of this code to delete products via xml but received some errors. What am I doing wrong? Thanks.

          1.
          <product_delete code="TR492061KT"/></product_delete>

          02/11/2013 12:59:49 1 Expected '/Store', found '/product_delete'

          2.
          <product_delete>
          <code>TR492061KT</code>
          </product_delete>

          02/11/2013 12:58:49 1 product_delete Missing required attribute code

          Comment


            #6
            Re: deleting product with xml provisioning import file, how to?

            Drop the </product_delete> tag from form #1:

            <product_delete code="TR492061KT" />

            The "/>" ending of that tag marks it as self-closing, so the close tag is not required.

            Comment


              #7
              Re: deleting product with xml provisioning import file, how to?

              That was exactly the problem.

              Thank you Burch

              Comment

              Working...
              X