♥JcMagpie 1,693 Posted September 11, 2019 JcM No Stock Header Tags-V1.0 V1.0 by JcMagpie based on idea by BrockleyJohn A simple header_tag module to let you disable buy buttons for products with zero stock. This is a standalone add-on and makes no changes to core files. That’s it simply copy all files of the into relevant sections and go to admin modules /header tags and install. Has been tested on Phoenix 1.0.2.2 only. can be seen on thi test site You can expand it function if required. a) change class success to danger to make button red? b) replace text from buy and add to cart, to no stock? That's it enjoy. 1 valquiria23 reacted to this Share this post Link to post Share on other sites
♥JcMagpie 1,693 Posted September 11, 2019 Has been updated to version 1.1 JcM No Stock Header Tags-V1.1 Updated to allow color to be set in admin and to display no stock message and remove buy text. 1 valquiria23 reacted to this Share this post Link to post Share on other sites
valquiria23 240 Posted September 11, 2019 Thank you very much Zahid @JcMagpiefor packing this magnificent code to addon and making it available to the whole oscommerce community. This is the beauty of the community open code. Community Oscommerce fan You'll find the latest osC community version here. Share this post Link to post Share on other sites
kgtee 77 Posted September 11, 2019 Wow! This add-on is excellent! It is an eye opener for a learner like me. Thanks! Share this post Link to post Share on other sites
sjdmedia-ltd 0 Posted April 4, 2020 (edited) I have tried implementing this on the latest Phoenix 1.0.5.5 and there are some issues with it. It correctly changes the buy button to a colour and with the no stock text, but it also changes all the other buy buttons where there is stock to the same colour without any text/image. The buttons for the in stock items are active so it appears to be just a display issue. It also effects the other buttons on the page, for instance, the index page with the contact us and existing customers log in buttons that also become red with no text. Has anyone else seen this behaviour? If i only have in stock items, then the buttons behave as expected Is there another way to disable the "buy now" and "add to cart buttons" when the item is out of stock? Edited April 4, 2020 by sjdmedia-ltd Share this post Link to post Share on other sites
Patty 8 Posted April 25, 2020 Yes, same issue with v1.0.58 Buy now cart icon disappears and button changes to the same color as defined for the no stock button. Other than that, it's working as it should. Have you found a fix for that? Patty Share this post Link to post Share on other sites
Patty 8 Posted May 5, 2020 (edited) After hours of trying to figure this out (mind you, I'm not a coder, I think I finally found a fix for the above mentioned issues. This is my code. If someone could try it and confirm it's really working, I'll update the addon. Just replace the code between the script tags. File: includes/modules/header_tags/ht_jcm_no_stock.php <script> $(document).ready(function() { $('*[data-in-stock]').filter(function () { return $(this).data('in-stock') <= 0; }).each(function() { $(this).addClass('disabled fas fa-ban text-danger').text('$no_stock_text'); // use to change appearance $(this).attr('disabled', true); // $('btn-product-listing.btn-buy').addClass('text-white').text('$no_stock_text'); // $('.btn.btn-light').text(''); // $('.btn.btn-success.btn-product-info').addClass('text-white').text('$no_stock_text'); $('.btn.btn-success.btn-product-info').removeClass('btn-success text-danger').addClass('btn btn-product-info text-white $no_stock_color').text('$no_stock_text'); // $('.btn.btn-light').removeClass('btn btn-light').addClass('btn $no_stock_color'); // $(this).prepend('<span>{$no_stock_text}</span>'); }); }); </script> Edited May 5, 2020 by Patty Patty Share this post Link to post Share on other sites
Peper 13 Posted June 12, 2020 @Patty Thanks, just what i was looking for Seems there is no out of stock button or message in stock Phoenix. 1 Patty reacted to this Getting the Phoenix off the ground Share this post Link to post Share on other sites
Peper 13 Posted June 23, 2020 @JcMagpie @Patty I've found something wrong with this. For some products the Out of Stock button shows on products_info page, however my admin shows that qty is in stock, date is empty Getting the Phoenix off the ground Share this post Link to post Share on other sites
Peper 13 Posted June 23, 2020 27 minutes ago, Peper said: @JcMagpie @Patty I've found something wrong with this. For some products the Out of Stock button shows on products_info page, however my admin shows that qty is in stock, date is empty No worries, found Certified addon from Raiwa Getting the Phoenix off the ground Share this post Link to post Share on other sites
Patty 8 Posted June 25, 2020 Sorry for the late response. I've been away for the past few days. And JcMagpie seems to be MIA, I hope he's alright. I'll try to replicate the issue when I find some free time. But glad you've found an alternative for a supported addon. 👍 Patty Share this post Link to post Share on other sites
♥peterpil19 179 Posted June 26, 2020 (edited) 11 hours ago, Patty said: But glad you've found an alternative for a supported addon. 👍 You can't go wrong with an addon from @raiwa. @burt also has one if you contact him. Edited June 26, 2020 by peterpil19 2 Peper and Patty reacted to this CE PHOENIX SUPPORTER Support the Project, go PRO and get access to certified add ons Full-time I am a C-suite executive of a large retail company in Australia. In my spare time, I enjoying learning about web-design. Download the latest version of CE Phoenix from gitHub here Share this post Link to post Share on other sites