Post by PMAGO » Tue Nov 10, 2020 7:53 pm

I've created a new table in my database called "7dq_product_cat_level"

CREATE TABLE r7dq_product_cat_level AS
SELECT product_id,
r7dq_product_to_category.category_id
FROM r7dq_product_to_category
LEFT JOIN r7dq_category_path ON r7dq_category_path.category_id = r7dq_product_to_category.category_id
WHERE r7dq_category_path.path_id = r7dq_category_path.category_id

But when i make some changes in my product edit page (adding a new category for example), my new table is not updating automatically.

I'm not very good at coding so if you could help me that would be great.

What code lines do i have to write in my product.php to force that update before getting the data ?

Thank you !
My OC version : 3.0.3.6
Last edited by PMAGO on Thu Nov 12, 2020 11:20 pm, edited 1 time in total.

Newbie

Posts

Joined
Wed Oct 16, 2019 11:20 pm

Post by straightlight » Tue Nov 10, 2020 8:40 pm

I'm not very good at coding so if you could help me that would be great.
You can, either, 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, or contact me directly via PM 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 PMAGO » Tue Nov 10, 2020 8:56 pm

I can also wait for somebody kind enough to help me here...
"I'm not very good at coding" doesn't mean that i don't want to learn.
I'm sure it's nothing more than one or two code lines.
i thought that i could find some free help here...
Last edited by PMAGO on Thu Nov 12, 2020 3:21 pm, edited 1 time in total.

Newbie

Posts

Joined
Wed Oct 16, 2019 11:20 pm

Post by IP_CAM » Tue Nov 10, 2020 9:24 pm

Re: Custom field - Choice list
Not very familiar with that, sorry.
My OC version : 3.0.3.6 + Multi vendor marketplace module + Journal 3 theme
Are you really expecting free Support on this far from default Install ? :D

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by straightlight » Tue Nov 10, 2020 9:35 pm

"I'm not very goog at coding" doesn't mean that i don't want to learn.
That may also mean that you may want to benefit from people for free.

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 PMAGO » Tue Nov 10, 2020 10:55 pm

Ok i give up... nothing good here.
Admin can erase my stupid demand.

Very sad world

Newbie

Posts

Joined
Wed Oct 16, 2019 11:20 pm

Post by IP_CAM » Tue Nov 10, 2020 11:15 pm

Well, the only sad thing is, that some don't understand, that this Forum has
not been created, to offer assistance, if one uses commercially obtained Mods.
Especially when it comes to very comprehensive Code like Journal. In addition
to the well known Fact, that many come here, using a stolen Edition of Journal,
and then expect honest People, to eventually assist them, even for free ... :crazy:
And to avoid Problems, they just don't mention, what they use in detail on Mods.
But honest Business just does not work this way, like it or not ... ::)
Good Luck !
Ernie

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by PMAGO » Tue Nov 10, 2020 11:20 pm

Ok, i understand your point, but why are you talking about Journal ?
My question has nothing to do with it !!
I've created a simple table using SQL code that doesn't udpdate, that's all

Moreover my version of Journal is not a stolen one. I've paid for it and when i have questions about it, i contact the Journal support.
Last edited by PMAGO on Tue Nov 10, 2020 11:28 pm, edited 1 time in total.

Newbie

Posts

Joined
Wed Oct 16, 2019 11:20 pm

Post by straightlight » Tue Nov 10, 2020 11:28 pm

PMAGO wrote:
Tue Nov 10, 2020 11:20 pm
Ok, i understand your point, but why are you talking about Journal ?
My question has nothing to do with it !!
I've created a simple table using SQL code that doesn't udpdate, that's all
Regardless of Journal, in this scenario, you're posting about custom codes where these requests should be handled commercially. Forum supporters assists and guides OP users where they need to go but they don't have to assist OP users for custom codes, especially for free, in any case. These guidelines are also implicit in the forum rules.

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 PMAGO » Tue Nov 10, 2020 11:29 pm

Ok then. It's clear for me.

Newbie

Posts

Joined
Wed Oct 16, 2019 11:20 pm

Post by straightlight » Tue Nov 10, 2020 11:36 pm

PMAGO wrote:
Tue Nov 10, 2020 11:29 pm
Ok then. It's clear for me.
Moreover my version of Journal is not a stolen one. I've paid for it and when i have questions about it, i contact the Journal support.
As per your added text, since you're also using Journal, contact Journal support for custom jobs with their themes or create a new service request in the Commercial Support section of the forum to accomplish what you need in order to complete this task 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 PMAGO » Tue Nov 10, 2020 11:49 pm

