Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2008
    Posts
    448
    Plugin Contributions
    0

    Default Bulk add attributes to all products

    I have one option name/option value that I would like to add to 5,000+ products. Can this code be altered so I can run it in phpmyadmin so it will this same option name/option value to all products?


    INSERT INTO `username_zen2`.`zen_products_attributes` (`products_attributes_id`, `products_id`, `options_id`, `options_values_id`, `options_values_price`, `price_prefix`, `products_options_sort_order`, `product_attribute_is_free`, `products_attributes_weight`, `products_attributes_weight_prefix`, `attributes_display_only`, `attributes_default`, `attributes_discounted`, `attributes_image`, `attributes_price_base_included`, `attributes_price_onetime`, `attributes_price_factor`, `attributes_price_factor_offset`, `attributes_price_factor_onetime`, `attributes_price_factor_onetime_offset`, `attributes_qty_prices`, `attributes_qty_prices_onetime`, `attributes_price_words`, `attributes_price_words_free`, `attributes_price_letters`, `attributes_price_letters_free`, `attributes_required`) VALUES ('1074', '8368', '1', '1', '0.0000', '+', '0', '1', '0', '+', '0', '0', '1', NULL, '1', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, '0.0000', '0', '0.0000', '0', '0');[...]";

  2. #2
    Join Date
    Jun 2008
    Posts
    448
    Plugin Contributions
    0

    Default Re: Bulk add attributes to all products

    I've decided to try doing this by exporting a csv of the zen_products_attributes table. To this csv file I've added the product ID's from the zen_products table, incremented the products_attributes_id field and filled in the rest of the fields according to the attributes info. Next I'm going to import back to the database.

    There are no other attributes set up except for a couple I set up in admin to examine the fields so I know I won't be duplicating any ID's.

    Are there any problems doing it this way that I might run into?

    Also for the purpose of importing the csv file back into the database is it ok to leave the csv export default options as they are which are

    options

    Fields terminated by ;
    Fields enclosed by "
    Fields escaped by \
    Lines terminated by AUTO
    Replace NULL by NULL
    Remove CRLF characters within fields - box unchecked
    Put fields names in the first row - box unchecked

  3. #3
    Join Date
    Jun 2008
    Posts
    448
    Plugin Contributions
    0

    Default Re: Bulk add attributes to all products

    csv import worked out fine.

 

 

Similar Threads

  1. add products from excel in bulk?
    By stevie_vee in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 2 Nov 2011, 07:15 PM
  2. Bulk uploading with attributes
    By kal130 in forum General Questions
    Replies: 0
    Last Post: 2 Nov 2010, 05:37 AM
  3. Default Attributes for Category or Add Attributes when Creating Products
    By vegascoug in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 17 Sep 2009, 12:03 AM
  4. Bulk creation of attributes
    By brianko in forum Contribution-Writing Guidelines
    Replies: 2
    Last Post: 12 Jul 2009, 05:21 AM
  5. Use add multi products form for products with attributes!
    By yellow1912 in forum General Questions
    Replies: 3
    Last Post: 5 Feb 2008, 02:16 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •