Jump to content

rhedlund

Members
  • Content count

    5
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Roger Hedlund
  1. rhedlund

    Script for Product-Image insert

    An even better solution would be to mod the picture display parts so that wheneever a link to a picture is to be displayed, its existance is checked first, and if not available a default "no picture" link is inserted instead. The "no picture" should be configurable from admin, of course. Maybe different pictures depending on category or other params. This way you just check the actually chosen images from the file system at run time. The "no picture" will show until the second you upload the image. Just an idea for a mod.
  2. I uploaded a file with no problems, and then I changed the image file names and uploaded it again, but the image field wasn't updated in the UPDATE PRODUCTS statement. I inserted it and it worked Ok. I thought I'd just let you know. There was another problem due to a mistake I made, I used more than 12 characters for MODEL which created quite a number of extra records as these were treated as new records when I tried to update them.
  3. rhedlund

    Contribution - Excel Import 1.51

    I have tried it and it works fine. The only trouble is (was) that the INSERT statement when supplying DateAvailable is incorrect. It is $query = 'INSERT INTO products ( products_status,products_image, products_model, products_price, products_status, products_date_added, products_date_available, products_tax_class_id, products_weight, products_quantity) VALUES (1, "' . $v_products_image . '", "' . $v_products_model . '", ' . $v_products_price . ', "1", CURRENT_TIMESTAMP, "'.$v_date_avail.'", "'.$v_tax_class_id.'", "'.$v_products_weight.'", "'.$v_products_quantity.'")'; but should be $query = 'INSERT INTO products ( products_image, products_model, products_price, products_status, products_date_added, products_date_available, products_tax_class_id, products_weight, products_quantity) VALUES ( "' . $v_products_image . '", "' . $v_products_model . '", ' . $v_products_price . ', "1", CURRENT_TIMESTAMP, "'.$v_date_avail.'", "'.$v_tax_class_id.'", "'.$v_products_weight.'", "'.$v_products_quantity.'")'; That is; you have to remove one of the entries for products_status from field list and value list. After changing this it works fine. (I haven't checked the database contents yet though :wink: )
×