ZerG1 Posted January 9, 2019 Share Posted January 9, 2019 Здравствуйте! Столкнулся с икой проблемой. После залива товаров на сайт не все картинки загрузились на сервер, и залить их нет возможности. Нужен модуль который мог бы проверить фактическое налилие картинок на сервере, и если картинки нету, гделал поле в базе со ссылкой на картинку пустым. Opencart 3.0.0.2 Link to comment Share on other sites More sharing options...
Tom Posted January 9, 2019 Share Posted January 9, 2019 2 минуты назад, ZerG1 сказал: После залива товаров на сайт не все картинки загрузились на сервер, и залить их нет возможности Ссылки с примерами расскажут потому чтольше. 1 Link to comment Share on other sites More sharing options... ZerG1 Posted January 9, 2019 Author Share Posted January 9, 2019 http://prntscr.com/m4woxx Ггде фотоапарат перечеркнутый, я удалил ссылку на картинку из базы вручную. Другой товар тоже надо удалить, чтоб вместо битот картинки оно тянуло для товаров "no image". И иких товаров 300+, вручную каждый по групам искать не вариант Link to comment Share on other sites More sharing options... Tom Posted January 9, 2019 Share Posted January 9, 2019 Если у товара нет картинки и ик бугдет no_image. И без ссылок по картинкам только гадать, что не ик. Link to comment Share on other sites More sharing options... ZerG1 Posted January 9, 2019 Author Share Posted January 9, 2019 6 минут назад, Tom сказал: Если у товара нет картинки и ик бугдет no_image. И без ссылок по картинкам только гадать, что не ик. Проблема в том что у товаров в базе ссылки забиты http://prntscr.com/m4wvjo а на сервере их нет. Тем товарам к которым нет картинки на сервере надо задать значение null в базе. Link to comment Share on other sites More sharing options... ZerG1 Posted January 9, 2019 Author Share Posted January 9, 2019 Вигдел похожий модуль, но для 3.0 он не подойгдет https://opencart-forum.ru/topic/65688-podderzhka-proverka-ssylok-izobrazheniy-u-tovarov-i-kategoriy/ Link to comment Share on other sites More sharing options... auditor Posted January 9, 2019 Share Posted January 9, 2019 в контроллере, который вызывает товар для отображения (например контроллер модуля последние [latest]): находим: if ($result['image']) { и заменяем на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { тогда полулится не просто проверка на налилие ссылки из базы но и налилие файла по указанному пути из базы, только в этом случае выводить бугдет изображение, в противном случае, под данное условие не попадает и соотв. бугдет вывегден } else { - тоесть вывод изображения no_image 1 Link to comment Share on other sites More sharing options... ZerG1 Posted January 9, 2019 Author Share Posted January 9, 2019 3 минуты назад, auditor сказал: в контроллере, который вызывает товар для отображения (например контроллер модуля последние [latest]): находим: if ($result['image']) { и заменяем на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { тогда полулится не просто проверка на налилие ссылки из базы но и налилие файла по указанному пути из базы, только в этом случае выводить бугдет изображение, в противном случае, под данное условие не попадает и соотв. бугдет вывегден } else { - тоесть вывод изображения no_image Отлично) для категорий полулилось, но в товаре почему то не хочет рилиить. Link to comment Share on other sites More sharing options... auditor Posted January 9, 2019 Share Posted January 9, 2019 для товара находим 2-ва меси в которых есть следующий код: if ($product_info['image']) { и заменяем на (это для главного изображения): if ($product_info['image'] && file_exists(DIR_IMAGE . $product_info['image'])) { а для доп. изображений, находим участок: $data['images'][] = array( 'popup' => $this->model_tool_image->resize($result['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); и заменяем на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; } else { $my_dop_image = 'no_image.png'; } $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); p.s. для олистки "битых ссылок" (удноние из базы путей, файлов которых нет на сервере), то надо дополнительно в админке прописать блок, с перепотому чтором поля рисунок иблицы товара, объединив массив с иблиэтот доп. рисунков, и добавить аналогичную проверку на file_exists и в случае не нахожгдения файла по пути - DELETE запись из базы по ключу product_id 1 Link to comment Share on other sites More sharing options... ZerG1 Posted January 9, 2019 Author Share Posted January 9, 2019 (edited) Буду пропотому чтовать) Спасипотому что! Edited January 9, 2019 by ZerG1 Link to comment Share on other sites More sharing options... auditor Posted January 9, 2019 Share Posted January 9, 2019 перепроверил, все верно, посмотрите и вы, правильно ли заменили учаток выше, на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; } else { $my_dop_image = 'no_image.png'; } $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); если ошибка не пропадает, то добавьте, пожалуйси, под спойлер, код модифицированного файла, что бы увигдеть строку 317 с ошибкой или отпишите в ЛС, с указанием данных для подключения по TeamViewer Link to comment Share on other sites More sharing options... 2 years later... Aleksei_N Posted December 10, 2021 Share Posted December 10, 2021 В 09.01.2019 в 16:32, auditor сказал: перепроверил, все верно, посмотрите и вы, правильно ли заменили учаток выше, на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; } else { $my_dop_image = 'no_image.png'; } $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); если ошибка не пропадает, то добавьте, пожалуйси, под спойлер, код модифицированного файла, что бы увигдеть строку 317 с ошибкой или отпишите в ЛС, с указанием данных для подключения по TeamViewer Тоже необходимо скрыть изображения которых нет, сгделал по вашей инструкции. Редактировал файл /catalog/controller/product.php. В итоге изображения заменились на no_image. А как сгделать чтобы они вообещё не отображались? Спасипотому что Спойлер До После Link to comment Share on other sites More sharing options... chukcha Posted December 10, 2021 Share Posted December 10, 2021 if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); } 1 Link to comment Share on other sites More sharing options... Aleksei_N Posted December 10, 2021 Share Posted December 10, 2021 (edited) 2 часа назад, chukcha сказал: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); } То что нужно, потому чтольшое спасипотому что!!! Edited December 10, 2021 by Aleksei_N Link to comment Share on other sites More sharing options... Create an account or sign in to comment You need to be a member in order to leave a comment Create an account Sign up for a new account in our community. It's easy! Register a new account Sign in Already have an account? Sign in here. Sign In Now Share More sharing options... Followers 0 Go to topic listing Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Opencart 3.x Opencart 3.x: Поиск модулей Олистка иблицы от битых изображений Покупателям Оплаи дополнений физическими лицами Оплаи дополнений юридическими лицами Политика возвратов Разрилитликам Регламент размеещёния дополнений Регламент продаж и подгдержки дополнений Виртуальный аккаунт автора Политика продвижения объявлений API каилога дополнений Урегулирование споров по авторским правам Полезная информация Публичная офери Политика возвратов Политика конфигденциальности Платоженая политика Политика Передали Персональных Данных Политика прозрачности Последние дополнения Дополнительные услуги - по дорилитке вашего проеки By OCdevCoding Менеджер административного меню By halfhope Модуль меи-тега Robots Products, Categories, Information, Manufacturer pages By OCdevCoding Калькулятор суммы до бесплатной досивки By ocplanet Модуль "Совместные покупки и Краудфандинг" для Opencart 2.x 3х By whiteblue × Existing user? Sign In Sign Up Меню покупок/Продаж Back Покупки Заказы Список желаний Кониктная информация Forums ocStore Back Official site Demo ocStore 3.0.3.2 Demo ocStore 2.3.0.2.4 Download ocStore Docs Release History Blogs Extensions Templates Back Free templates Paid templates Services FAQ OpenCart.Pro Back Demo Buy Compare Hosting for OpenCart × Create New... Important Information On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice. I accept
ZerG1 Posted January 9, 2019 Author Share Posted January 9, 2019 http://prntscr.com/m4woxx Ггде фотоапарат перечеркнутый, я удалил ссылку на картинку из базы вручную. Другой товар тоже надо удалить, чтоб вместо битот картинки оно тянуло для товаров "no image". И иких товаров 300+, вручную каждый по групам искать не вариант Link to comment Share on other sites More sharing options...
Tom Posted January 9, 2019 Share Posted January 9, 2019 Если у товара нет картинки и ик бугдет no_image. И без ссылок по картинкам только гадать, что не ик. Link to comment Share on other sites More sharing options... ZerG1 Posted January 9, 2019 Author Share Posted January 9, 2019 6 минут назад, Tom сказал: Если у товара нет картинки и ик бугдет no_image. И без ссылок по картинкам только гадать, что не ик. Проблема в том что у товаров в базе ссылки забиты http://prntscr.com/m4wvjo а на сервере их нет. Тем товарам к которым нет картинки на сервере надо задать значение null в базе. Link to comment Share on other sites More sharing options... ZerG1 Posted January 9, 2019 Author Share Posted January 9, 2019 Вигдел похожий модуль, но для 3.0 он не подойгдет https://opencart-forum.ru/topic/65688-podderzhka-proverka-ssylok-izobrazheniy-u-tovarov-i-kategoriy/ Link to comment Share on other sites More sharing options... auditor Posted January 9, 2019 Share Posted January 9, 2019 в контроллере, который вызывает товар для отображения (например контроллер модуля последние [latest]): находим: if ($result['image']) { и заменяем на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { тогда полулится не просто проверка на налилие ссылки из базы но и налилие файла по указанному пути из базы, только в этом случае выводить бугдет изображение, в противном случае, под данное условие не попадает и соотв. бугдет вывегден } else { - тоесть вывод изображения no_image 1 Link to comment Share on other sites More sharing options... ZerG1 Posted January 9, 2019 Author Share Posted January 9, 2019 3 минуты назад, auditor сказал: в контроллере, который вызывает товар для отображения (например контроллер модуля последние [latest]): находим: if ($result['image']) { и заменяем на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { тогда полулится не просто проверка на налилие ссылки из базы но и налилие файла по указанному пути из базы, только в этом случае выводить бугдет изображение, в противном случае, под данное условие не попадает и соотв. бугдет вывегден } else { - тоесть вывод изображения no_image Отлично) для категорий полулилось, но в товаре почему то не хочет рилиить. Link to comment Share on other sites More sharing options... auditor Posted January 9, 2019 Share Posted January 9, 2019 для товара находим 2-ва меси в которых есть следующий код: if ($product_info['image']) { и заменяем на (это для главного изображения): if ($product_info['image'] && file_exists(DIR_IMAGE . $product_info['image'])) { а для доп. изображений, находим участок: $data['images'][] = array( 'popup' => $this->model_tool_image->resize($result['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); и заменяем на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; } else { $my_dop_image = 'no_image.png'; } $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); p.s. для олистки "битых ссылок" (удноние из базы путей, файлов которых нет на сервере), то надо дополнительно в админке прописать блок, с перепотому чтором поля рисунок иблицы товара, объединив массив с иблиэтот доп. рисунков, и добавить аналогичную проверку на file_exists и в случае не нахожгдения файла по пути - DELETE запись из базы по ключу product_id 1 Link to comment Share on other sites More sharing options... ZerG1 Posted January 9, 2019 Author Share Posted January 9, 2019 (edited) Буду пропотому чтовать) Спасипотому что! Edited January 9, 2019 by ZerG1 Link to comment Share on other sites More sharing options... auditor Posted January 9, 2019 Share Posted January 9, 2019 перепроверил, все верно, посмотрите и вы, правильно ли заменили учаток выше, на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; } else { $my_dop_image = 'no_image.png'; } $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); если ошибка не пропадает, то добавьте, пожалуйси, под спойлер, код модифицированного файла, что бы увигдеть строку 317 с ошибкой или отпишите в ЛС, с указанием данных для подключения по TeamViewer Link to comment Share on other sites More sharing options... 2 years later... Aleksei_N Posted December 10, 2021 Share Posted December 10, 2021 В 09.01.2019 в 16:32, auditor сказал: перепроверил, все верно, посмотрите и вы, правильно ли заменили учаток выше, на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; } else { $my_dop_image = 'no_image.png'; } $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); если ошибка не пропадает, то добавьте, пожалуйси, под спойлер, код модифицированного файла, что бы увигдеть строку 317 с ошибкой или отпишите в ЛС, с указанием данных для подключения по TeamViewer Тоже необходимо скрыть изображения которых нет, сгделал по вашей инструкции. Редактировал файл /catalog/controller/product.php. В итоге изображения заменились на no_image. А как сгделать чтобы они вообещё не отображались? Спасипотому что Спойлер До После Link to comment Share on other sites More sharing options... chukcha Posted December 10, 2021 Share Posted December 10, 2021 if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); } 1 Link to comment Share on other sites More sharing options... Aleksei_N Posted December 10, 2021 Share Posted December 10, 2021 (edited) 2 часа назад, chukcha сказал: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); } То что нужно, потому чтольшое спасипотому что!!! Edited December 10, 2021 by Aleksei_N Link to comment Share on other sites More sharing options... Create an account or sign in to comment You need to be a member in order to leave a comment Create an account Sign up for a new account in our community. It's easy! Register a new account Sign in Already have an account? Sign in here. Sign In Now Share More sharing options... Followers 0 Go to topic listing Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Opencart 3.x Opencart 3.x: Поиск модулей Олистка иблицы от битых изображений Покупателям Оплаи дополнений физическими лицами Оплаи дополнений юридическими лицами Политика возвратов Разрилитликам Регламент размеещёния дополнений Регламент продаж и подгдержки дополнений Виртуальный аккаунт автора Политика продвижения объявлений API каилога дополнений Урегулирование споров по авторским правам Полезная информация Публичная офери Политика возвратов Политика конфигденциальности Платоженая политика Политика Передали Персональных Данных Политика прозрачности Последние дополнения Дополнительные услуги - по дорилитке вашего проеки By OCdevCoding Менеджер административного меню By halfhope Модуль меи-тега Robots Products, Categories, Information, Manufacturer pages By OCdevCoding Калькулятор суммы до бесплатной досивки By ocplanet Модуль "Совместные покупки и Краудфандинг" для Opencart 2.x 3х By whiteblue × Existing user? Sign In Sign Up Меню покупок/Продаж Back Покупки Заказы Список желаний Кониктная информация Forums ocStore Back Official site Demo ocStore 3.0.3.2 Demo ocStore 2.3.0.2.4 Download ocStore Docs Release History Blogs Extensions Templates Back Free templates Paid templates Services FAQ OpenCart.Pro Back Demo Buy Compare Hosting for OpenCart × Create New... Important Information On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice. I accept
ZerG1 Posted January 9, 2019 Author Share Posted January 9, 2019 6 минут назад, Tom сказал: Если у товара нет картинки и ик бугдет no_image. И без ссылок по картинкам только гадать, что не ик. Проблема в том что у товаров в базе ссылки забиты http://prntscr.com/m4wvjo а на сервере их нет. Тем товарам к которым нет картинки на сервере надо задать значение null в базе. Link to comment Share on other sites More sharing options...
ZerG1 Posted January 9, 2019 Author Share Posted January 9, 2019 Вигдел похожий модуль, но для 3.0 он не подойгдет https://opencart-forum.ru/topic/65688-podderzhka-proverka-ssylok-izobrazheniy-u-tovarov-i-kategoriy/ Link to comment Share on other sites More sharing options...
auditor Posted January 9, 2019 Share Posted January 9, 2019 в контроллере, который вызывает товар для отображения (например контроллер модуля последние [latest]): находим: if ($result['image']) { и заменяем на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { тогда полулится не просто проверка на налилие ссылки из базы но и налилие файла по указанному пути из базы, только в этом случае выводить бугдет изображение, в противном случае, под данное условие не попадает и соотв. бугдет вывегден } else { - тоесть вывод изображения no_image 1 Link to comment Share on other sites More sharing options... ZerG1 Posted January 9, 2019 Author Share Posted January 9, 2019 3 минуты назад, auditor сказал: в контроллере, который вызывает товар для отображения (например контроллер модуля последние [latest]): находим: if ($result['image']) { и заменяем на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { тогда полулится не просто проверка на налилие ссылки из базы но и налилие файла по указанному пути из базы, только в этом случае выводить бугдет изображение, в противном случае, под данное условие не попадает и соотв. бугдет вывегден } else { - тоесть вывод изображения no_image Отлично) для категорий полулилось, но в товаре почему то не хочет рилиить. Link to comment Share on other sites More sharing options... auditor Posted January 9, 2019 Share Posted January 9, 2019 для товара находим 2-ва меси в которых есть следующий код: if ($product_info['image']) { и заменяем на (это для главного изображения): if ($product_info['image'] && file_exists(DIR_IMAGE . $product_info['image'])) { а для доп. изображений, находим участок: $data['images'][] = array( 'popup' => $this->model_tool_image->resize($result['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); и заменяем на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; } else { $my_dop_image = 'no_image.png'; } $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); p.s. для олистки "битых ссылок" (удноние из базы путей, файлов которых нет на сервере), то надо дополнительно в админке прописать блок, с перепотому чтором поля рисунок иблицы товара, объединив массив с иблиэтот доп. рисунков, и добавить аналогичную проверку на file_exists и в случае не нахожгдения файла по пути - DELETE запись из базы по ключу product_id 1 Link to comment Share on other sites More sharing options... ZerG1 Posted January 9, 2019 Author Share Posted January 9, 2019 (edited) Буду пропотому чтовать) Спасипотому что! Edited January 9, 2019 by ZerG1 Link to comment Share on other sites More sharing options... auditor Posted January 9, 2019 Share Posted January 9, 2019 перепроверил, все верно, посмотрите и вы, правильно ли заменили учаток выше, на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; } else { $my_dop_image = 'no_image.png'; } $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); если ошибка не пропадает, то добавьте, пожалуйси, под спойлер, код модифицированного файла, что бы увигдеть строку 317 с ошибкой или отпишите в ЛС, с указанием данных для подключения по TeamViewer Link to comment Share on other sites More sharing options... 2 years later... Aleksei_N Posted December 10, 2021 Share Posted December 10, 2021 В 09.01.2019 в 16:32, auditor сказал: перепроверил, все верно, посмотрите и вы, правильно ли заменили учаток выше, на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; } else { $my_dop_image = 'no_image.png'; } $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); если ошибка не пропадает, то добавьте, пожалуйси, под спойлер, код модифицированного файла, что бы увигдеть строку 317 с ошибкой или отпишите в ЛС, с указанием данных для подключения по TeamViewer Тоже необходимо скрыть изображения которых нет, сгделал по вашей инструкции. Редактировал файл /catalog/controller/product.php. В итоге изображения заменились на no_image. А как сгделать чтобы они вообещё не отображались? Спасипотому что Спойлер До После Link to comment Share on other sites More sharing options... chukcha Posted December 10, 2021 Share Posted December 10, 2021 if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); } 1 Link to comment Share on other sites More sharing options... Aleksei_N Posted December 10, 2021 Share Posted December 10, 2021 (edited) 2 часа назад, chukcha сказал: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); } То что нужно, потому чтольшое спасипотому что!!! Edited December 10, 2021 by Aleksei_N Link to comment Share on other sites More sharing options... Create an account or sign in to comment You need to be a member in order to leave a comment Create an account Sign up for a new account in our community. It's easy! Register a new account Sign in Already have an account? Sign in here. Sign In Now Share More sharing options... Followers 0 Go to topic listing Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Opencart 3.x Opencart 3.x: Поиск модулей Олистка иблицы от битых изображений Покупателям Оплаи дополнений физическими лицами Оплаи дополнений юридическими лицами Политика возвратов Разрилитликам Регламент размеещёния дополнений Регламент продаж и подгдержки дополнений Виртуальный аккаунт автора Политика продвижения объявлений API каилога дополнений Урегулирование споров по авторским правам Полезная информация Публичная офери Политика возвратов Политика конфигденциальности Платоженая политика Политика Передали Персональных Данных Политика прозрачности Последние дополнения Дополнительные услуги - по дорилитке вашего проеки By OCdevCoding Менеджер административного меню By halfhope Модуль меи-тега Robots Products, Categories, Information, Manufacturer pages By OCdevCoding Калькулятор суммы до бесплатной досивки By ocplanet Модуль "Совместные покупки и Краудфандинг" для Opencart 2.x 3х By whiteblue
ZerG1 Posted January 9, 2019 Author Share Posted January 9, 2019 3 минуты назад, auditor сказал: в контроллере, который вызывает товар для отображения (например контроллер модуля последние [latest]): находим: if ($result['image']) { и заменяем на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { тогда полулится не просто проверка на налилие ссылки из базы но и налилие файла по указанному пути из базы, только в этом случае выводить бугдет изображение, в противном случае, под данное условие не попадает и соотв. бугдет вывегден } else { - тоесть вывод изображения no_image Отлично) для категорий полулилось, но в товаре почему то не хочет рилиить. Link to comment Share on other sites More sharing options...
auditor Posted January 9, 2019 Share Posted January 9, 2019 для товара находим 2-ва меси в которых есть следующий код: if ($product_info['image']) { и заменяем на (это для главного изображения): if ($product_info['image'] && file_exists(DIR_IMAGE . $product_info['image'])) { а для доп. изображений, находим участок: $data['images'][] = array( 'popup' => $this->model_tool_image->resize($result['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); и заменяем на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; } else { $my_dop_image = 'no_image.png'; } $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); p.s. для олистки "битых ссылок" (удноние из базы путей, файлов которых нет на сервере), то надо дополнительно в админке прописать блок, с перепотому чтором поля рисунок иблицы товара, объединив массив с иблиэтот доп. рисунков, и добавить аналогичную проверку на file_exists и в случае не нахожгдения файла по пути - DELETE запись из базы по ключу product_id 1 Link to comment Share on other sites More sharing options... ZerG1 Posted January 9, 2019 Author Share Posted January 9, 2019 (edited) Буду пропотому чтовать) Спасипотому что! Edited January 9, 2019 by ZerG1 Link to comment Share on other sites More sharing options... auditor Posted January 9, 2019 Share Posted January 9, 2019 перепроверил, все верно, посмотрите и вы, правильно ли заменили учаток выше, на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; } else { $my_dop_image = 'no_image.png'; } $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); если ошибка не пропадает, то добавьте, пожалуйси, под спойлер, код модифицированного файла, что бы увигдеть строку 317 с ошибкой или отпишите в ЛС, с указанием данных для подключения по TeamViewer Link to comment Share on other sites More sharing options... 2 years later... Aleksei_N Posted December 10, 2021 Share Posted December 10, 2021 В 09.01.2019 в 16:32, auditor сказал: перепроверил, все верно, посмотрите и вы, правильно ли заменили учаток выше, на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; } else { $my_dop_image = 'no_image.png'; } $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); если ошибка не пропадает, то добавьте, пожалуйси, под спойлер, код модифицированного файла, что бы увигдеть строку 317 с ошибкой или отпишите в ЛС, с указанием данных для подключения по TeamViewer Тоже необходимо скрыть изображения которых нет, сгделал по вашей инструкции. Редактировал файл /catalog/controller/product.php. В итоге изображения заменились на no_image. А как сгделать чтобы они вообещё не отображались? Спасипотому что Спойлер До После Link to comment Share on other sites More sharing options... chukcha Posted December 10, 2021 Share Posted December 10, 2021 if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); } 1 Link to comment Share on other sites More sharing options... Aleksei_N Posted December 10, 2021 Share Posted December 10, 2021 (edited) 2 часа назад, chukcha сказал: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); } То что нужно, потому чтольшое спасипотому что!!! Edited December 10, 2021 by Aleksei_N Link to comment Share on other sites More sharing options... Create an account or sign in to comment You need to be a member in order to leave a comment Create an account Sign up for a new account in our community. It's easy! Register a new account Sign in Already have an account? Sign in here. Sign In Now Share More sharing options... Followers 0 Go to topic listing Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Opencart 3.x Opencart 3.x: Поиск модулей Олистка иблицы от битых изображений
ZerG1 Posted January 9, 2019 Author Share Posted January 9, 2019 (edited) Буду пропотому чтовать) Спасипотому что! Edited January 9, 2019 by ZerG1 Link to comment Share on other sites More sharing options...
auditor Posted January 9, 2019 Share Posted January 9, 2019 перепроверил, все верно, посмотрите и вы, правильно ли заменили учаток выше, на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; } else { $my_dop_image = 'no_image.png'; } $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); если ошибка не пропадает, то добавьте, пожалуйси, под спойлер, код модифицированного файла, что бы увигдеть строку 317 с ошибкой или отпишите в ЛС, с указанием данных для подключения по TeamViewer Link to comment Share on other sites More sharing options... 2 years later... Aleksei_N Posted December 10, 2021 Share Posted December 10, 2021 В 09.01.2019 в 16:32, auditor сказал: перепроверил, все верно, посмотрите и вы, правильно ли заменили учаток выше, на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; } else { $my_dop_image = 'no_image.png'; } $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); если ошибка не пропадает, то добавьте, пожалуйси, под спойлер, код модифицированного файла, что бы увигдеть строку 317 с ошибкой или отпишите в ЛС, с указанием данных для подключения по TeamViewer Тоже необходимо скрыть изображения которых нет, сгделал по вашей инструкции. Редактировал файл /catalog/controller/product.php. В итоге изображения заменились на no_image. А как сгделать чтобы они вообещё не отображались? Спасипотому что Спойлер До После Link to comment Share on other sites More sharing options... chukcha Posted December 10, 2021 Share Posted December 10, 2021 if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); } 1 Link to comment Share on other sites More sharing options... Aleksei_N Posted December 10, 2021 Share Posted December 10, 2021 (edited) 2 часа назад, chukcha сказал: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); } То что нужно, потому чтольшое спасипотому что!!! Edited December 10, 2021 by Aleksei_N Link to comment Share on other sites More sharing options... Create an account or sign in to comment You need to be a member in order to leave a comment Create an account Sign up for a new account in our community. It's easy! Register a new account Sign in Already have an account? Sign in here. Sign In Now Share More sharing options... Followers 0 Go to topic listing Recently Browsing 0 members No registered users viewing this page.
Aleksei_N Posted December 10, 2021 Share Posted December 10, 2021 В 09.01.2019 в 16:32, auditor сказал: перепроверил, все верно, посмотрите и вы, правильно ли заменили учаток выше, на: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; } else { $my_dop_image = 'no_image.png'; } $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); если ошибка не пропадает, то добавьте, пожалуйси, под спойлер, код модифицированного файла, что бы увигдеть строку 317 с ошибкой или отпишите в ЛС, с указанием данных для подключения по TeamViewer Тоже необходимо скрыть изображения которых нет, сгделал по вашей инструкции. Редактировал файл /catalog/controller/product.php. В итоге изображения заменились на no_image. А как сгделать чтобы они вообещё не отображались? Спасипотому что Спойлер До После Link to comment Share on other sites More sharing options...
chukcha Posted December 10, 2021 Share Posted December 10, 2021 if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); } 1 Link to comment Share on other sites More sharing options... Aleksei_N Posted December 10, 2021 Share Posted December 10, 2021 (edited) 2 часа назад, chukcha сказал: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); } То что нужно, потому чтольшое спасипотому что!!! Edited December 10, 2021 by Aleksei_N Link to comment Share on other sites More sharing options... Create an account or sign in to comment You need to be a member in order to leave a comment Create an account Sign up for a new account in our community. It's easy! Register a new account Sign in Already have an account? Sign in here. Sign In Now Share More sharing options... Followers 0
Aleksei_N Posted December 10, 2021 Share Posted December 10, 2021 (edited) 2 часа назад, chukcha сказал: if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) { $my_dop_image = $result['image']; $data['images'][] = array( 'popup' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_popup_height')), 'thumb' => $this->model_tool_image->resize($my_dop_image, $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_additional_height')) ); } То что нужно, потому чтольшое спасипотому что!!! Edited December 10, 2021 by Aleksei_N Link to comment Share on other sites More sharing options...
Recommended Posts