Random sorting of Specials? Anyone?
Random sorting of Specials? Anyone?
Have you peeked in the specials module for specials_index.php where it uses: ExecuteRandomMulti
You could alter the specials.php to utilize something similar with a little bit of tweaking ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
I have no idea how to do that. I'm not a coder.
Are you talking about this line?
Do I paste it in the other file exactly the same way? Where is specials.php, the other guy told me to edit main_template_vars.php. Sorry, I'm really more of a hardware girl. Wires make sense, code doesn't!PHP Code:
if ($specials_index_query != '') $specials_index = $db->ExecuteRandomMulti($specials_index_query, MAX_DISPLAY_SPECIAL_PRODUCTS_INDEX);
Tracy
How do I modify the below code to sort by model number?
ORDER BY s.specials_date_added DESC";
############################################################____
ORDER BY s.specials_????? DESC";
Thanks
Seeing the whole SQL line would help to determine how to change the ORDER ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Hi all..
Ive been trying to sort my specials page by sort_order with the following code but it keeps returning an unknown column error. My apologies, im not a programmer, but im assuming a need to define the column some how??? Please help...
$specials_query_raw = "SELECT p.products_id, p.products_image, pd.products_name,
p.master_categories_id
FROM (" . TABLE_PRODUCTS . " p
LEFT JOIN " . TABLE_SPECIALS . " s on p.products_id = s.products_id
LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
WHERE p.products_id = s.products_id and p.products_id = pd.products_id and p.products_status = '1'
AND s.status = 1
AND pd.language_id = :languagesID
ORDER BY sort_order, s.specials_date_added DESC";1054 Unknown column 'sort_order' in 'order clause'
in:
[SELECT p.products_id, p.products_image, pd.products_name, p.master_categories_id FROM (zen_products p LEFT JOIN zen_specials s on p.products_id = s.products_id LEFT JOIN zen_products_description pd on p.products_id = pd.products_id ) INNER JOIN zen_categories_description cd ON (p.master_categories_id = cd.categories_id AND cd.language_id=1 AND cd.categories_description LIKE '%-###### Net 02-%') WHERE p.products_id = s.products_id and p.products_id = pd.products_id and p.products_status = '1' AND s.status = 1 AND pd.language_id = 1 ORDER BY sort_order, s.specials_date_added DESC limit 99]
Your error message and the SELECT that you posted do not match ...
Are you sure you are getting the SELECT from where the error is being generated?
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Could you go to the Tools ... Developers Tool Kit ... and in the bottom input box try a search on:
INNER JOIN
and select Catalog/Admin and click search ...
what file(s) come up?
Then a search on:
cd.categories_description
what file(s) come up?
do any contain a SELECT similar to the one you posted that displays in the error message?
If you read your SELECT statement then read the error message, you will notice there are things in the error message that are not even referenced in the SELECT ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Also, you have:
sort_order
in the WHERE ... if this is from the table:
products
that should be:
p.products_sort_order
NOTE: the p is not really needed as it is unique but it helps with clarity ...
NOTE: If you added a new field to the table:
specials
for sort order, make sure that you spelled it correctly ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Bookmarks