Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

OSC-Sevilla

Pioneers
  • Posts

    393
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by OSC-Sevilla

  1. My store is havily modified,

     

    The addon is insatalled and working, however.

     

    The addon tells me i have 72 tables for backup. My SQL Server says 74.

     

    Hence when i restore form backup im missing things.

     

    How to edit the addon to catch all...?

     

    IE. the backups are not backing everything up.

     

    Any ideas??

     

    Solved the issues - I see two tables -"who´s online and sessions".....

     

    Nevermind - thanks all

  2. My store is havily modified,

     

    The addon is insatalled and working, however.

     

    The addon tells me i have 72 tables for backup. My SQL Server says 74.

     

    Hence when i restore form backup im missing things.

     

    How to edit the addon to catch all...?

     

    IE. the backups are not backing everything up.

     

    Any ideas??

  3. I have two web stores that are identical, both use the smae exact code.

     

    For some reason on one of the stores the "NEW DIRECTORY " button has stopped showing....

     

    What would be the cause of this. Everything else is working just fine.

     

    Just a pointer would help. Thank you.

     

    After some successful head scrathing the issue is solved.

     

    For reason only known to OSC the copied site, identical contained an issue. This issue was the "Aministation table" in the SQL SERVER. I simply updated this table and all went back to normal!

  4. I am modding order editor to incoporate my lead time addon that shows if the product carries a lead time and how many days, during editing the order the operatoer can change these the specs:

     

    this piece of code refers to a checkbox that shows which product(s) have lead times

     

    <td class="dataTableContent" valign="top"><input type="checkbox" title="Lead time Active: <?php echo $order->products[$i]['lead_time_days']; ?> DAYS" name="<?php echo "update_products[" . $orders_products_id . "][lead_time]"; ?>" <?php if (ORDER_EDITOR_USE_AJAX == 'true') { ?>onClick="updateProductsField('update', '<?php echo $orders_products_id; ?>', 'products_lead_time', this.checked, this)"<?php } ?> <?php if($order->products[$i]['lead_time']=='1'){ echo "checked=\"true\""; }?>"></td>

     

     

    The problem i am having is the data form the check box enters mySQL as " true " or " false" - is all well and good but i would like it to go in as "1" or "0"

     

    If i deactivate AJAX, it goes in as "on"....

     

     

    My db is currently VARCHAR (5).

     

     

    I have googled searched high and low but not found a straight forward solution.

     

     

    All this is carried out on edit_orders.php:

     

    // Update orders_products Table

    $Query = "UPDATE " . TABLE_ORDERS_PRODUCTS . " SET

    products_model = '" . $products_details['model'] . "',

    products_name = '" . oe_html_quotes($products_details['name']) . "',

    products_price = '" . $products_details['price'] . "',

    final_price = '" . $products_details['final_price'] . "',

    products_tax = '" . $products_details['tax'] . "',

    products_quantity = '" . $products_details['qty'] . "',

    products_lead_time = '" . $products_details['lead_time'] . "',

    products_lead_time_days = '" . $products_details['lead_time_days'] . "'

    WHERE orders_id = '" . (int)$oID . "'

    AND orders_products_id = '$orders_products_id';";

    tep_db_query($Query);

     

     

    Any ideas folks??

  5. Ok, managed to fix this. smile.gif

     

    I changed this part:

    		if (is_array($this->contents[$products_id]['attributes'])) {
    	while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
    	  $attribute_code_query = tep_db_query("select code_suffix, suffix_sort_order from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
    	  $attribute_code = tep_db_fetch_array($attribute_code_query);
    	  if (tep_not_null($attribute_code['code_suffix'])) {
    		$attribute_code_array[(int)$attribute_code['suffix_sort_order']] = $attribute_code['code_suffix'];
    		}
    	  }

     

    to this:

     

    		if (is_array($this->contents[$products_id]['attributes'])) {
    		$i = 0;
       	foreach ($this->contents[$products_id]['attributes'] as $attributes){
    		$option = array_keys($this->contents[$products_id]['attributes']);
    		$value = $this->contents[$products_id]['attributes'];
       		$attribute_code_query = tep_db_query("select code_suffix, suffix_sort_order from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option[$i] . "' and options_values_id = '" . (int)$value[$option[$i]] . "'");
    	  $attribute_code = tep_db_fetch_array($attribute_code_query);
    	  if (tep_not_null($attribute_code['code_suffix'])) {
    		$attribute_code_array[(int)$attribute_code['suffix_sort_order']] = $attribute_code['code_suffix'];
    		}
    			  $i++;
    	}

     

    So changed while logic to foreach and removed the each() by fetching key values by array_keys and using those values to point to correct option values. Perhaps a bit crude, but now it works as it should've in the first place. smile.gif It really seems that reusing each() within a loop that has already used each() caused this problem, at least in PHP5. This solves the problem.

     

    BINGO!!!!!! Boom we are back in the game! NIce one!

  6. I found this line of code in functions/qtpro_functions

     

    //This function will delete all option stock entries from the product.
    function qtpro_doctor_amputate_all_from_product($products_id){
    tep_db_query("DELETE FROM " . TABLE_PRODUCTS_STOCK . " WHERE products_id =". $products_id);	
    }

     

    and replaced with:

     

    //This function will delete all option stock entries from the product.
    function qtpro_doctor_amputate_all_from_product($products_id){
    tep_db_query("DELETE FROM " . TABLE_PRODUCTS_STOCK . " WHERE products_id =" . (int)$products_id);	
    }

     

    It didnt like the int - and i found this code by doing a find across my whole admin folder for the screwy line of code.

     

    You Sir are "The Man"!!

  7. I've been using the USU contrib for awhile now. I think I may have discovered a glitch in the multi-language contribution - rather an exception that is not caught that can cause serious effects.

    When the second language has a blank products_name (say a mistake was made on entering the product in admin), the category will not load, and the product info page also spits out a non-valid url. Unless there is a workaround im unaware of, i think the best way would be perhaps to check in page_modules/product_info.php if the products_name doesnt exisit - do a second query with the default language. I havent got this working yet though - my sql programming skills are still improving =) I did get something simular working in /catalog/product_info.php to display the default language to the user, when their language doesnt exist.

     

    I could, of course, just check every item in my database - but that would take quite awhile. Also, it wouldnt stop further bad entries made in admin, unless i change admin/categories.php to force it to populate the second language in the sql.

     

    Thanks again for the contrib!

     

    I have the exact same issue!

  8. I use both english and spanish:

     

    the defualt is spanish, so when pages loads its in spanish - when i change languages from the drop down to say english, i get index.php?language=en

     

    now whilst thats in the browser url i clcik special, and see. specials.php/en

    resulting in "No input file specified."....

     

    for everything else its fine. Whats going on here, tralled trought about 150 pages... you guys are the pros whats the score?????

  9. Having a slight problem -

     

    Moved severs, all working fine except:

     

    When browsing images on the server to add photos I can see all the first tier subdirectories but when i click on the subdirectory i just see whats in the products folder and not the subdirectory.

     

    image attached

     

    FIXED - it was an jquery upgrade error, went from 1.4 to 1.7 and it didnt like it

  10. ok check this:

     

    create account.php

     

    tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);

     

    $address_id = tep_db_insert_id();

     

    tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'");

     

    tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int)$customer_id . "', '0', now())");

     

    if (SESSION_RECREATE == 'True') {

    tep_session_recreate();

    }

     

    $customer_first_name = $firstname;

    $customer_default_address_id = $address_id;

    $customer_country_id = $country;

    $customer_zone_id = $zone_id;

    tep_session_register('customer_id');

    tep_session_register('customer_first_name');

    tep_session_register('customer_default_address_id');

    tep_session_register('customer_country_id');

    tep_session_register('customer_zone_id');

     

    // reset session token

    $sessiontoken = md5(tep_rand() . tep_rand() . tep_rand() . tep_rand());

     

    // restore cart contents

    $cart->restore_contents();

     

    // build the message content

    //--- Beginning of addition: Ultimate HTML Emails ---//

    if (EMAIL_USE_HTML == 'true') {

    require(DIR_WS_MODULES . 'UHtmlEmails/'. ULTIMATE_HTML_EMAIL_LAYOUT .'/create_account.php');

    $email_text = $html_email;

    }else{

    //--- End of addition: Ultimate HTML Emails ---//

    $name = $firstname . ' ' . $lastname;

     

    if (ACCOUNT_GENDER == 'true') {

    if ($gender == 'm') {

    $email_text = sprintf(EMAIL_GREET_MR, $lastname);

    } else {

    $email_text = sprintf(EMAIL_GREET_MS, $lastname);

    }

    } else {

    $email_text = sprintf(EMAIL_GREET_NONE, $firstname);

    }

     

    $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;

    //--- Beginning of addition: Ultimate HTML Emails ---//

    }

     

    if(ULTIMATE_HTML_EMAIL_DEVELOPMENT_MODE === 'true'){

    //Save the contents of the generated html email to the harddrive in .htm file. This can be practical when developing a new layout.

    $TheFileName = 'Last_mail_from_create_account.php.htm';

    $TheFileHandle = fopen($TheFileName, 'w') or die("can't open error log file");

    fwrite($TheFileHandle, $email_text);

    fclose($TheFileHandle);

    }

    //--- End of addition: Ultimate HTML Emails ---//

    tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

     

    tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));

    }

    }

     

    $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));

     

    require(DIR_WS_INCLUDES . 'template_top.php');

    require('includes/form_check.js.php');

    ?>

  11. most of my pages i validate through http://validator.w3.org/

     

    im not that offay with many, which one do you recommend?

     

    I actually have the orgional code but for the time being have referenced it as another case.

     

    also, re validation, xhtm transitional and html5 ui references (not sure), such as role="button" umongst others...

     

    what validation measures do you undertake? what is your take on it, im wondering about best practises...?

     

    some page of mine are 100% (no errors), others are not.

     

     

    Thank you.

  12. html_output.php

     

    HTML VALIDATION ERROR ON:

     

    case ($link_data['count'] != '' && $link_data['count'] < 1 && SPECIFICATIONS_FILTER_NO_RESULT == 'grey'):

    $field .= '<optgroup class="no_results" label="';

    $field .= tep_output_string ($link_data['text'] );

    if (SPECIFICATIONS_FILTER_SHOW_COUNT == 'True' && $link_data['count'] != '') {

    $field .= ' (' . $link_data['count'] . ')';

    }

    $field .= '"></optgroup>';

    break;

     

    CHNAGED TO:

     

    case ($link_data['count'] != '' && $link_data['count'] < 1 && SPECIFICATIONS_FILTER_NO_RESULT == 'grey'):

    $field .= '<option disabled="disabled" class="no_results" >';

    $field .= tep_output_string ($link_data['text'] );

    if (SPECIFICATIONS_FILTER_SHOW_COUNT == 'True' && $link_data['count'] != '') {

    $field .= ' (' . $link_data['count'] . ')';

    }

    $field .= '</option>';

    break;

×
×
  • Create New...