php - Magento: Need an if case for is a product name/sku/id is equal to X
Going to try to type this is the easiest way I can.
What I am looking to do is filter options I'm coding by hand (long story) by creating a large if statement of if elses.
IE: If the product sku=1234 then show the following. I'd only have about 14 products so this isn't as insane a thought as I had thought. But I can't seem to figure out the code I would need.
Please let me know if you'd need me to provide more details and any help is greatly appreciated.
Thank you
Answer
Solution:
if($product->getSku() == 12345)
What are you talking about!? :-)
You want to filter the products?
Build a observer, listen to the product_collection_load_before event, check the params sent to the action and then change the product_colletion where.