Jump to content

 

vanderex

Member Since 27 May 2010
Offline Last Active Jun 08 2019 09:18 PM
*****

Issues I've Posted

    add new store crash

    Posted 3 May 2013

    when you add new store... from rc2...

    Copying directory design/frontend/skins/2/basic/templates/pickers/categories
    Copying directory design/frontend/skins/2/basic/templates/pickers/products
    Column 'container_id' cannot be null (1048)
    INSERT INTO cscart_bm_grids (`width`, `user_class`, `status`, `suffix`, `prefix`, `omega`, `alpha`, `wrapper`, `content_align`, `html_element`, `clear`, `container_id`, `parent_id`) VALUES (16, '', 'A', 0, 0, 0, 0, '', 'FULL_WIDTH', 'div', 0, NULL, 0) ON DUPLICATE KEY UPDATE `width` = 16, `user_class` = '', `status` = 'A', `suffix` = 0, `prefix` = 0, `omega` = 0, `alpha` = 0, `wrapper` = '', `content_align` = 'FULL_WIDTH', `html_element` = 'div', `clear` = 0, `container_id` = NULL, `parent_id` = 0
    Backtrace:

    File: app/Tygh/Database.php
    Line: 301
    Function: _error
    File: app/Tygh/Database.php
    Line: 250
    Function: query
    File: app/functions/fn.database.php
    Line: 118
    Function: replaceInto
    File: app/Tygh/BlockManager/Grid.php
    Line: 147
    Function: db_replace_into
    File: app/Tygh/BlockManager/Exim.php
    Line: 311
    Function: update
    File: app/Tygh/BlockManager/Exim.php
    Line: 118
    Function: _parseGridStructure
    File: app/Tygh/BlockManager/Exim.php
    Line: 35
    Function: import
    File: app/functions/fn.common.php
    Line: 4522
    Function: importFromFile
    File: app/functions/fn.companies.php
    Line: 785
    Function: fn_install_skin
    File: app/controllers/backend/companies.php
    Line: 102
    Function: fn_update_company
    File: app/functions/fn.control.php
    Line: 579
    Function: include
    File: app/functions/fn.control.php
    Line: 374
    Function: fn_run_controller
    File: znimda.php
    Line: 19
    Function: fn_dispatch

    API bug...

    Posted 2 May 2013

    make_cat("test2");
    make_prod("tester23");


    when make cat returns category_id={3} ,
    make_prod("test") will not work.. it will add product_id... BUT it doesnt mape the product to category in DB...

    seems it's not adding to `cscart_products_categories`

    so i SQL'ed
    INSERT INTO `csbeta`.`cscart_products_categories` (`product_id`, `category_id`, `link_type`, `position`) VALUE

    etc



    function make_prod($name) {
    $data=array('product'=>$name,
    'category_ids'=>3,
    'main_category'=>3,
    'price'=>'1.00',
    'company_id'=>'1',
    'status'=>'A',
    'amount'=>3);
    $where="products";

    $data_string = json_encode($data);
    // print $data_string;
    $url="url/api.php?q={$where}";

    $ch=curl_init();
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    //curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ) ;
    curl_setopt($ch, CURLOPT_USERPWD, "user:pass");
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($data_string)) );
    $content = curl_exec( $ch );
    $response = curl_getinfo( $ch );
    curl_close ($ch);

    print $content;
    print "<pre>";
    print_r($response);
    }

    function make_cat($name) {
    $data=array('category'=>$name,'company_id'=>'1','status'=>'A');
    $where="categories";

    $data_string = json_encode($data);
    // print $data_string;
    $url="http://url/api.php?q={$where}";

    $ch=curl_init();
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    //curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ) ;
    curl_setopt($ch, CURLOPT_USERPWD, "usr:pass");
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($data_string)) );
    $content = curl_exec( $ch );
    $response = curl_getinfo( $ch );
    curl_close ($ch);

    print $content;
    print "<pre>";
    print_r($response);
    }