V2.6.1产品批量上传后,无法形成图片相册

2016-07-07 15:49 来源:www.chinab4c.com 作者:ecshop专家

V2.6.1产品批量上传后,无法形成图片相册,之前V2.6.0的可以(是重新安装V2.6.1),CSV文件无错,请高手指点如何解决?

回答:
历史问题 哈哈

好帖子看过是要大家来回复的楼主加油








王牌进化 机动风暴

商品图片地址路径和商品相册中的图片路径不一样,
如何解决?

EC目录-》admin-》goods_batch.php文件
查找:
  1. /* 插入商品相册:如果图片不为空
  2. if (!empty($field_arr['original_img']) || !empty($field_arr['goods_img']) || !empty($field_arr['goods_thumb']))
  3. {
  4. $goods_gallery = array();
  5. $goods_gallery['goods_id'] = $db->insert_id();
  6. if (!empty($field_arr['original_img']))
  7. {
  8. $ext = substr($field_arr['original_img'], strrpos($field_arr['original_img'], '.'));
  9. $goods_gallery['img_original'] = dirname($field_arr['original_img']) . '/' . $image->random_filename() . $ext;
  10. @copy(ROOT_PATH . $field_arr['original_img'], ROOT_PATH . $goods_gallery['img_original']);
  11. }
  12. if (!empty($field_arr['goods_img']))
  13. {
  14. $ext = substr($field_arr['goods_img'], strrpos($field_arr['goods_img'], '.'));
  15. $goods_gallery['img_url'] = dirname($field_arr['goods_img']) . '/' . $image->random_filename() . $ext;
  16. @copy(ROOT_PATH . $field_arr['goods_img'], ROOT_PATH . $goods_gallery['img_url']);
  17. }
  18. if (!empty($field_arr['goods_thumb']))
  19. {
  20. $ext = substr($field_arr['goods_thumb'], strrpos($field_arr['goods_thumb'], '.'));
  21. $goods_gallery['thumb_url'] = dirname($field_arr['goods_thumb']) . '/' . $image->random_filename() . $ext;
  22. @copy(ROOT_PATH . $field_arr['goods_thumb'], ROOT_PATH . $goods_gallery['thumb_url']);
  23. }
  24. $db->autoExecute($ecs->table('goods_gallery'), $goods_gallery, 'INSERT');
  25. } */
复制代码
修改为:
  1. /* 插入商品相册:如果图片不为空*/
  2. if (!empty($field_arr['original_img']) || !empty($field_arr['goods_img']) || !empty($field_arr['goods_thumb']))
  3. {
  4. $goods_gallery = array();
  5. $goods_gallery['goods_id'] = $db->insert_id();
  6. if (!empty($field_arr['original_img']))
  7. {
  8. $ext = substr($field_arr['original_img'], strrpos($field_arr['original_img'], '.'));
  9. $goods_gallery['img_original'] = dirname($field_arr['original_img']) . '/' . $image->random_filename() . $ext;
  10. @copy(ROOT_PATH . $field_arr['original_img'], ROOT_PATH . $goods_gallery['img_original']);
  11. }
  12. if (!empty($field_arr['goods_img']))
  13. {
  14. $ext = substr($field_arr['goods_img'], strrpos($field_arr['goods_img'], '.'));
  15. $goods_gallery['img_url'] = dirname($field_arr['goods_img']) . '/' . $image->random_filename() . $ext;
  16. @copy(ROOT_PATH . $field_arr['goods_img'], ROOT_PATH . $goods_gallery['img_url']);
  17. }
  18. if (!empty($field_arr['goods_thumb']))
  19. {
  20. $ext = substr($field_arr['goods_thumb'], strrpos($field_arr['goods_thumb'], '.'));
  21. $goods_gallery['thumb_url'] = dirname($field_arr['goods_thumb']) . '/' . $image->random_filename() . $ext;
  22. @copy(ROOT_PATH . $field_arr['goods_thumb'], ROOT_PATH . $goods_gallery['thumb_url']);
  23. }
  24. $db->autoExecute($ecs->table('goods_gallery'), $goods_gallery, 'INSERT');
  25. }
复制代码

感谢回复,

原帖由 Goda 于 2009-2-10 10:51 发表
EC目录-》admin-》goods_batch.php文件
查找: /* 插入商品相册:如果图片不为空
if (!empty($field_arr['original_img']) || !empty($field_arr['goods_img']) || !empty($field_arr['goods_thumb']) ...


修改了,为何没有用呢?

把25行的 } */中的" */ "放到第一行中的最后就ok了