osCmax v2.5 User Manual
Results 1 to 2 of 2

Easypopulate / Attributes problem.

This is a discussion on Easypopulate / Attributes problem. within the osCmax v1.7 Discussion forums, part of the osCmax v1.7 Forums category; I have been experiencing the following error when using easypopulate: If I enter a product which has attributes with price ...

      
  1. #1
    New Member
    Join Date
    Dec 2004
    Posts
    14
    Rep Power
    0


    Default Easypopulate / Attributes problem.

    I have been experiencing the following error when using easypopulate:

    If I enter a product which has attributes with price implications, for example sizes small, medium and large. Small is the original price, with medium and large being more expensive.

    Being in the UK and using VAT (17.5%), if I want to add £10 to the retail price, for say the medium size I would add + 8.51 under the relevant attribute.

    This works fine if I add it via the admin section. However, if I upload it via easypopulate the 8.51 gets inserted into the database as 8.00, hence the retail would now show + 9.40. Same error if it is downloaded and then re-uploaded, i.e. the correct value of 8.51 in the database would be changed to 8.00.

    For info, the easypopulate file downloads ok and the proper value shows in the text file and subsequently in the script results displayed after an “insert into database”. It is the value in the database itself which has been rounded down. Other currency values, for example the product price, are unaffected.

    Any help on this would be much appreciated.

  2. #2
    New Member
    Join Date
    Dec 2004
    Posts
    14
    Rep Power
    0


    Default RE: Easypopulate / Attributes problem.

    Solved the above by upgrading to version 2.76-MS2 of easypopulate.

    For anyone who is interested, I also had a problem with mangled html in the product descriptions whether "Escape character conversion" was on or off.

    My solution was to set it to off and change the following code which should be around line 1239:

    FROM:

    // Check to see if either of the magic_quotes are turned on or off;
    // And apply filtering accordingly.
    if (function_exists('ini_get')) {
    //echo "Getting ready to check magic quotes<br>";
    if (ini_get('magic_quotes_runtime') == 1){
    // The magic_quotes_runtime are on, so lets account for them
    // check if the last character is a quote;
    // if it is, chop off the quotes.
    if (substr($items[$i],-1) == '"'){
    $items[$i] = substr($items[$i],2,strlen($items[$i])-4);
    }
    // now any remaining doubled double quotes should be converted to one doublequote
    $items[$i] = str_replace('\"\"',"&#34",$items[$i]);
    if ($replace_quotes){
    $items[$i] = str_replace('\"',"&#34",$items[$i]);
    $items[$i] = str_replace("\'","&#39",$items[$i]);
    }
    } else { // no magic_quotes are on
    // check if the last character is a quote;
    // if it is, chop off the 1st and last character of the string.
    if (substr($items[$i],-1) == '"'){
    $items[$i] = substr($items[$i],1,strlen($items[$i])-2);
    }
    // now any remaining doubled double quotes should be converted to one doublequote
    $items[$i] = str_replace('""',"&#34",$items[$i]);
    if ($replace_quotes){
    $items[$i] = str_replace('"',"&#34",$items[$i]);
    $items[$i] = str_replace("'","&#39",$items[$i]);
    }
    }
    }


    TO:

    // Check to see if either of the magic_quotes are turned on or off;
    // And apply filtering accordingly.
    if (function_exists('ini_get')) {
    //echo "Getting ready to check magic quotes<br>";
    if (ini_get('magic_quotes_runtime') == 1){
    // The magic_quotes_runtime are on, so lets account for them
    // check if the last character is a quote;
    // if it is, chop off the quotes.
    if (substr($items[$i],-1) == '"'){
    $items[$i] = substr($items[$i],2,strlen($items[$i])-4);
    }
    // now any remaining doubled double quotes should be converted to one doublequote
    $items[$i] = str_replace('\"\"','\"',$items[$i]);
    if ($replace_quotes){
    $items[$i] = str_replace('\"',"&#34",$items[$i]);
    $items[$i] = str_replace("\'","&#39",$items[$i]);
    }
    $items[$i] = ( addslashes ( $items[$i] ) );
    } else { // no magic_quotes are on
    // check if the last character is a quote;
    // if it is, chop off the 1st and last character of the string.
    if (substr($items[$i],-1) == '"'){
    $items[$i] = substr($items[$i],1,strlen($items[$i])-2);
    }
    // now any remaining doubled double quotes should be converted to one doublequote
    $items[$i] = str_replace('""','"',$items[$i]);
    if ($replace_quotes){
    $items[$i] = str_replace('"',"&#34",$items[$i]);
    $items[$i] = str_replace("'","&#39",$items[$i]);
    }
    $items[$i] = ( addslashes ( $items[$i] ) );
    }
    }

    Please be aware that I am very much a newbie at php, but the above appears to have solved the problem for me.

Similar Threads

  1. easypopulate problem
    By mcilpuf in forum osCmax v2 Installation issues
    Replies: 0
    Last Post: 09-23-2006, 04:20 PM
  2. EasyPopulate - suddenly having upload problem - See Error
    By xpressed in forum osCmax v1.7 Discussion
    Replies: 4
    Last Post: 07-09-2004, 05:56 AM
  3. EasyPopulate 2.72 attributes not correct?
    By Kristine in forum osCMax v1.7 General Mods Discussion
    Replies: 1
    Last Post: 05-10-2004, 12:27 PM
  4. easypopulate froogle generation problem
    By BKnapik in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 01-27-2004, 07:00 AM
  5. Adding product attributes with easypopulate
    By mcg1103 in forum osCommerce 2.2 Modification Help
    Replies: 2
    Last Post: 08-20-2003, 10:00 AM

Bookmarks

Posting Permissions

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