Hello,
I want to set limit to "Additional Images" for each product in OpenCart 3.0.3.8. For example the maximum additional images per product to be 5.
It's this possible to be done with some modifications in code of OpenCart' s files? Can someone help me with that please?
Thank you in advanced!
I want to set limit to "Additional Images" for each product in OpenCart 3.0.3.8. For example the maximum additional images per product to be 5.
It's this possible to be done with some modifications in code of OpenCart' s files? Can someone help me with that please?
Thank you in advanced!
Last edited by dimitrishalkida on Wed Mar 09, 2022 10:54 pm, edited 1 time in total.
A VQMod file you could add.
In admin/controller/catalog/product.php file,
in the getForm() method, find:
add above:
Then, in the validateForm() method, find:
add above:
In admin/language/en-gb/catalog/product.php file, find:
add below:
In admin/view/template/catalog/product_form.twig file,
add:
where you see fit.
In admin/controller/catalog/product.php file,
in the getForm() method, find:
Code: Select all
$url = '';
Code: Select all
if (isset($this->error['product_image'])) {
$data['error_product_image'] = $this->error['product_image'];
} else {
$data['error_product_image'] = '';
}
Code: Select all
if ($this->request->post['product_seo_url']) {
Code: Select all
if (!empty($this->request->post['product_image']) && is_array($this->request->post['product_image']) && sizeof($this->request->post['product_image']) > 5) {
$this->error['product_image'] = sprintf($this->language->get('error_product_image'), sizeof($this->request->post['product_image']));
}
Code: Select all
$_['error_unique']
Code: Select all
$_['error_product_image'] = 'Error: You cannot upload more than 5 images. Currently %d images have been uploaded but failed!';
add:
Code: Select all
{% if error_product_image %}
{{ error_product_image }}
{% endif %}
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I made an OCMod that does it perfectly.
It works without having to submit the form whereas the above method requires the form to be submitted.
.
It works without having to submit the form whereas the above method requires the form to be submitted.
.
Wow!mikeinterserv wrote: ↑Wed Mar 09, 2022 10:21 amI made an OCMod that does it perfectly.
It works without having to submit the form whereas the above method requires the form to be submitted.
.
Thank you very much, works perfect!
Who is online
Users browsing this forum: No registered users and 15 guests