Example:
image-name-01 (main)
name-picture-02
name-picture-03
name-picture-04
.........
I noticed that opencart if you do not enter the values manually, upload the photos in random sequence, so I would like to know if there is a way and if someone could kindly help me set the upload by ordering by name
Thanks so much!!
I don't understand your issue. Is it the upload manager or the product images?depechemode75 wrote: ↑Mon Jun 22, 2020 11:38 pmHi everyone, I'd like to know if there is a way to have opencart upload the product images by name without necessarily having to manually enter the values in the images section.
Example:
image-name-01 (main)
name-picture-02
name-picture-03
name-picture-04
.........
I noticed that opencart if you do not enter the values manually, upload the photos in random sequence, so I would like to know if there is a way and if someone could kindly help me set the upload by ordering by name
Thanks so much!!
You manually add product images (one by one), and you can set the order as well (it has a field for that)
A2 Hosting features: Shared Turbo Boost, Managed Warp 1, Unmanaged Hyper 1, and Warp 2 Turbo
To do this I would have to set the values "0 1 2 ......) to order them but when you have 2000 products it is impossible to do this.
Loading sorting system defalt:
image-01 (main image)
image-04
image-03
image-02.......
I would like it to be automatically set as follows:
image-01 (main image)
image-02
image-03
image-04........
without having to manually set the values.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
what have the additional product images to do with a carousel?I want the sequence of images loaded when scrolling the carousel to be displayed sorted by name in ascending order
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
the carousel of the product page to scroll through the images .... I use journal3
catalog/model/catalog/product.php
change:
Code: Select all
public function getProductImages($product_id) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_image WHERE product_id = '" . (int)$product_id . "' ORDER BY sort_order ASC");
return $query->rows;
}
to:
Code: Select all
public function getProductImages($product_id) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_image WHERE product_id = '" . (int)$product_id . "' ORDER BY sort_order ASC, image ASC");
return $query->rows;
}
that sorts the additional images on sort order first and then on the filename.
The main image is in a separate query though as it resides in the product table.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
today I will try and let you know if it works. Meanwhile, thank youletxobnav wrote: ↑Tue Jun 23, 2020 6:28 pmnot sure how journal does it but you could try
catalog/model/catalog/product.php
change:Code: Select all
public function getProductImages($product_id) { $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_image WHERE product_id = '" . (int)$product_id . "' ORDER BY sort_order ASC"); return $query->rows; }
to:
Code: Select all
public function getProductImages($product_id) { $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_image WHERE product_id = '" . (int)$product_id . "' ORDER BY sort_order ASC, image ASC"); return $query->rows; }
that sorts the additional images on sort order first and then on the filename.
The main image is in a separate query though as it resides in the product table.
depechemode75 wrote: ↑Tue Jun 23, 2020 6:34 pmtoday I will try and let you know if it works. Meanwhile, thank youletxobnav wrote: ↑Tue Jun 23, 2020 6:28 pmnot sure how journal does it but you could try
catalog/model/catalog/product.php
change:Code: Select all
public function getProductImages($product_id) { $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_image WHERE product_id = '" . (int)$product_id . "' ORDER BY sort_order ASC"); return $query->rows; }
to:
Code: Select all
public function getProductImages($product_id) { $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_image WHERE product_id = '" . (int)$product_id . "' ORDER BY sort_order ASC, image ASC"); return $query->rows; }
that sorts the additional images on sort order first and then on the filename.
The main image is in a separate query though as it resides in the product table.
It works perfectly, now the additional images are sorted by name in ascending order without the need to enter any values manually.
Oc 3.0.3.3
Journal Theme 3
Thanks for your help!!
Brilliant letxobnav!! Using that AND this: https://www.opencart.com/index.php?rout ... n_id=22772
Makes it so it is pretty easy to have options sorted and images sorted to correlate with each other.
Thank you,
Mike
cue4cheap not cheap quality
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Users browsing this forum: No registered users and 10 guests