New Products section [solved]

Look here if you're having trouble with BitShop
Post Reply
User avatar
krang
Posts: 28
Joined: Mon Dec 14, 2015 10:27 am
Location: Dimension X
Contact:

New Products section [solved]

Post 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
User avatar
bitfreak
Site Admin
Posts: 98
Joined: Thu Dec 10, 2015 6:57 pm
Location: Australia
Contact:

Re: New Products section

Post 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?
User avatar
krang
Posts: 28
Joined: Mon Dec 14, 2015 10:27 am
Location: Dimension X
Contact:

Re: New Products section

Post 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/
User avatar
bitfreak
Site Admin
Posts: 98
Joined: Thu Dec 10, 2015 6:57 pm
Location: Australia
Contact:

Re: New Products section

Post 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.
User avatar
krang
Posts: 28
Joined: Mon Dec 14, 2015 10:27 am
Location: Dimension X
Contact:

Re: New Products section

Post by krang »

Works for me! Thank you!
Post Reply