Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2010
    Posts
    24
    Plugin Contributions
    0

    Default Custom Import Script Help

    Zencart Version 1,3.7
    Nope not been upgrade

    Hi all, wondered if someone would help me out i have a custom import script that imports all my categories and products from a CSV file and it drags the information out of the CSV file using the Columns.

    But the problem i am having is when i import it imports all the categories into one category and then it only imports 6 once clicked on the top category and all the rest in the last category instead of importing all productsc inot the correct categories

    I couldnt attach php file as too big so if needed i will send in email? if you send me pm

    Thanks
    Aaron

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Custom Import Script Help

    Your "Custom" script obviously is not handling this correctly

    Try looking at easy populate in the free software add ons for what is the correct way
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jul 2010
    Posts
    24
    Plugin Contributions
    0

    Default Re: Custom Import Script Help

    no the script is fine as it works on other server and it was working but it has just stopped and dont know why? could it be that the extra fields i had to add i am using the wrong Type and Legnth in database?

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Custom Import Script Help

    If it was working before you changed it then I would say YES
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Jul 2010
    Posts
    24
    Plugin Contributions
    0

    Default Re: Custom Import Script Help

    Ok if i was to send u the ones i changed and what they are used for could you give me the best possible match for the type and length please ?

  6. #6
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Custom Import Script Help

    That is beyond forum assistance

    Tyr posting in the commercial help wanted area
    Zen-Venom Get Bitten

  7. #7
    Join Date
    Jul 2010
    Posts
    24
    Plugin Contributions
    0

    Default Re: Custom Import Script Help

    Sent you pm mate, also would it matter where i added the field rows in phpmyadmin? or do they have to be in same order asn the import file is?


    EDIT: ow ok mate sorry

  8. #8
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Custom Import Script Help

    Assistance by PM does not assist the community
    Zen-Venom Get Bitten

  9. #9
    Join Date
    Jul 2010
    Posts
    24
    Plugin Contributions
    0

    Default Re: Custom Import Script Help

    hey mate here is the information:

    i have a field calle dcategory key and this is the function so dont know exactly what it does so not sure what type to use

    PHP Code:
    // Database Functions
    function get_category_by_key($category_key) {
    global 
    $db;

    if (
    $category_key == '')
    return 
    0;


    $category_query 'select ' TABLE_CATEGORIES '.categories_id
    from ' 
    TABLE_CATEGORIES '
    where categories_key = "' 
    trim($category_key) . '"';

    $category $db->Execute($category_query);

    if (
    $category->EOF) {
    return 
    0;
    }
    else
    return 
    $category->fields['categories_id'];
    }

    function 
    get_category_by_name($category_name$parent_id$category_key) {
    global 
    $db;

    if (
    $category_name == '')
    return 
    $parent_id;

    $category_name str_replace("'","'",$category_name);

    $category_query 'select ' TABLE_CATEGORIES_DESCRIPTION '.categories_id
    from ' 
    TABLE_CATEGORIES_DESCRIPTION ' INNER JOIN ' TABLE_CATEGORIES ' ON categories_description.categories_id=categories.categories_id
    where categories_name = "' 
    trim($category_name) . '"
    and parent_id = ' 
    $parent_id '
    and language_id = 1'
    ;

    $category $db->Execute($category_query);

    if (
    $category->EOF) {
    $sql_data_array = array('parent_id' => $parent_id,
    'date_added' => 'now()',
    'categories_key' => $category_key
    );

    zen_db_perform(TABLE_CATEGORIES$sql_data_array);
    $category_id mysql_insert_id();

    $db->Execute("insert into " TABLE_CATEGORIES_DESCRIPTION "
    (language_id, categories_id, categories_name)
    values ('1','" 
    . (int)$category_id "', '" $category_name "')");
    return 
    $category_id;
    }
    else {
    $db->Execute("update " TABLE_CATEGORIES '
    set categories_key = "' 
    $category_key '" , last_modified = now()
    where categories_id = "' 
    . (int)$category->fields['categories_id'] . '"');
    return 
    $category->fields['categories_id'];
    }

    and for the rest here they are:

    products_cost = New Products Cost/Price

    products_group_a_price = Discount Price
    products_group_b_price = Discount Price
    products_group_c_price = Discount Price
    products_group_d_price = Discount Price

    products_delivery = is to do with things like 3-5 days and ext day delivery

    just need to know what typ e and length i could use for these

    thanks
    aaron

 

 

Similar Threads

  1. Import Script Module
    By RJChief in forum General Questions
    Replies: 1
    Last Post: 13 Jan 2010, 08:50 PM
  2. Infusionsoft Import / Synch Script
    By marcps in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 6 Oct 2009, 07:25 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