Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2008
    Posts
    627
    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
    627
    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
    627
    Plugin Contributions
    0

    Default Re: Bulk add attributes to all products

    csv import worked out fine.

 

 

Similar Threads

  1. How to add discounted prices for an attributes on all products?
    By haniffali in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 0
    Last Post: 19 Dec 2011, 11:10 PM
  2. How to add attributes WITH their values (prices) to all products
    By creamcrackers in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 9 Aug 2009, 04:04 PM
  3. WHen I go to add attributes to all products I get an Error.
    By ousooners in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 18 Feb 2009, 01:52 PM
  4. Add attributes to all products
    By jatinder in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 19 Sep 2007, 07:43 AM
  5. Bulk Discounts on all products in a category
    By mommydesigns in forum Setting Up Specials and SaleMaker
    Replies: 3
    Last Post: 5 Nov 2006, 01:16 PM

Posting Permissions

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