CGhoST Posted December 6, 2012 Posted December 6, 2012 On the main page i have special products with a box around the product. I also have products which do not have specials displaying on the main page. What i would like is to have a image on the top corner of the box (special.jpg) if the item is on special. But would like the non special products to not have this image displayed. Could someone please help me as to how i can program this conditon. I believe this would be helpful for others as well who would like to have an image on a product to emphasise having some special property such as special, new, sale, etc.
♥bruyndoncx Posted December 6, 2012 Posted December 6, 2012 one of my longtime wishes too - haven't found time to figure it out yet, something to do with superimposing images in css KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt
burt Posted December 6, 2012 Posted December 6, 2012 Very very simple. I'll blog a tutorial tomorrow.
CGhoST Posted December 7, 2012 Author Posted December 7, 2012 Hi Burt Did you ever get a chance to write that blog please? Or could you please tell us here?
♥kymation Posted December 8, 2012 Posted December 8, 2012 This is not all that hard, although the image code needs to be changed everywhere you want the overlay to appear. It might be better to modify tep_image() and then just tell it when the overlay is needed. Hmmm ... I need to go try that. I'll put up the basics if Gary is too busy to get to it. Regards Jim See my profile for a list of my addons and ways to get support.
♥kymation Posted December 8, 2012 Posted December 8, 2012 Ok, I lied. This was just too much fun to pass up. Sorry, Burt. The code is available on my server here. Note that this is not a full addon. Consider it Beta code. I've tested it and it works, but more work is needed. The main thing is that the overlay is only done on the Product Listing (Category) page. Adding it to the other pages will take some PHP coding. It's not complicated, but a basic knowledge of PHP is needed. There are also no instructions other than what's here. Basically this adds another parameter to the tep_image() function. It defaults to false, so the overlay normally does not show. If you want it to show, you need some logic that will add true to that last parameter. The code for this is in includes/modules/product_listing.php so you can see what it does. I included a corner image to use with this. If you want something else, feel free to make your own image. It needs to be a PNG with the main part of the image transparent so the product image will show through. The image needs to be named specials_overlay.png, or you need to change the name in the code. There are three additional images provided that you can use. You will need to crop/scale those images to fit your product image size. Edit: Meh, images still don't work. Screenshot here: http://www.kymation.com/pub/specials_image_overlay_screenshot.jpg Regards Jim See my profile for a list of my addons and ways to get support.
burt Posted December 8, 2012 Posted December 8, 2012 No worries Jim - good to see different approaches. :thumbsup: Mine approach at http://www.clubosc.com/add-a-special-banner.html
CGhoST Posted December 8, 2012 Author Posted December 8, 2012 wow .. thanks guys. Really appreciate it. I also have a contribution called Featured Products installed which replaces the main content on screen with selected products i wish for from admin which could be normal products and special priced products. http://addons.oscommerce.com/info/7832 Would these solutions work with this contribution as well?
CGhoST Posted December 8, 2012 Author Posted December 8, 2012 Burt thank you so much. I put in the if and else statement and now it works perfectly. Thank you also kymation. I wish i could be as proficient in oscommerce as you two are alas i am not. I am glad we all have you two helping us out who want to learn and get better. Thank you so much again
♥kymation Posted December 9, 2012 Posted December 9, 2012 This has been packaged as a complete Addon. See the support thread if you're interested. @@CGhoST -- We didn't become proficient in osCommerce overnight, or at least I didn't. I started out with a copy of osC and no knowledge of PHP or SQL. I still can't claim that I know it all, but I've learned to work with it well enough. Just keep learning and you can do the same. Regards Jim See my profile for a list of my addons and ways to get support.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.