You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Pages: 1
Currently, as I understand it, you set the value of these columns to a 1 if you want to have the product included in one of these categories or leave it as a 0 to not display in these categories.
I would like to set the value of the column from 1 to nnn if the product is to be display then sort the display product according to the value in the column and leave it as a 0 to not display in these categories.
Can someone tell me how to do this and provide any code needed, as my coding skills are limited? Also, will the code work in Version 7?
Offline
That did not work. I changed tid to ecom_prod in the torderby field. Then I changed the value in the newdisp column in the ecom_prod table to 1 through 7 for the seven new products. The only product displayed in for the New Products category was the one with a value of 1 in the newdisp column.
I didn't really understand what is suppose to occur when you change tid to ecom_prod in the torderby field. It seems that tid is a column in the core_tabledefs table and ecom_prod is the name of the products table.
Offline
In the file {private}/apps/ecom/ECOM_Prod/ECOM_Prod.php, in the function prodlist() you will see:
$sortfield = 'sortorder'; $sorttype = 'ASC';
Change to:
$sortfield = 'THE_COLUMN_YOU_WANT_TO_SORT_BY'; $sorttype = 'ASC';
Offline
That didn't quite do what I wanted. If I set $sortfield = 'THE_COLUMN_YOU_WANT_TO_SORT_BY', CCP will use that column to sort the products for my normal product display. I want to use the sortorder column values to sort for my normal product display. But I want to use the newdisp values to sort products when a customer clicks on the New Product button.
It also appears that the newdisp column only recognizes values of 0 and 1. If I set a value in the newdisp column to 2 or 3 or 4, those products are not displayed when a customer clicks on the New Product button.
I want to be able to set values in the newdisp column from 1 to 25 (just an example) and have those products, with a value greater than 0, sorted according to the values in the newdisp column when a customer clicks on the New Product button.
I would also like to have the same capability to use on other columns, letting the values in the column determine which products are displayed and in what order. So if a customer clicked on the Specials button, the products that would be displayed are the products with a value in the specialsdisp column that is greater than 0. They would be display in ascending order based on the values in the specialsdisp column.
Offline
To just use a different sort field for new products listings only, in the file {private}/apps/ecom/ECOM_Prod/ECOM_Prod.php, in the function prodlist() you will see:
$sortfield = 'sortorder'; $sorttype = 'ASC';
Change to:
if ($ns == 'prodnew') { $sortfield = 'THE_COLUMN_YOU_WANT_TO_SORT_BY'; $sorttype = 'ASC'; } else { $sortfield = 'sortorder'; $sorttype = 'ASC'; } // End of if statement.
Offline
That still didn't work. CCP seems to ignore any products where the value in the newdisp column is greater than 1.
Offline
That's because the newdisp column is a boolean value (1 or 0). Perhaps you want to change all of those values in 'newdisp' to 1 or 0 then sort by 'datetimestamp' 'DESC'.
Offline
The datetimestamp column is blank on all the rows in my ecom_prod table. Are you suggesting that I just insert a number into the datetimestamp column and use it to determine the order in which I want my new products displayed? Example: If I have five new products to display and I want the golf bag to be shown first, the I would put a 1 in the datetimestamp field. The product I want shown second would have a 2 in the datetimestamp field. The other three products would have values 3, 4 and 5 in the datetimestamp field.
I could probably use any column that I'm not currently using such as whlprice and accomplish the same thing. Changing the dispnew to an integer type would probably make the most sense but I'm not sure what affect that would have on the code that references that column.
Offline
Let me guess, you're using a spreadsheet and entering values manually. You should default that column to '1359728236' which is the current time. Then use RawDBAdmin and 'maintain' the ecom_prod table, and add a new column for your 'newprodsortorder' and sort on that.
Offline
You are correct. I make all my changes to ecom_prod, ecom_cat, ecom_prodoptions and ecom_prodoptionsel using Excel then importing them to their respective tables.
For what purpose is the datetimestamp used?
I haven't tried adding the column yet but I was able to control the order of display for the New Products category by using the recurprice column. Trouble is that the recurprice gets displayed in my product price display. I'll add the column when I get a little time.
I am preparing to update the above four tables with 2013 data. I deleted products, categories, options and option select rows that are no longer available for 2013. But deleting the rows from the spreadsheet does not delete them from the tables in the database. I think the easiest approach would be to delete all the rows from each table then import the spreadsheet data. What is the best way to do this?
Offline
The datetimestamp column is used for modules like the SiteMap, GoogleBase and NewsRSS to show the last update time. The best way to delete all rows in the product table prior to doing an import is to execute this statement in Raw DB Admin:
DELETE FROM ecom_prod
Offline
Pages: 1