Page 1 of 1

New Products section [solved]

Posted: Sat Dec 26, 2015 8:32 pm
by krang
On my BitShop section

Code: Select all

New Products:
shows only first 4 added products.
Day after day I added new products to my shop but on section New Products on main page there are still only 4 from first day.
Could you help me and solve this problem? This is some issue or I need to change some options?

thanks in advance

Re: New Products section

Posted: Mon Dec 28, 2015 12:48 pm
by bitfreak
What version of BitShop are you using? Just tried on the latest version of BitShop and it seems to display newest products properly. Sounds like maybe the product creation times are not getting saved into your database properly. I'll probably need to take a closer look, for a start what is your domain?

Re: New Products section

Posted: Thu Dec 31, 2015 10:17 pm
by krang
This doesn't work on 1.0.8 and I update this today to 1.0.9 and got same result.
Here is link to my site: http://54ogum7gwxhtgiya.onion/pawnshop/

Re: New Products section

Posted: Sun Jan 03, 2016 8:44 am
by bitfreak
I still think the product creation times aren't being saved into the database properly. Run the following queries on your BitShop database to make sure the necessary triggers are created:

Code: Select all

DROP TRIGGER IF EXISTS Products_OnInsert;
CREATE TRIGGER Products_OnInsert BEFORE INSERT ON `Products`
FOR EACH ROW SET NEW.Created = IFNULL(NEW.Created, UTC_TIMESTAMP());

DROP TRIGGER IF EXISTS Orders_OnInsert;
CREATE TRIGGER Orders_OnInsert BEFORE INSERT ON `Orders`
FOR EACH ROW SET NEW.Created = IFNULL(NEW.Created, UTC_TIMESTAMP());

DROP TRIGGER IF EXISTS Codes_OnInsert;
CREATE TRIGGER Codes_OnInsert BEFORE INSERT ON `Codes`
FOR EACH ROW SET NEW.Created = IFNULL(NEW.Created, UTC_TIMESTAMP());

DROP TRIGGER IF EXISTS Reviews_OnInsert;
CREATE TRIGGER Reviews_OnInsert BEFORE INSERT ON `Reviews`
FOR EACH ROW SET NEW.Created = IFNULL(NEW.Created, UTC_TIMESTAMP());

DROP TRIGGER IF EXISTS Accounts_OnInsert;
CREATE TRIGGER Accounts_OnInsert BEFORE INSERT ON `Accounts`
FOR EACH ROW SET NEW.Created = IFNULL(NEW.Created, UTC_TIMESTAMP());
If that doesn't work the reason could be that your installed version of MySQL is too old and it doesn't support triggers, although that shouldn't be the case because I believe they have been supported since MySQL 5.0.2, which is really old. Another reason could be that the time on your MySQL server was wrong and it was recording incorrect product creation times. So even if the time was fixed, some of the products you created may have dates set far in the future, preventing other products which are truly newer from showing up. If all else fails try deleting all the products you created, then make sure your MySQL server time is correct, and recreate all your products. You will know if it's working after adding just a few products because the most recent always show first.

Re: New Products section

Posted: Wed Jan 06, 2016 10:49 pm
by krang
Works for me! Thank you!