Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2008
    Posts
    36
    Plugin Contributions
    0

    Default Using the Install SQL Patches Tool to install Stock By Attribute contribution

    Hi

    I need to install the "Stock by Attributes" contribution, but I'm a litle unsure about how to use the above tool.

    The contribution instructions say "Create a new database table and a new configuration switch by running the stock_attributes.sql via the Admin>Tools>Install SQL Patches.

    I've had a look at this but how exactly do I use this.

    Many thanks in anticipation of your help.

    Philip

  2. #2

    Default Re: Using the Install SQL Patches Tool

    Well, there are two ways. The way I prefer and has been reliable is to open the stock_attributes.sql with a text editor, and highlight all the code and select copy. Be sure you highlighted all the code and not just part. Then go into the Admin section and goto Tool -> Install SQL Patches. Then paste the information that you just copied into the big form area on the screen. It is very important that you don't type anything extra here. Next press 'send' to have the sql statements processed. You will get a message that lets you know if the process was successful or failed, and you go from there.

    The other way is to go to Admin->Tools -> Install SQL Patches. There is a browse button where you could browse for the file on your hard drive, select the file, then click upload. I've heard that this method is not as reliable for some reason so I don't use it.

    Now there is a recommendation that you back up you database before you run any sql statements into it. Even if you don't backup your database everytime, at least do it occasionally. There is this download called MySQL Backup for Zen Cart that you may want to download to make this easier. I personally use the backup from PHPMyAdmin from my webhost provider.[/SIZE]
    Last edited by rainthebat; 4 Jan 2008 at 06:54 PM. Reason: add

  3. #3
    Join Date
    Jan 2008
    Posts
    36
    Plugin Contributions
    0

    Default Re: Using the Install SQL Patches Tool

    Thanks Rainthebat for your extremely helpful reply. I'll give it a go.

    Kind regards

    Philip

  4. #4
    Join Date
    Jan 2008
    Posts
    36
    Plugin Contributions
    0

    Default Re: Using the Install SQL Patches Tool

    Quote Originally Posted by rainthebat View Post
    Well, there are two ways. The way I prefer and has been reliable is to open the stock_attributes.sql with a text editor, and highlight all the code and select copy. Be sure you highlighted all the code and not just part. Then go into the Admin section and goto Tool -> Install SQL Patches. Then paste the information that you just copied into the big form area on the screen. It is very important that you don't type anything extra here. Next press 'send' to have the sql statements processed. You will get a message that lets you know if the process was successful or failed, and you go from there.

    The other way is to go to Admin->Tools -> Install SQL Patches. There is a browse button where you could browse for the file on your hard drive, select the file, then click upload. I've heard that this method is not as reliable for some reason so I don't use it.

    Now there is a recommendation that you back up you database before you run any sql statements into it. Even if you don't backup your database everytime, at least do it occasionally. There is this download called MySQL Backup for Zen Cart that you may want to download to make this easier. I personally use the backup from PHPMyAdmin from my webhost provider.[/SIZE]
    Right, I had a go at this and get the following response.

    1062 Duplicate entry 'STOCK_SHOW_LOW_IN_CART' for key 2
    in:
    [INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Show available stock level in cart when less than order', 'STOCK_SHOW_LOW_IN_CART', 'false', 'When customer places more items in cart than are available, show the available amount on the shopping cart page:', '9', '6', NULL, now(), NULL, "zen_cfg_select_option(array('true', 'false')," );]
    If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields


    The original SQL patch is as follows:-

    CREATE TABLE products_with_attributes_stock (
    stock_id INT NOT NULL AUTO_INCREMENT ,
    products_id INT NOT NULL ,
    stock_attributes VARCHAR( 255 ) NOT NULL ,
    quantity FLOAT NOT NULL ,
    PRIMARY KEY ( `stock_id` )
    );

    INSERT INTO configuration (configuration_title, configuration_key, configuration_value,
    configuration_description, configuration_group_id, sort_order,
    last_modified, date_added, use_function, set_function)
    VALUES ('Show available stock level in cart when less than order', 'STOCK_SHOW_LOW_IN_CART', 'false',
    'When customer places more items in cart than are available, show the available amount on the shopping cart page:',
    '9',
    '6',
    NULL,
    now(),
    NULL,
    "zen_cfg_select_option(array('true', 'false'),"
    );


    Can any spot where I am going wrong please?

    Philip

 

 

Similar Threads

  1. How do I run the stock_attribute.sql via Install SQL Patches in admin
    By vivaraquel in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 9 Apr 2007, 01:55 AM
  2. Twice the "Install SQL Patches" tool listed in Admin ?
    By rtw819 in forum General Questions
    Replies: 6
    Last Post: 19 Mar 2007, 06:33 AM
  3. Replies: 23
    Last Post: 18 Mar 2007, 10:28 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