CatDadRick
-
Posts
253 -
Joined
-
Last visited
Posts posted by CatDadRick
-
-
I posted this to the general support forum several months ago but didn't much response, so I'm reposting here. Since my problem is with EasyPopulate this is the better forum to post in...
I'm trying to get the Date Available (date_avail) and Date Added (date_added) fields to keep the data in the existing table. When I add a product I set the date added and date available in the EP upload file and then upload the file to my catalog. Then when I upload updates to the catalog, the original date
Please ignore my previous post.
Thanks,
Rick Knight
-
I posted this to the general support forum several months ago but didn't much response, so I'm reposting here. Since my problem is with EasyPopulate this is the better forum to post in...
I'm trying to get the Date Available (date_avail) and Date Added (date_added) fields to keep the data in the existing table. When I add a product I set the date added and date available in the EP upload file and then upload the file to my catalog. Then when I upload updates to the catalog, the original date added and date available are over-written with the current date. I want EP to ignore the current date and use the dates already in the catalog and only use the current date when I'm adding a new item or when the catalog item doesn't have a date in the date added or date available fields.
I've added...
$default_these[] = 'v_date_avail'; $default_these[] = 'v_date_added';
to the Defaulted items code...
// these are the fields that will be defaulted to the current values in // the database if they are not found in the incoming file $default_these = array(); foreach ($languages as $key => $lang){ $default_these[] = 'v_products_name_' . $lang['id']; $default_these[] = 'v_products_description_' . $lang['id']; $default_these[] = 'v_products_url_' . $lang['id']; if (EP_HTC_SUPPORT == true) { $default_these[] = 'v_products_head_title_tag_' . $lang['id']; $default_these[] = 'v_products_head_desc_tag_' . $lang['id']; $default_these[] = 'v_products_head_keywords_tag_' . $lang['id']; } } $default_these[] = 'v_products_image'; if (EP_MORE_PICS_6_SUPPORT == true) { $default_these[] = 'v_products_subimage1'; $default_these[] = 'v_products_subimage2'; $default_these[] = 'v_products_subimage3'; $default_these[] = 'v_products_subimage4'; $default_these[] = 'v_products_subimage5'; $default_these[] = 'v_products_subimage6'; } if (EP_UNKNOWN_ADD_IMAGES_SUPPORT == true) { $default_these[] = 'v_products_mimage'; $default_these[] = 'v_products_bimage'; $default_these[] = 'v_products_subimage1'; $default_these[] = 'v_products_bsubimage1'; $default_these[] = 'v_products_subimage2'; $default_these[] = 'v_products_bsubimage2'; $default_these[] = 'v_products_subimage3'; $default_these[] = 'v_products_bsubimage3'; } $default_these[] = 'v_categories_id'; $default_these[] = 'v_products_price'; $default_these[] = 'v_products_quantity'; $default_these[] = 'v_products_weight'; $default_these[] = 'v_status_current'; $default_these[] = 'v_date_avail'; $default_these[] = 'v_date_added'; $default_these[] = 'v_tax_class_title'; $default_these[] = 'v_manufacturers_name'; $default_these[] = 'v_manufacturers_id'; // Additional fields $default_these[] = 'v_products_price_list'; $default_these[] = 'v_vendors_product_price'; $default_these[] = 'v_vendors_id'; $default_these[] = 'v_vendors_prod_comments'; $default_these[] = 'v_vendors_prod_id'; $default_these[] = 'v_products_ship_price'; $default_these[] = 'v_products_discount1'; $default_these[] = 'v_products_discount2'; $default_these[] = 'v_products_discount3'; $default_these[] = 'v_products_discount1_qty'; $default_these[] = 'v_products_discount2_qty'; $default_these[] = 'v_products_discount3_qty'; $default_these[] = 'v_products_discount_percentage'; // End Added fields
But this doesn't seem to work. What else do I need to do to get the date_added and date_avail to keep the original values?
Thanks,
Rick Knight
-
This code:
$rx = $image_size[1] / $width; $ry = $image_size[1] / $height;
Should be:
$rx = $image_size[0] / $width; $ry = $image_size[1] / $height;
Can't say for sure if that will help at all.
Graham,
I tried the above change. Didn't make any difference. Any other idesa? Anyone?
Thanks,
Rick
-
This code:
$rx = $image_size[1] / $width; $ry = $image_size[1] / $height;
Should be:
$rx = $image_size[0] / $width; $ry = $image_size[1] / $height;
Can't say for sure if that will help at all.
Thanks Germ,
I've made this change. I'll see if it works.
Rick Knight
-
I installed this contribution several months ago and all seemed OK, but yesterday while trying to debug a "division by zero" warning,
I thought I had solved the "division by zero" warnings but I was wrong, I'm still getting them...
[Tue Nov 18 15:56:24 2008] [error] [client 172.16.88.5] PHP Warning: Division by zero in /var/www/catalog_live/includes/functions/html_output.php on line 181, referer: http://catdads.rlknight.com/index.php?cPath=12_34 [Tue Nov 18 15:56:24 2008] [error] [client 172.16.88.5] PHP Warning: Division by zero in /var/www/catalog_live/includes/functions/html_output.php on line 182, referer: http://catdads.rlknight.com/index.php?cPath=12_34
Here's the tep_image function from my html_output.php...
// Scales product images dynamically, resulting in smaller file sizes, and keeps // proper image ratio. Used in conjunction with product_thumb.php t/n generator. function tep_image($src, $alt = '', $width = '', $height = '', $params = '') { // if no file exists display the 'no image' file if (!is_file($src)) { $src = "images/no_image.jpg"; } // Set default image variable and code $image = '<img src="' . $src . '"'; // Don't calculate if the image is set to a "%" width if (strstr($width,'%') == false || strstr($height,'%') == false) { $dont_calculate = 0; } else { $dont_calculate = 1; } // Dont calculate if a pixel image is being passed (hope you dont have pixels for sale) if (!strstr($image, 'pixel')) { $dont_calculate = 0; } else { $dont_calculate = 1; } // Do we calculate the image size? if (CONFIG_CALCULATE_IMAGE_SIZE && !$dont_calculate) { // Get the image's information if ($image_size = @getimagesize($src)) { $ratio = $image_size[1] / $image_size[0]; // Set the width and height to the proper ratio if (!$width && $height) { $ratio = $height / $image_size[1]; $width = intval($image_size[0] * $ratio); } elseif ($width && !$height) { $ratio = $width / $image_size[0]; $height = intval($image_size[1] * $ratio); } elseif (!$width && !$height) { $width = $image_size[0]; $height = $image_size[1]; } // Scale the image if not the original size if ($image_size[0] != $width || $image_size[1] != $height) { // echo 'variable1:'.$width; // echo 'variable1:'.$height; //echo 'height:'.$height.' width:'.$width.' for image:'.$src.'<br>'; $rx = $image_size[1] / $width; $ry = $image_size[1] / $height; if ($rx < $ry) { $width = intval($height / $ratio); } else { $height = intval($width * $ratio); } $image = '<img src="product_thumb.php?img=' . $src . '&w=' . tep_output_string($width) . '&h=' . tep_output_string($height) . '"'; } } elseif (IMAGE_REQUIRED == 'false') { return ''; } } // Add remaining image parameters if they exist if ($width) { $image .= ' width="' . tep_output_string($width) . '"'; } if ($height) { $image .= ' height="' . tep_output_string($height) . '"'; } if (tep_not_null($params)) $image .= ' ' . $params; $image .= ' border="0" alt="' . tep_output_string($alt) . '"'; if (tep_not_null($alt)) { $image .= ' title="' . tep_output_string($alt) . '"'; } $image .= '>'; return $image; } // End Replace
I was getting the warning on the page every time I loaded the CATALOG page, but I had modified my shop to show a text message for out of stock items hadn't changed my "shoppe_enhancements_controller.php" file to reflect the modification. I corrected that and got rid of the on page warning message but I'm still getting the warning in my log file and I can't tell where it's coming from. I added code to show the $height and $width variables and the image name, but that didn't show any zero size images.
Any idea what's causing this?
Thanks,
Rick
-
I thought I had solved the division by zero warnings, but I was wrong. I am still getting the warning in my logs. I've enabled this bit of added code to spot the zero size variable, but it does not show any height or width of zero. Everything looks OK, but I still get the warning.
echo 'height:'.$height.' width:'.$width.' for image:'.$src.'<br>';
Any ideas, anyone?
Thanks,
Rick
-
I installed this contribution several months ago and all seemed OK, but yesterday while trying to debug a "division by zero" warning, I came accross these other PHP Warnings in my error_log that I think are du to this contribution...
[Tue Nov 18 10:03:12 2008] [error] [client 172.16.88.5] PHP Warning: imagecreate() [<a href='function.imagecreate'>function.imagecreate</a>]: Invalid image dimensions in /var/www/catalog_live/product_thumb.php on line 310, referer: http://catdads.rlknight.com/product_info.php?products_id=86 [Tue Nov 18 10:03:12 2008] [error] [client 172.16.88.5] PHP Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /var/www/catalog_live/product_thumb.php on line 313, referer: http://catdads.rlknight.com/product_info.php?products_id=86 [Tue Nov 18 10:03:12 2008] [error] [client 172.16.88.5] PHP Warning: imagefill(): supplied argument is not a valid Image resource in /var/www/catalog_live/product_thumb.php on line 315, referer: http://catdads.rlknight.com/product_info.php?products_id=86 [Tue Nov 18 10:03:12 2008] [error] [client 172.16.88.5] PHP Warning: imagecolortransparent(): supplied argument is not a valid Image resource in /var/www/catalog_live/product_thumb.php on line 316, referer: http://catdads.rlknight.com/product_info.php?products_id=86 [Tue Nov 18 10:03:12 2008] [error] [client 172.16.88.5] PHP Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /var/www/catalog_live/product_thumb.php on line 350, referer: http://catdads.rlknight.com/product_info.php?products_id=86 [Tue Nov 18 10:03:12 2008] [error] [client 172.16.88.5] PHP Warning: imagegif(): supplied argument is not a valid Image resource in /var/www/catalog_live/product_thumb.php on line 377, referer: http://catdads.rlknight.com/product_info.php?products_id=86 [Tue Nov 18 10:03:12 2008] [error] [client 172.16.88.5] PHP Warning: imagecreate() [<a href='function.imagecreate'>function.imagecreate</a>]: Invalid image dimensions in /var/www/catalog_live/product_thumb.php on line 310, referer: http://catdads.rlknight.com/product_info.php?products_id=86 [Tue Nov 18 10:03:12 2008] [error] [client 172.16.88.5] PHP Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /var/www/catalog_live/product_thumb.php on line 313, referer: http://catdads.rlknight.com/product_info.php?products_id=86 [Tue Nov 18 10:03:12 2008] [error] [client 172.16.88.5] PHP Warning: imagefill(): supplied argument is not a valid Image resource in /var/www/catalog_live/product_thumb.php on line 315, referer: http://catdads.rlknight.com/product_info.php?products_id=86 [Tue Nov 18 10:03:12 2008] [error] [client 172.16.88.5] PHP Warning: imagecolortransparent(): supplied argument is not a valid Image resource in /var/www/catalog_live/product_thumb.php on line 316, referer: http://catdads.rlknight.com/product_info.php?products_id=86 [Tue Nov 18 10:03:12 2008] [error] [client 172.16.88.5] PHP Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /var/www/catalog_live/product_thumb.php on line 350, referer: http://catdads.rlknight.com/product_info.php?products_id=86 [Tue Nov 18 10:03:12 2008] [error] [client 172.16.88.5] PHP Warning: imagegif(): supplied argument is not a valid Image resource in /var/www/catalog_live/product_thumb.php on line 377, referer: http://catdads.rlknight.com/product_info.php?products_id=86
Am I correct in assuming that these warning are being generated by this contribution? Can someone tell me how to trouble shoot them, or how to fix the problem?
Thanks,
Rick
-
Looks like a code snippet from function tep_image
Please post all of the code for that one function only, please.
Germ, thanks for the reply. Yes, that was a snippet from function tep_image. Full function below. I was able to fix the "division by zero" warning. I had replaced the Out of Stock image with an out of stock message but didn't change my shoppe_enhancements_controller.php to reflect the change. I am still seeing the other warnings in my log files though.
Here are the PHP Warnings again,
[Fri Nov 14 16:16:11 2008] [error] [client 65.55.108.172] PHP Warning: imagecreate() [<a href='function.imagecreate'>function.imagecreate</a>]: Invalid image dimensions in catalog/product_thumb.php on line 310 [Fri Nov 14 16:16:11 2008] [error] [client 65.55.108.172] PHP Warning: imagecolorallocate(): supplied argument is not a valid Image resource in catalog/product_thumb.php on line 313 [Fri Nov 14 16:16:11 2008] [error] [client 65.55.108.172] PHP Warning: imagefill(): supplied argument is not a valid Image resource in catalog/product_thumb.php on line 315 [Fri Nov 14 16:16:11 2008] [error] [client 65.55.108.172] PHP Warning: imagecolortransparent(): supplied argument is not a valid Image resource in catalog/product_thumb.php on line 316 [Fri Nov 14 16:16:11 2008] [error] [client 65.55.108.172] PHP Warning: imagecopyresampled(): supplied argument is not a valid Image resource in catalog/product_thumb.php on line 350 [Fri Nov 14 16:16:11 2008] [error] [client 65.55.108.172] PHP Warning: imagegif(): supplied argument is not a valid Image resource in catalog/product_thumb.php on line 377
Here's function tep_image in full,
function tep_image($src, $alt = '', $width = '', $height = '', $params = '') { // if no file exists display the 'no image' file if (!is_file($src)) { $src = "images/no_image.jpg"; } // Set default image variable and code $image = '<img src="' . $src . '"'; // Don't calculate if the image is set to a "%" width if (strstr($width,'%') == false || strstr($height,'%') == false) { $dont_calculate = 0; } else { $dont_calculate = 1; } // Dont calculate if a pixel image is being passed (hope you dont have pixels for sale) if (!strstr($image, 'pixel')) { $dont_calculate = 0; } else { $dont_calculate = 1; } // Do we calculate the image size? if (CONFIG_CALCULATE_IMAGE_SIZE && !$dont_calculate) { // Get the image's information if ($image_size = @getimagesize($src)) { $ratio = $image_size[1] / $image_size[0]; // Set the width and height to the proper ratio if (!$width && $height) { $ratio = $height / $image_size[1]; $width = intval($image_size[0] * $ratio); } elseif ($width && !$height) { $ratio = $width / $image_size[0]; $height = intval($image_size[1] * $ratio); } elseif (!$width && !$height) { $width = $image_size[0]; $height = $image_size[1]; } // Scale the image if not the original size if ($image_size[0] != $width || $image_size[1] != $height) { // echo 'variable1:'.$width; // echo 'variable1:'.$height; //echo 'height:'.$height.' width:'.$width.' for image:'.$src.'<br>'; /* Added to troubleshoot "Division by zero" */ $rx = $image_size[1] / $width; $ry = $image_size[1] / $height; if ($rx < $ry) { $width = intval($height / $ratio); } else { $height = intval($width * $ratio); } $image = '<img src="product_thumb.php?img=' . $src . '&w=' . tep_output_string($width) . '&h=' . tep_output_string($height) . '"'; } } elseif (IMAGE_REQUIRED == 'false') { return ''; } } // Add remaining image parameters if they exist if ($width) { $image .= ' width="' . tep_output_string($width) . '"'; } if ($height) { $image .= ' height="' . tep_output_string($height) . '"'; } if (tep_not_null($params)) $image .= ' ' . $params; $image .= ' border="0" alt="' . tep_output_string($alt) . '"'; if (tep_not_null($alt)) { $image .= ' title="' . tep_output_string($alt) . '"'; } $image .= '>'; return $image; }
Any idea where these warnings are coming from and how to fix them?
Thanks Rick
-
I am getting a "division by zero" PHP Warning in my log files along with another PHP Warning. The Divide by zero warning seems to happen in pairs as below...
[Thu Nov 13 18:47:24 2008] [error] [client 172.16.88.25] PHP Warning: Division by zero in catalog/includes/functions/html_output.php on line 180, referer: [url="http://catdads.rlknight.com/index.php?cPath=3_85"]http://catdads.rlknight.com/index.php?cPath=3_85[/url] [Thu Nov 13 18:47:24 2008] [error] [client 172.16.88.25] PHP Warning: Division by zero in catalog/includes/functions/html_output.php on line 181, referer: [url="http://catdads.rlknight.com/index.php?cPath=3_85"]http://catdads.rlknight.com/index.php?cPath=3_85[/url] [Thu Nov 13 18:47:24 2008] [error] [client 172.16.88.25] PHP Warning: Division by zero in catalog/includes/functions/html_output.php on line 180, referer: [url="http://catdads.rlknight.com/index.php?cPath=3_85"]http://catdads.rlknight.com/index.php?cPath=3_85[/url] [Thu Nov 13 18:47:24 2008] [error] [client 172.16.88.25] PHP Warning: Division by zero in catalog/includes/functions/html_output.php on line 181, referer: [url="http://catdads.rlknight.com/index.php?cPath=3_85"]http://catdads.rlknight.com/index.php?cPath=3_85[/url]
The other PHP Warning is this...
[Fri Nov 14 16:16:11 2008] [error] [client 65.55.108.172] PHP Warning: imagecreate() [<a href='function.im agecreate'>function.imagecreate</a>]: Invalid image dimensions in catalog/product_thumb.php on line 310 [Fri Nov 14 16:16:11 2008] [error] [client 65.55.108.172] PHP Warning: imagecolorallocate(): supplied argument is not a valid Image resource in catalog/product_thumb.php on line 313 [Fri Nov 14 16:16:11 2008] [error] [client 65.55.108.172] PHP Warning: imagefill(): supplied argument is not a valid Image resource in catalog/product_thumb.php on line 315 [Fri Nov 14 16:16:11 2008] [error] [client 65.55.108.172] PHP Warning: imagecolortransparent(): supplied argument is not a valid Image resource in catalog/product_thumb.php on line 316 [Fri Nov 14 16:16:11 2008] [error] [client 65.55.108.172] PHP Warning: imagecopyresampled(): supplied argument is not a valid Image resource in catalog/product_thumb.php on line 350 [Fri Nov 14 16:16:11 2008] [error] [client 65.55.108.172] PHP Warning: imagegif(): supplied argument is not a valid Image resource in catalog/product_thumb.php on line 377
Here's the code in catalog/includes/functions/html_output.php that seems to be causing the first warning...
// Scale the image if not the original size if ($image_size[0] != $width || $image_size[1] != $height) { // echo 'variable1:'.$width; // echo 'variable1:'.$height; $rx = $image_size[1] / $width; $ry = $image_size[1] / $height; if ($rx < $ry) { $width = intval($height / $ratio); } else { $height = intval($width * $ratio); } $image = '<img src="product_thumb.php?img=' . $src . '&w=' . tep_output_string($width) . '&h=' . tep_output_string($height) . '"'; }
Can someone tell me how to get rid of these warnings? I have error_reporting turned off in php.ini so the warnings don't show up on my pages, but my log files are getting pretty full.
Thanks,
Rick Knight
-
but if we were to add the feature to keep the old date in this circumstance, this would be the change.
change this...
foreach( $filelayout as $key => $value ){ $key = $items[ $value ]; }
to...
foreach( $filelayout as $key => $value ){ if (!($key == 'v_date_added' && empty($items[ $value ]))) { $key = $items[ $value ]; } }
Surfalot,
This did the trick. Also, I assume that I can do the same with other fields by just adding "if" statements?
Thanks again,
Rick Knight
-
So under assumed normal operation, I'd say the code is doing what it is suppose to do.
but if we were to add the feature to keep the old date in this circumstance, this would be the change.
change this...
foreach( $filelayout as $key => $value ){ $key = $items[ $value ]; }
to...
foreach( $filelayout as $key => $value ){ if (!($key == 'v_date_added' && empty($items[ $value ]))) { $key = $items[ $value ]; } }
Surfalot,
Thanks, I have a bunch of updates ready to upload so I'll add that today and give it a try.
Thanks,
Rick Knight
-
curious that. all date related issues should have been fixed in v2.76e r1. Try version 2.76g. Works for me. Dates are not updated when the columns are excluded from the import.
Thanks for the reply Surfalot,
I'm using 2.76f-MS2-r1, I'll try 2.76g.
Dates are not updated when the columns are excluded from the import.What behaviour should I get when the column is included but empty? That seems to be where I'm having problems.
Thanks again,
Rick Knight
-
I'm trying to get the Date Available (date_avail) and Date Added (date_added) fields to keep the data in the existing table. When I add a product I set the date added and date available in the EP upload file and then upload the file to my catalog. Then when I upload updates to the catalog, the original date added and date available are over-written with the current date. I want EP to ignore the current date and use the dates already in the catalog and only use the current date when I'm adding a new item or when the catalog item doesn't have a date in the date added or date available fields.
I've added...
$default_these[] = 'v_date_avail'; $default_these[] = 'v_date_added';
to the Defaulted items code...
// these are the fields that will be defaulted to the current values in // the database if they are not found in the incoming file $default_these = array(); foreach ($languages as $key => $lang){ $default_these[] = 'v_products_name_' . $lang['id']; $default_these[] = 'v_products_description_' . $lang['id']; $default_these[] = 'v_products_url_' . $lang['id']; if (EP_HTC_SUPPORT == true) { $default_these[] = 'v_products_head_title_tag_' . $lang['id']; $default_these[] = 'v_products_head_desc_tag_' . $lang['id']; $default_these[] = 'v_products_head_keywords_tag_' . $lang['id']; } } $default_these[] = 'v_products_image'; if (EP_MORE_PICS_6_SUPPORT == true) { $default_these[] = 'v_products_subimage1'; $default_these[] = 'v_products_subimage2'; $default_these[] = 'v_products_subimage3'; $default_these[] = 'v_products_subimage4'; $default_these[] = 'v_products_subimage5'; $default_these[] = 'v_products_subimage6'; } if (EP_UNKNOWN_ADD_IMAGES_SUPPORT == true) { $default_these[] = 'v_products_mimage'; $default_these[] = 'v_products_bimage'; $default_these[] = 'v_products_subimage1'; $default_these[] = 'v_products_bsubimage1'; $default_these[] = 'v_products_subimage2'; $default_these[] = 'v_products_bsubimage2'; $default_these[] = 'v_products_subimage3'; $default_these[] = 'v_products_bsubimage3'; } $default_these[] = 'v_categories_id'; $default_these[] = 'v_products_price'; $default_these[] = 'v_products_quantity'; $default_these[] = 'v_products_weight'; $default_these[] = 'v_status_current'; $default_these[] = 'v_date_avail'; $default_these[] = 'v_date_added'; $default_these[] = 'v_tax_class_title'; $default_these[] = 'v_manufacturers_name'; $default_these[] = 'v_manufacturers_id'; // Additional fields $default_these[] = 'v_products_price_list'; $default_these[] = 'v_vendors_product_price'; $default_these[] = 'v_vendors_id'; $default_these[] = 'v_vendors_prod_comments'; $default_these[] = 'v_vendors_prod_id'; $default_these[] = 'v_products_ship_price'; $default_these[] = 'v_products_discount1'; $default_these[] = 'v_products_discount2'; $default_these[] = 'v_products_discount3'; $default_these[] = 'v_products_discount1_qty'; $default_these[] = 'v_products_discount2_qty'; $default_these[] = 'v_products_discount3_qty'; $default_these[] = 'v_products_discount_percentage'; // End Added fields
But this doesn't seem to work. What else do I need to do to get the date_added and date_avail to keep the original values?
Thanks,
Rick Knight
P.S Sorry for the double post, I originally posted posted to the general thread.
-
"if they are not found in the incoming file" is the key bit in the snippet above
Have you tried dropping those 2 columns?
Or you could remove the fields from the update statement.
Other fields in the "defaulted fields" list seem to work a little differently. If, for example, I leave the status or quantity fields empty in the incoming file the data that is already in the catalog database will be left untouched. If I leave the date added and date available fields empty in the incoming file, the date added and date available fields are updated with the current date for date available and the date the incoming file was saved for the date added field.
I can't delete the date columns or modify the update statement because sometimes the incoming file has both new items and existing items that are being updated.
So, is there a way to get the date fields to behave like the other defaulted fields?
Thanks again,
Rick Knight
-
I'm trying to get the Date Available (date_avail) and Date Added (date_added) fields to keep the data in the existing table. When I add a product I set the date added and date available in the EP upload file and then upload the file to my catalog. Then when I upload updates to the catalog, the original date added and date available are over-written with the current date. I want EP to ignore the current date and use the dates already in the catalog and only use the current date when I'm adding a new item or when the catalog item doesn't have a date in the date added or date available fields.
I've added...
$default_these[] = 'v_date_avail'; $default_these[] = 'v_date_added';
to the Defaulted items code...
// these are the fields that will be defaulted to the current values in // the database if they are not found in the incoming file $default_these = array(); foreach ($languages as $key => $lang){ $default_these[] = 'v_products_name_' . $lang['id']; $default_these[] = 'v_products_description_' . $lang['id']; $default_these[] = 'v_products_url_' . $lang['id']; if (EP_HTC_SUPPORT == true) { $default_these[] = 'v_products_head_title_tag_' . $lang['id']; $default_these[] = 'v_products_head_desc_tag_' . $lang['id']; $default_these[] = 'v_products_head_keywords_tag_' . $lang['id']; } } $default_these[] = 'v_products_image'; if (EP_MORE_PICS_6_SUPPORT == true) { $default_these[] = 'v_products_subimage1'; $default_these[] = 'v_products_subimage2'; $default_these[] = 'v_products_subimage3'; $default_these[] = 'v_products_subimage4'; $default_these[] = 'v_products_subimage5'; $default_these[] = 'v_products_subimage6'; } if (EP_UNKNOWN_ADD_IMAGES_SUPPORT == true) { $default_these[] = 'v_products_mimage'; $default_these[] = 'v_products_bimage'; $default_these[] = 'v_products_subimage1'; $default_these[] = 'v_products_bsubimage1'; $default_these[] = 'v_products_subimage2'; $default_these[] = 'v_products_bsubimage2'; $default_these[] = 'v_products_subimage3'; $default_these[] = 'v_products_bsubimage3'; } $default_these[] = 'v_categories_id'; $default_these[] = 'v_products_price'; $default_these[] = 'v_products_quantity'; $default_these[] = 'v_products_weight'; $default_these[] = 'v_status_current'; $default_these[] = 'v_date_avail'; $default_these[] = 'v_date_added'; $default_these[] = 'v_tax_class_title'; $default_these[] = 'v_manufacturers_name'; $default_these[] = 'v_manufacturers_id'; // Additional fields $default_these[] = 'v_products_price_list'; $default_these[] = 'v_vendors_product_price'; $default_these[] = 'v_vendors_id'; $default_these[] = 'v_vendors_prod_comments'; $default_these[] = 'v_vendors_prod_id'; $default_these[] = 'v_products_ship_price'; $default_these[] = 'v_products_discount1'; $default_these[] = 'v_products_discount2'; $default_these[] = 'v_products_discount3'; $default_these[] = 'v_products_discount1_qty'; $default_these[] = 'v_products_discount2_qty'; $default_these[] = 'v_products_discount3_qty'; $default_these[] = 'v_products_discount_percentage'; // End Added fields
But this doesn't seem to work. What else do I need to do to get the date_added and date_avail to keep the original values?
Thanks,
Rick Knight
-
Rick,
I'm not sure which version of the install instructions you're using and to be totally honest I've lost track of the changes on the board but this is from post #282
EDIT includes/functions/general.php
FIND
$message->add_string_attachment($string, $filename);
and REPLACE with
$message->add_string_attachment($string, $filename, 'application/pdf');
This will force the mime type for the message and explicitly tell the client the base64 code is a pdf; Thunderbird works this out for itself from the .pdf extension, at least on my box.
I'm working right now on some up to date install instructions incorporating all the fixes from the board. Weird thing is, the original version still works on my set up!
HTH
Chris
Chris,
Thanks, that did it. I went back and read Pipeloops subsequent posts saw where he had an issue with Send HTML Email set True. So did I, so I after changing the code above I sent HTML Emails to False and now everything is happy again. Funny, I had read that post at the time it was posted but didn't think much of it then. I guess I need to keep up with things a bit more.
Thanks again,
Rick
-
Chris,
OK, I've added the changes to includes/functions/general.php and now the sale is completed and the customer is redirected to the checkout_success page and the order confirmation emails are sent. Problem now is, the customer's email is blank. I can see that an attachment is there, but 3 email clients can't open it. In Evolution, the mail message contains the base64 encoded message, but there is no readable information.
Any Ideas?
Thanks again,
Rick
-
Hi Rick,
If the only thing failing now is the attachment email, please have a quick look over the changes you made to the mail function in includes/general.php and the change in includes/classes/email.php.
Chris,
Seems I missed step 7, the modifications to general.php, too much staring at code I think :blink:. Now that I've added the function I'm sure it'll work.
Thanks,
Rick
-
@CatDadRick
@cornishpirate
You guys seem to be having the same problem so I'll get you both to try the following. The code below is lifted from my copy of checkout_process.php )which is working on 2 test and 2 live servers)
EDIT checkout_process.php
REPLACE your code block,
// BEGIN added for pdfinvoice email attachment: blah ..... // END added for pdfinvoice email attachment:
with
// BEGIN added for pdfinvoice email attachment: if (PDF_INVOICE_EMAIL_ATTACHMENT == 'true') { // customers will be logged in so usual security checks of pdfinvoice.php will be met. All we do is set the order_id for pdfinvoice.php to pick up $HTTP_GET_VARS['order_id'] = $insert_id; // set stream mode $stream = true; // include pdfinvoice.php include_once(FILENAME_CUSTOMER_PDF); // add text to email informing customer a pdf invoice copy has been attached: $email_order .= PDF_INVOICE_ATTACHED ."\n\n"; // send email with pdf invoice attached. Check to make sure pdfinvoice.php returns some data, else send standard email // note $order object reinstantiated by inclusion of pdfinvoice.php hence customer['name'] if (tep_not_null($pdf_data)) { tep_mail_string_attachment($order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $pdf_data, $file_name); } else { tep_mail($order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } } else { // send vanilla e-mail - if email attachment option is false tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } // END added for pdfinvoice email attachment:
If this is still bombing when you try, add before
// set stream mode
echo $HTTP_GET_VARS['order_id']; die();
and let me know what value for order_id is output (if any). Then remove this code. The only reason I can see for you getting bounced back to account_history.php is if pdfinvoice.php doesn't get passed an order id (or if a customer is not logged in which can't be the case during checkout!)
HTH
Chris
Cornishpirate, did this work for you?
Thanks,
Rick
-
@CatDadRick
@cornishpirate
You guys seem to be having the same problem so I'll get you both to try the following. The code below is lifted from my copy of checkout_process.php )which is working on 2 test and 2 live servers)
and let me know what value for order_id is output (if any). Then remove this code. The only reason I can see for you getting bounced back to account_history.php is if pdfinvoice.php doesn't get passed an order id (or if a customer is not logged in which can't be the case during checkout!)
HTH
Chris
Chris,
This is almost working. After applying the new code and enabling PDF Invoice Email, the order is completed and the customer is redirected to the order_success page and the store owner email is sent, however, the customer confirmation is not sent. Even after several minutes. Any other ideas?
Thanks,
Rick
-
Rick,
Have a look at post #292 here. I strongly suspect my botched code is causing your issue.
HTH
Chris
Chris,
I made the modification shown in post 292, but that didn't change things much. Yesterday when I added the contribution I think (underline think) the test sales redirected the customer to account_history regardless of whether Attach PDF Invoice was set True or False. After the change to include_once, the customer is redirected to account_history only if Attach PDF Invoice is set True in admin. I Think. I didn't test it as much as I could have because I discovered the problem on my live store and wanted to correct things quickly. More testing on my test store confirmed the problem. With Attach PDF Invoice set True the customer is redirected to account_history, no emails are sent to customer or store owner. With Attach PDF set False everything works normally and emails are sent to customer and store owner.
Thanks,
Rick
-
Chris,
I installed the PDF Packing Slip contrib today and it works beautifully. I also installed the PDF Invoice Email contribution. That didn't go as well. After installing the contrib I ran a test sale and instead of the sale completing and the customer getting the confirmation email, the customer is redirected to the customer_history page. The order confirmation email is not sent to store owner or customer, but the order does show up in the customer_history page as pending and it shows up in admin/orders, also as pending. Also, the customers session is not closed out as it would be with a completed order. I probably put the code in checkout_process.php in the wrong place, I have a very heavily modified store and adding new contributions sometimes get a bit tricky. Any idea what I may have done wrong?
Thanks again,
Rick
Quick correction to the above. The customer is redirected to the account_history page.
Rick
-
Chris,
I installed the PDF Packing Slip contrib today and it works beautifully. I also installed the PDF Invoice Email contribution. That didn't go as well. After installing the contrib I ran a test sale and instead of the sale completing and the customer getting the confirmation email, the customer is redirected to the customer_history page. The order confirmation email is not sent to store owner or customer, but the order does show up in the customer_history page as pending and it shows up in admin/orders, also as pending. Also, the customers session is not closed out as it would be with a completed order. I probably put the code in checkout_process.php in the wrong place, I have a very heavily modified store and adding new contributions sometimes get a bit tricky. Any idea what I may have done wrong?
Thanks again,
Rick
-
Chris,
I just finished installing PDF Packing Slip. Another GREAT contribution. PDF Invoice and PDF Packing Slip together give the store a cohesive, professional look.
I do have one comment, and one question.
The comment. In the instruction for modifying catalog/admin/orders.php
<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_PDF_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip_pdf.gif', IMAGE_ORDERS_PDF_PACKINGSLIP) . '</a>
and
<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $_GET['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_PDF_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip_pdf.gif', IMAGE_ORDERS_PDF_PACKINGSLIP) . '</a>
The last part of each line has
tep_image_button('button_packingslip_pdf.gif', IMAGE_ORDERS_PDF_PACKINGSLIP)
.
That should read
tep_image_button('button_pdfpackingslip.gif', IMAGE_ORDERS_PDF_PACKINGSLIP)
That matches the actual button name, button_pdfpackingslip.gif.
Question. Where dose the top line above put the button?
Again, great contribution.
Thanks,
Rick
Easy Populate & Products Attributes
in General Add-Ons Support
Posted
They say that's the first thing to go...
Anyway, I did some price and quantity updates yesterday and the dates changed on me. I thought we had fixed this but when I searched, I found a post to the general forum I had made before posting to this forum. Then I opened my easypopulate.php and found the change we'd made and, well... what can I say. I tried to delete the new post but couldn't so my Ooops was the best I could think of. I still don't know why the dates changed, maybe another lapse of memory, but it's working today.
Sorry for the memory lapse, and thanks for a great contrib and excellent support of it.
Thanks,
Rick