gofer_p Posted January 9, 2011 Share Posted January 9, 2011 I want to have the on sale image or a special image when a product is on special. I know I can just check the on sale check box in the back office but when a special expires I will have to manually uncheck this box. If the sale check box is checked and can be automatically unchecked when special ends it will solve my issue.Is there a way to accomplish this? 1 Link to comment Share on other sites More sharing options...
rocky Posted January 12, 2011 Share Posted January 12, 2011 Change line 189 of product.tpl in your theme's from: {if $product->on_sale} to: {if $product->on_sale && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $product->reduction_from))} This should display the "On sale" icon only if the current time is between the reduction times. You will need to do a similar change in product-list.tpl. Link to comment Share on other sites More sharing options...
gofer_p Posted January 13, 2011 Author Share Posted January 13, 2011 Tried it but the sale icon did not show. I still had to click it and it did not go away when the time expired. Link to comment Share on other sites More sharing options...
cammo Posted June 30, 2011 Share Posted June 30, 2011 I'm interested in this also..I've set up my template to show a 'On Sale' image if an item is on sale, otherwise if it's New it will show a 'new' image, and then otherwise it will show nothing. (Using IF statements of course)Some of my sale items ended and they still show my 'On Sale' image (obviously because the checkbox in product setup is ticked to show the 'On sale' image.Like gofer, I'd like this to be automatic so the checkbox effectively says "if you check this, the product will display the 'On sale" image while the product is on sale. And to that end it would be nice to set this to the default checkbox state so I don't have to check it on every product.I'll give rocky's code a go aswell and report back.. Link to comment Share on other sites More sharing options...
cammo Posted July 9, 2011 Share Posted July 9, 2011 Nah, didn't work for me either.My product still showed by 'On Sale' image despite the sale having ended.Anyone got any ideas??Seems a bit silly to have to remember to check a box to show my 'On Sale' images when the item is on sale for a limited period?! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now