Originally Posted by
PatF
Fatal error: Call to undefined function: fputcsv() in xxxxxxxxxxxxxx\(my root folder)\( my admin folder )\easypopulate.php on line 1124
Any ideas ???
Unfortunately, I do have some ideas, but nothing that will help. Something I should have stated in my first post to this thread. I mentioned it in the other forum...
1.2.5.5.CSV will ONLY work with PHP > v5.1
fgetcsv existed in PHPv4, but fputcsv was only added in v5.1
There are custom fputcsv functions that could be put at the begining of the file that would make it work with PHP4.
I just did a quick google search and found this:
PHP Code:
if (!function_exists('fputcsv')) {
function fputcsv(&$handle, $fields = array(), $delimiter = ',', $enclosure = '"') {
$str = '';
$escape_char = '\\';
foreach ($fields as $value) {
settype($value, 'string');
if (strpos($value, $delimiter) !== false ||
strpos($value, $enclosure) !== false ||
strpos($value, "\n") !== false ||
strpos($value, "\r") !== false ||
strpos($value, " ") !== false ||
strpos($value, ' ') !== false) {
$str2 = $enclosure;
$escaped = 0;
$len = strlen($value);
for ($i=0;$i<$len;$i++) {
if ($value[$i] == $escape_char) {
$escaped = 1;
} else if (!$escaped && $value[$i] == $enclosure) {
$str2 .= $enclosure;
} else {
$escaped = 0;
}
$str2 .= $value[$i];
}
$str2 .= $enclosure;
$str .= $str2.$delimiter;
} else {
$str .= $value.$delimiter;
}
}
$str = substr($str,0,-1);
$str .= "\n";
return fwrite($handle, $str);
}
}
I don't know if it works, but I hope it does
Originally Posted by
chadderuski
phazei,
Concerning Product Attribute: This feature does not work in 1.2.5.4. Langer fixed it and then marketed it as EP Advanced (along with a number of other features) for a cost. Personally, I've often found it easier to code a solution from scratch then to try and fix bad code.
Quantity Discounts: This does use it's own table. It's really quite simple although a bit of research needs to be done to identify each type of discount. Best to create a discount, then down load it to see how it's encoded. The code I uploaded handles all this.
-cj
Since most of the code for the attributes options is there it probably wouldn't be that hard to make it work.
I thought there was a column added to the db to get quantity discounts to work in that other version. I didn't want to add anything that would require someone to have to modify the db in any way. I wanted it to be as plug and play as possible.
Bookmarks