Ok, thank you for your information, but i won't do that.

I'll find another way to solve my little problem.
Some other forums or openclass sites are full of helpfull people.
I didn't know that this forum was only for commercial purpose.
Bye

Newbie

Posts

Joined
Wed Oct 16, 2019 11:20 pm

Post by straightlight » Tue Nov 10, 2020 11:54 pm

PMAGO wrote:
Tue Nov 10, 2020 11:49 pm
Ok, thank you for your information, but i won't do that.

I'll find another way to solve my little problem.
Some other forums or openclass sites are full of helpfull people.
I didn't know that this forum was only for commercial purpose.
Bye
No problem, goodbye.

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 paulfeakins » Wed Nov 11, 2020 7:10 pm

PMAGO wrote:
Tue Nov 10, 2020 8:56 pm
I can also wait for somebody kind enough to help me here...
"I'm not very goog at coding" doesn't mean that i don't want to learn.
I'm sure it's nothing more than one or two code lines.
i thought that i could find some free help here...
I think the others have been a bit harsh.

If you are prepared to wait, sometimes some kind soul will actually write a lot of code and paste it here but please understand many of us make a living by writing code and we don't want the forum to become a free work requests forum.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by PMAGO » Thu Nov 12, 2020 3:19 pm

It's ok. I found the solution on my own, somewhere else... for free.

Thank you all for having explained me what this forum is made for. I was just a bit naive.
I thought that i've bought enough custom modules in your marketplace to get a bit of help here. I was wrong.

Just think that sometimes a free help for starting can lead to a commercial business... You've just lost a potential customer for the future (maybe more...).

Cheers.

Newbie

Posts

Joined
Wed Oct 16, 2019 11:20 pm

Post by straightlight » Thu Nov 12, 2020 8:50 pm

Just think that sometimes a free help for starting can lead to a commercial business... You've just lost a potential customer for the future (maybe more...).
Potential would be a big word, in this case, due to the contributions you may not have provided yourself in order to convince others to lead your projects into commercial business. There's a difference when these scenarios comes across.

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 khnaz35 » Thu Nov 12, 2020 8:54 pm

PMAGO wrote:
Thu Nov 12, 2020 3:19 pm
It's ok. I found the solution on my own, somewhere else... for free.
If you found it why not to share your knowledge with others too ??? Besides what goes around comes around ;)

Got an urgent question that’s keeping you up at night? There might just be a magical inbox ready to help: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by PMAGO » Thu Nov 12, 2020 11:11 pm

If you found it why not to share your knowledge with others too
Yes, you're right.
So here is the solution i found. Instead of creating a new table in my database with SQL code and looking for a solution to update it, i've created a function which gets the data i need from the two existing tables :

public function getCategories($product_id) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_to_category p2c LEFT JOIN " . DB_PREFIX . "category_path cp ON (p2c.category_id = cp.category_id) WHERE cp.level = 1 AND cp.category_id = cp.path_id AND p2c.product_id = '" . (int)$product_id . "'");
return $query->rows;
}

Just 4 lines of code.... nothing more.
Just tell me how much would it have cost me to pay someone to do that ?
Last edited by PMAGO on Thu Nov 12, 2020 11:28 pm, edited 1 time in total.

Newbie

Posts

Joined
Wed Oct 16, 2019 11:20 pm

Post by straightlight » Thu Nov 12, 2020 11:22 pm

PMAGO wrote:
Thu Nov 12, 2020 11:11 pm
If you found it why not to share your knowledge with others too
Yes, you're right.
So here is the solution i found. Instead of creating a new table in my database with SQL code and looking for a solution to update it, i've created a function which gets the data i need in the two existing tables :

public function getCategories($product_id) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_to_category p2c LEFT JOIN " . DB_PREFIX . "category_path cp ON (p2c.category_id = cp.category_id) WHERE cp.level = 1 AND cp.category_id = cp.path_id AND p2c.product_id = '" . (int)$product_id . "'");
return $query->rows;
}

Just 4 lines of code.... nothing more.
Just tell me how much would it have cost me to pay someone to do that ?
Better to create an Event model to do that. As for the cost, it would depend on the assigned user doing the task for you.

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 PMAGO » Thu Nov 12, 2020 11:49 pm

Maybe... you're the professionnal of coding, i'm not.
I've just analysed the existing Opencart code and adapted it to my need... and it's working good.
Why should i've done differently ?

Newbie

Posts

Joined
Wed Oct 16, 2019 11:20 pm
Who is online

Users browsing this forum: No registered users and 2 guests