Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 4 of 4

Thread: SQL for Image Filename Override

  1. #1
    joecalardo is offline Member
    Join Date
    May 2011
    Posts
    61

    Default SQL for Image Filename Override

    Hello, I want to know what the correct query would be to update product ID image filename overrides, thanks. I want to use SE titled images for my products, but I'll still keep the original files in my database for other pages I linked to them, so basically just need the query to insert ...so example change products current default image from 5461.jpg to martin-mania-product.jpg etc etc. Thanks

  2. #2
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    Code:
    UPDATE PRODUCT
    SET ImageFileNameOverride = SEName + '.jpg'
    I would suggest you perform this on a test database first to see that the results are what you expect.
    http://www.esedirect.co.uk
    --------------------------------------------------------------------------
    Using MS 9.2.0.0 with the following customisations:

    Lightbox/Fancybox enlarged images;
    Auto-suggest searchbox;
    Extra product information shown only to our IP Address (such as supplier info, costs, etc.);
    Failed transactions emailed via trigger;
    Custom app to show basket contents when customer online;
    Orders pushed through to accounting systems.

    All the above without source!

  3. #3
    joecalardo is offline Member
    Join Date
    May 2011
    Posts
    61

    Default

    How is that query going for changing specific product ID's? I'm going to build in excel and concatenate etc .... so like 5761 = sename.jpg, 5762 = sename.jpg, i'm going to keep the original files that were made from my original upload, because I made landing pages that still call those files and images, so i'm going to just duplicate my images but use different name

  4. #4
    esedirect is offline Senior Member
    Join Date
    Feb 2010
    Location
    Norfolk, UK
    Posts
    343

    Default

    SEName is a field in the database, and is derived from the product.name field. When you update the product record through the admin, it takes the product name and replaces spaces and other punctuation that you have used with hyphens (-). So, if your product 5461 is called a "Martin Mania Product" then SEName will contain "martin-mania-product" and the script I wrote will make ImageFileNameOverride = "martin-mania-product.jpg".

    But if you want something in Excel, then it's probably something along the lines of:

    Code:
    ="UPDATE Product SET ImageFileNameOverride='" & B1 & ".jpg' WHERE ProductID=" & A1
    where B1 contains the sename you want to use, and A1 contains the productid.
    http://www.esedirect.co.uk
    --------------------------------------------------------------------------
    Using MS 9.2.0.0 with the following customisations:

    Lightbox/Fancybox enlarged images;
    Auto-suggest searchbox;
    Extra product information shown only to our IP Address (such as supplier info, costs, etc.);
    Failed transactions emailed via trigger;
    Custom app to show basket contents when customer online;
    Orders pushed through to accounting systems.

    All the above without source!