ripthesystem Posted May 8, 2006 Posted May 8, 2006 Ok, putting together my first OSC store and it's almost done! Here's the deal: The majority of the products in the store have dropdown options to choose from. 1 of the items only has a Custom field that allows the user to enter in their own text for the item. I want to put a link(just an HTML link) on ALL the items, except for the item with the Custom Type Option. I've found that I can put the link in the product_info.php but then it shows for ALL the items including the item with the Custom Type Option. My thought on this was that I could do a workaround by creating a 2nd product_info.php... let's call it product_info2.php. That way product_info.php would have the link and product_info2.php would not. Every item in the store would be called by product_info.php except for the Custom Type item which would be called by product_info2.php. What I'm trying to figure out is, from the main menu in the category where you would click on the item with the Custom Type, how would you call product_info2.php just for that one item? It seems that the menu system for OSC is built dynamically so I'm not sure it's possible. Anyone have any clues on either how to call product_info2.php for just 1 item or how to exclude a chunk of HTML (the link) for just 1 item?? Thanks!
ripthesystem Posted May 8, 2006 Author Posted May 8, 2006 hmmm, anyone? I'll try to ask the question more simply: is it possible to add a link to all products in the store except for 1 product? if not.. is it possible to add a link to the main categories menu that links to something other than the normal category/product listing?
ripthesystem Posted May 8, 2006 Author Posted May 8, 2006 guess I'll just keep plugging away blindly :ph34r:
Terra Posted May 8, 2006 Posted May 8, 2006 an if statement should do the trick. On product_info.php include this code where you want the link to go: <?php if ($product_info['products_id'] !== '30') { echo 'here goes the stuff you want to show'; } ?> !== means if X IS NOT EQUAL to Y and for 30 just type in your product id NB: not tested, and it's late at night, so back up your file first & post again if it ain't working :P Terra My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad) and how to solve the invoice already paid error General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **
ripthesystem Posted May 8, 2006 Author Posted May 8, 2006 Works perfectly! Thanks! Even makes sense too!
Terra Posted May 9, 2006 Posted May 9, 2006 Works perfectly! Thanks!Even makes sense too! Great - honestly didn't think it would work at first attempt. Actually the whole "if / else" thing is really useful with osCom, firstly because the site uses them a lot, so once you know how it works, you can much better understand how some of the big pages are constructed (index.php / product_info.php) and secondly, because it's quite easy to create your own statements. As usual php.net has the full manual. Terra My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad) and how to solve the invoice already paid error General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **
Recommended Posts
Archived
This topic is now archived and is closed to further replies.