Perfect, very nice plugin.
Thank you again!
Perfect, very nice plugin.
Thank you again!
Waiting to be Zenned - Over-thinking makes an easy task complicated.
https://www.thercrv.com NOW LIVE
I now have it setup for as custom with images, but wonder how the order for those scrolling images is determined? I've tried to reorganize the display by spacing the product ID apart from each other to prevent aesthetically similar images from showing up next to each other, but that doesn't seem to work. Is it keyed off of categories? And is there a known way to control the order of display?
Waiting to be Zenned - Over-thinking makes an easy task complicated.
The plugin is set to order these products by original products' sort order which you set in admin (although kinda useless if you have products from various categories) and then by products' names in alphabetical order.
If you want to change that and have the products show in the exact order as you entered the IDs in your admin, you'll need to make a change to one file - includes/templates/YOUR_TEMPLATE/templates/tpl_index_slider.php.
Find
and replace withCode:case 'custom': $products_query = "SELECT DISTINCT p.products_id, pd.products_name, p.products_image, p.master_categories_id FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd WHERE p.products_id IN (".ZX_CAROUSEL_MOD_CUSTOM.") AND p.products_status = '1' AND p.products_id = pd.products_id AND pd.language_id = " . (int)$_SESSION['languages_id'] ." ORDER BY p.products_sort_order, pd.products_name"; if ($products_query != '') $products = $db->Execute($products_query, ZX_CAROUSEL_LIMIT); break;
Code:case 'custom': $products_query = "SELECT DISTINCT p.products_id, pd.products_name, p.products_image, p.master_categories_id FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd WHERE p.products_id IN (".ZX_CAROUSEL_MOD_CUSTOM.") AND p.products_status = '1' AND p.products_id = pd.products_id AND pd.language_id = " . (int)$_SESSION['languages_id']; if ($products_query != '') $products = $db->Execute($products_query, ZX_CAROUSEL_LIMIT); break;
Actually in a second look, it didn't even put the first image in order as entered. It displays all the images I entered, just not in the order I entered.
I have the max increased from 10 to 20, running 15
Waiting to be Zenned - Over-thinking makes an easy task complicated.
Looks like what it did is sorted them numerically from low to high, disregarding the custom order.
What I'm trying to do is get them to display by product ID in an order I specify. I.E. 27,3,12,11,45,9........etc
What I get is 3,9,11,12,27,45....etc
Last edited by TheGrimReaper; 31 Jan 2021 at 08:18 PM.
Waiting to be Zenned - Over-thinking makes an easy task complicated.
Yeah, sorry about that. Please disregards post #13 and use this:
Find
Replace withCode:case 'custom': $products_query = "SELECT DISTINCT p.products_id, pd.products_name, p.products_image, p.master_categories_id FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd WHERE p.products_id IN (".ZX_CAROUSEL_MOD_CUSTOM.") AND p.products_status = '1' AND p.products_id = pd.products_id AND pd.language_id = " . (int)$_SESSION['languages_id'] ." ORDER BY p.products_sort_order, pd.products_name"; if ($products_query != '') $products = $db->Execute($products_query, ZX_CAROUSEL_LIMIT); break;
Code:case 'custom': $products_query = "SELECT DISTINCT p.products_id, pd.products_name, p.products_image, p.master_categories_id FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd WHERE p.products_id IN (".ZX_CAROUSEL_MOD_CUSTOM.") AND p.products_status = '1' AND p.products_id = pd.products_id AND pd.language_id = " . (int)$_SESSION['languages_id'] ." ORDER BY FIELD(p.products_id, ".ZX_CAROUSEL_MOD_CUSTOM.")"; if ($products_query != '') $products = $db->Execute($products_query, ZX_CAROUSEL_LIMIT); break;
For increased security, you may want to replace both instances of
ZX_CAROUSEL_MOD_CUSTOM
with
zen_db_input(ZX_CAROUSEL_MOD_CUSTOM)
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
That's the one I was trying to do. Made a great mod even better. Thank you.
Waiting to be Zenned - Over-thinking makes an easy task complicated.
Bookmarks