Post by matthewbaynham » Wed Nov 25, 2020 12:33 am

Opencart Version: 3.0.3.6

I added products using my own java code updating the MySQL tables but it's got two problems.

If you have a look at the attachments.

One attachment is admin view of the categories, this didn't come out right. You can see that the first 4 categories listed are "Business", this is wrong. The first 4 categories have the parent categories business but the sub-categories have different names. When I click on one of these "Business" everything appears correct and when I click save it corrects the data in the screenshot.

Where in the MySQL database does the screen in the screenshot get it's data?

The second screenshot is the side menu listing all the categories where you can see "Luggage (155)" it's good that it has 155 in brackets. However the problem is all the sub-categories underneath "Luggage (155)" have a zero in brackets. Like "Leather Wheeled Luggage (0)".

Where in the MySQL database do these zero's come from in the sub-categories?

Attachments

Screenshot from 2020-11-24 17-18-02.png

admin view of the categories - Screenshot from 2020-11-24 17-18-02.png (100.48 KiB) Viewed 1133 times

Screenshot from 2020-11-24 17-08-18.png

side menu - Screenshot from 2020-11-24 17-08-18.png (60.57 KiB) Viewed 1133 times


New member

Posts

Joined
Fri Nov 01, 2019 9:18 pm

Post by straightlight » Wed Nov 25, 2020 12:48 am

I added products using my own java code updating the MySQL tables but it's got two problems.
What Java code? In the mean time, you could always create a new service request in the Commercial Support section of the forum, or contact an Opencart partner by using the Resources link at the top of the site to get this done as a custom job.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by matthewbaynham » Wed Nov 25, 2020 12:57 am

What Java code?
My Java code. I just did some computer programming and wrote an application in Java to insert products into the MySQL database from a text file. It just has those two little problems I mentioned in my original post.

New member

Posts

Joined
Fri Nov 01, 2019 9:18 pm

Post by straightlight » Wed Nov 25, 2020 12:59 am

matthewbaynham wrote:
Wed Nov 25, 2020 12:57 am
What Java code?
My Java code. I just did some computer programming and wrote an application in Java to insert products into the MySQL database from a text file. It just has those two little problems I mentioned in my original post.
Ok.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by sw!tch » Wed Nov 25, 2020 1:46 am

matthewbaynham wrote:
Wed Nov 25, 2020 12:33 am
Where in the MySQL database do these zero's come from in the sub-categories?
Comes from the getTotalProducts count -
https://github.com/opencart/opencart/bl ... ry.php#L43

You can further reference the model.
https://github.com/opencart/opencart/bl ... t.php#L416
Last edited by sw!tch on Wed Nov 25, 2020 2:00 am, edited 1 time in total.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by straightlight » Wed Nov 25, 2020 1:53 am

Take note that the referenced model on the above includes product variants that opencart.com does not yet provide on the named links called 'stable' from the downloads.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by sw!tch » Wed Nov 25, 2020 1:57 am

straightlight wrote:
Wed Nov 25, 2020 1:53 am
Take note that the referenced model on the above includes product variants that opencart.com does not yet provide on the named links called 'stable' from the downloads.
Pretty sure I referenced 3.0.3.6 is it showing the master branch for you?

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by straightlight » Wed Nov 25, 2020 1:58 am

The link you referred is a contributed file. The opencart/opencart repository is for the master branch.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by sw!tch » Wed Nov 25, 2020 2:01 am

Updated. Does that when you copy as permalink still it was referencing the correct branch.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by matthewbaynham » Wed Nov 25, 2020 2:04 am

Thank you.

New member

Posts

Joined
Fri Nov 01, 2019 9:18 pm

Post by matthewbaynham » Wed Nov 25, 2020 8:20 am

  1. I dumped a copy of the database back end into a text file.
  2. Then I used the admin page of Opencart to fix one category.
  3. Then I dumped another copy of the database back end.
  4. I installed Kompare (because it's a wrapper for the diff command). I found the differences in the back end before and after I fixed on category.
The problem was the oc_category_path needed to have a complex pattern of records. This solved both problems.

New member

Posts

Joined
Fri Nov 01, 2019 9:18 pm

Post by sw!tch » Wed Nov 25, 2020 11:26 am

Mark this topic as solved if you have no more issues.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by matthewbaynham » Sun Nov 29, 2020 5:55 pm

sw!tch wrote:
Wed Nov 25, 2020 11:26 am
Mark this topic as solved if you have no more issues.
How do you mark a topic as solved?

There doesn't seem to be any button on this website saying "solved".

New member

Posts

Joined
Fri Nov 01, 2019 9:18 pm

Post by straightlight » Sun Nov 29, 2020 10:03 pm

matthewbaynham wrote:
Sun Nov 29, 2020 5:55 pm
sw!tch wrote:
Wed Nov 25, 2020 11:26 am
Mark this topic as solved if you have no more issues.
How do you mark a topic as solved?

There doesn't seem to be any button on this website saying "solved".
Edit the first post and add [SOLVED] in front of the subject line.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: Baidu [Spider], JessiesBoutique, pprmkr and 516 guests