In "admin/model/catalog/image.php", change line 58 from --
to
And line 78 from --
to
Make sure you clear your cache and image/cache folders.
This will change to sort order to sort by image_id rather than name. Since the "no image" image has the lowest image_id, it will display first.
Fido-X.
Code: Select all
$sql .= " ORDER BY id.title";
Code: Select all
$sql .= " ORDER BY i.image_id";
Code: Select all
$query = $this->db->query("SELECT * FROM image i LEFT JOIN image_description id ON (i.image_id = id.image_id) WHERE id.language_id = '" . (int)$this->language->getId() . "' ORDER BY id.title");
Code: Select all
$query = $this->db->query("SELECT * FROM image i LEFT JOIN image_description id ON (i.image_id = id.image_id) WHERE id.language_id = '" . (int)$this->language->getId() . "' ORDER BY i.image_id");
This will change to sort order to sort by image_id rather than name. Since the "no image" image has the lowest image_id, it will display first.
Fido-X.
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Thanks. That's a workaround, but I was thinking more of a change of core logic.
Making the 'no image' a system default for category/product and removing it from any image listings. It would also get around any possible tug-of-war confusions when deleting manufacturers/categories/products where the image is set as 'no image'.
In a similar way to manufacturer select being:
--None---
man-a
man-b
man-c
etc
The image listing would be
--No Image--
image-a
image-b
image-c
with the 'no-image' image selected by default for all cat/prod. It looks and feels neater.
One for Daniel.
Making the 'no image' a system default for category/product and removing it from any image listings. It would also get around any possible tug-of-war confusions when deleting manufacturers/categories/products where the image is set as 'no image'.
In a similar way to manufacturer select being:
--None---
man-a
man-b
man-c
etc
The image listing would be
--No Image--
image-a
image-b
image-c
with the 'no-image' image selected by default for all cat/prod. It looks and feels neater.
One for Daniel.
The "core logic", as you put it, is to select the first image in the list.
As for any "tugs of war", this only occurs if you try to delete an image that is attached to a manufacturer, category or product. There is no "tug of war" when deleting the manufacturer, category or product unless the image is deleted as well (which isn't the case).
However, you could try this --
In "admin/controller/catalog/category.php" find (around line 206)
insert the following after this line:--
Then in "admin/view/template/catalog/category_form.tpl" find
insert the following after this line:--
This will give you image 33 (the "no image" image) as the default -- regardless of sort order.
Fido-X.
As for any "tugs of war", this only occurs if you try to delete an image that is attached to a manufacturer, category or product. There is no "tug of war" when deleting the manufacturer, category or product unless the image is deleted as well (which isn't the case).
However, you could try this --
In "admin/controller/catalog/category.php" find (around line 206)
Code: Select all
$this->load->model('catalog/image');
Code: Select all
$this->data['no_image'] = $this->model_catalog_image->getImage(33);
Code: Select all
<select name="image_id" id="image_id" class="image" onchange="$('#image').load('index.php?route=catalog/image/thumb&image_id=' + this.value);">
Code: Select all
<option value="<?php echo $no_image['image_id']; ?>"><?php echo $no_image['title']; ?></option>
Fido-X.
Who is online
Users browsing this forum: No registered users and 5 guests