Post by KeyGeN » Thu Aug 05, 2021 4:20 am

Hello there

Is it possible for us to put a link to the site and list only the products that are out of stock?
opencart 2.3

User avatar
New member

Posts

Joined
Tue Feb 13, 2018 2:06 pm

Post by straightlight » Thu Aug 05, 2021 5:32 am


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 by mona » Thu Aug 05, 2021 5:33 am

Doubt you will find anything it is an odd/obscure request

You could try to adapt this
https://www.opencart.com/index.php?rout ... n_id=37492
Create a category with all products and use the above backwards?

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by paulfeakins » Thu Aug 05, 2021 7:01 pm

KeyGeN wrote:
Thu Aug 05, 2021 4:20 am
Is it possible for us to put a link to the site and list only the products that are out of stock?
opencart 2.3
If you can't find an extension, you could pay a developer such as ourselves or post a job in the Commercial Support Forum.

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


User avatar
Guru Member
Online

Posts

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

Post by grgr » Fri Aug 06, 2021 10:34 pm

I did an extension for that a long time ago, so it's for 1.5. Wouldn't take a lot to 2.x it, I've just never had the time to deal with it, but it's free to download so you can use it as the base.

https://www.opencart.com/index.php?rout ... on_id=9477

-
Image Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by straightlight » Sat Aug 07, 2021 12:14 am

grgr wrote:
Fri Aug 06, 2021 10:34 pm
I did an extension for that a long time ago, so it's for 1.5. Wouldn't take a lot to 2.x it, I've just never had the time to deal with it, but it's free to download so you can use it as the base.

https://www.opencart.com/index.php?rout ... on_id=9477
Can't see any TPL / TWIG folder or file in your extension while $this->template calls for it.

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 KeyGeN » Sat Aug 07, 2021 2:00 am

yes this is exactly what i wanted but i couldn't figure it out for 2.3

User avatar
New member

Posts

Joined
Tue Feb 13, 2018 2:06 pm

Post by by mona » Sat Aug 07, 2021 2:32 am

grgr is really nice - PM him, ask nicely, and offer him a cuppa and I am sure he will help you
be aware he is not on here so much but he will probably answer on his extension pages

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by straightlight » Sat Aug 07, 2021 8:29 pm

If you ever find the missing TWIG file, you could always add it up to this install for v3.x releases.

Attachments


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 JNeuhoff » Sat Aug 07, 2021 8:50 pm

You could use the extension/module/special.tpl (OC 2.3.x) or extension/module/special.twig (OC 3.x) for this.

E.g. in the OC 2.3.x controller (catalog/controller/extension/module/oosproducts.php), use something like

Code: Select all

return $this->load->view('extension/module/special', $data);
Personally, I'd just copy the special module, rename it to e.g. outofstock, and then just modify the DB query.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by straightlight » Sat Aug 07, 2021 8:53 pm

JNeuhoff wrote:
Sat Aug 07, 2021 8:50 pm
You could use the extension/module/special.tpl (OC 2.3.x) or extension/module/special.twig (OC 3.x) for this.

E.g. in the OC 2.3.x controller (catalog/controller/extension/module/oosproducts.php), use something like

Code: Select all

return $this->load->view('extension/module/special', $data);
Personally, I'd just copy the special module, rename it to e.g. outofstock, and then just modify the DB query.
I'd simply build an information page to show the link in order for the getInformation() method model to pull the pre-built page from the core rather than adding the link manually to the footer like that. I just converted the whole thing but I do think the way it was originally built was quite a bit over-thinked.

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 grgr » Sun Aug 08, 2021 10:33 pm

I have added a 2.x version though only actually tested it on 2.3.0.2

-
Image Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by grgr » Sun Aug 08, 2021 10:35 pm

straightlight wrote:
Sat Aug 07, 2021 12:14 am

Can't see any TPL / TWIG folder or file in your extension while $this->template calls for it.
I just used the specials template as it is essentially the same page data-layout, just for out of stock products.

-
Image Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by straightlight » Sun Aug 08, 2021 11:28 pm

grgr wrote:
Sun Aug 08, 2021 10:35 pm
straightlight wrote:
Sat Aug 07, 2021 12:14 am

Can't see any TPL / TWIG folder or file in your extension while $this->template calls for it.
I just used the specials template as it is essentially the same page data-layout, just for out of stock products.
There are better ways to handle the data-layout - for sure.

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 grgr » Mon Aug 09, 2021 10:39 am

grgr wrote:
Sun Aug 08, 2021 10:35 pm
straightlight wrote:
Sat Aug 07, 2021 12:14 am

I just used the specials template as it is essentially the same page data-layout, just for out of stock products.
There are better ways to handle the data-layout - for sure.
You do confuse me sometimes! If I was to add a template for the out of stock products, it would essentially be a carbon copy of the specials template, with a different name, so why not just use the specials template?

If the users theme has been modified a bit or by a "normal" theme, then it should just work without the user having to make any adjustment, on the basis that it is for free and therefore comes with no support for that sort of thing, seems to make sense to me.

Unless I'm missing something?

-
Image Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by straightlight » Mon Aug 09, 2021 7:34 pm

grgr wrote:
Mon Aug 09, 2021 10:39 am
grgr wrote:
Sun Aug 08, 2021 10:35 pm
straightlight wrote:
Sat Aug 07, 2021 12:14 am

I just used the specials template as it is essentially the same page data-layout, just for out of stock products.
There are better ways to handle the data-layout - for sure.
You do confuse me sometimes! If I was to add a template for the out of stock products, it would essentially be a carbon copy of the specials template, with a different name, so why not just use the specials template?

If the users theme has been modified a bit or by a "normal" theme, then it should just work without the user having to make any adjustment, on the basis that it is for free and therefore comes with no support for that sort of thing, seems to make sense to me.

Unless I'm missing something?
The use of Events does not require to duplicate a method model nor to create an XML file to target the common/footer controller file as to increase probabilities of conflicts.

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 grgr » Mon Aug 09, 2021 8:31 pm

straightlight wrote:
Mon Aug 09, 2021 7:34 pm
The use of Events does not require to duplicate a method model nor to create an XML file to target the common/footer controller file as to increase probabilities of conflicts.
Ahh, ok, now I get you.

If this was on OC3 then I would possibly use events(s) for this. I am slowly trying to remove all xml and move over to events for OC3 (though there are still some things that seem impossible with them, though 4.x seems to have that covered now).

As for OC2.x specifically, I just don't use Events, I find them cluncky, inconvenient and lacking. OC3 implementation I find much better and use extensively for some things.

-
Image Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by straightlight » Mon Aug 09, 2021 8:34 pm

grgr wrote:
Mon Aug 09, 2021 8:31 pm
straightlight wrote:
Mon Aug 09, 2021 7:34 pm
The use of Events does not require to duplicate a method model nor to create an XML file to target the common/footer controller file as to increase probabilities of conflicts.
Ahh, ok, now I get you.

If this was on OC3 then I would possibly use events(s) for this. I am slowly trying to remove all xml and move over to events for OC3 (though there are still some things that seem impossible with them, though 4.x seems to have that covered now).

As for OC2.x specifically, I just don't use Events, I find them cluncky, inconvenient and lacking. OC3 implementation I find much better and use extensively for some things.
Events have no difference with the controllers and models (or very few) whether it originates from OC v2.3x or OC v3.x releases. However, you are correct regarding the bit limitations but that doesn't mean it shouldn't be used for being cluncky, inconvenient and lacking since controllers shows no issues based on the conflicts it could avoid on smaller controller files.

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: No registered users and 71 guests