♥JcMagpie Posted September 11, 2019 Share 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. valquiria23 1 Quote Link to comment Share on other sites More sharing options...
♥JcMagpie Posted September 11, 2019 Author Share 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. valquiria23 1 Quote Link to comment Share on other sites More sharing options...
valquiria23 Posted September 11, 2019 Share 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. Quote Community Oscommerce fan You'll find the latest osC community version here. Link to comment Share on other sites More sharing options...
kgtee Posted September 11, 2019 Share Posted September 11, 2019 Wow! This add-on is excellent! It is an eye opener for a learner like me. Thanks! Quote Link to comment Share on other sites More sharing options...
sjdmedia-ltd Posted April 4, 2020 Share 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 Quote Link to comment Share on other sites More sharing options...
Patty Posted April 25, 2020 Share 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? Quote Patty Link to comment Share on other sites More sharing options...
Patty Posted May 5, 2020 Share 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 Quote Patty Link to comment Share on other sites More sharing options...
Peper Posted June 12, 2020 Share 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. Patty 1 Quote Getting the Phoenix off the ground Link to comment Share on other sites More sharing options...
Peper Posted June 23, 2020 Share 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 Quote Getting the Phoenix off the ground Link to comment Share on other sites More sharing options...
Peper Posted June 23, 2020 Share 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 Quote Getting the Phoenix off the ground Link to comment Share on other sites More sharing options...
Patty Posted June 25, 2020 Share 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. 👍 Quote Patty Link to comment Share on other sites More sharing options...
♥peterpil19 Posted June 26, 2020 Share 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 Patty and Peper 2 Quote 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.