June 24, 201412 yr Does anyone know if there exists a Magento equivalent of http://codex.wordpress.org/Conditional_Tags ? I could only find this so far: http://wastelandgraphics.com/magento-if-statements/
June 24, 201412 yr Found this one - http://www.creativemgroup.com/creative-media-web-services/magento-blog/25-magento-using-conditional-attributes-for-display Seems it uses PHP logic to query the item (_item) with an attribute (isSaleable)... <?php if($_item->isSaleable()): ?> Preorder is available <?php else: ?> Preorder is not available <?php endif; ?> Edited June 24, 201412 yr by BlueDreamer
June 24, 201412 yr Author I find the conditional logic a bit confusing, as there are so many ways to do the same thing.
June 24, 201412 yr Lol that's the way with systems like these, you get used to it. If you've worked with the likes of ExpressionEngine or Craft it's second nature even though they both use a far simpler syntax and not use raw PHP.
June 24, 201412 yr Author Thank you everyone I am not trying to do anything in particular, just wondered if a list with all possible conditional statements existed The conditionals themselves are just pure php anyway (in both magento and wordpress), but both systems provide helper methods that return a boolean (true or false) for certain conditions. Really you just need to find whether magento has a function or method somewhere that will return true or false for the condition you are interested in. This is it, I need to find the helpers / methods. I thought it all should be listed somewhere, just so people could refer to it when needed? I am going to have another search Edited June 24, 201412 yr by teodora
June 25, 201412 yr Author @@BlueDreamer Oh, thank you so much, that's great, not sure how I haven't come to it yet!
June 25, 201412 yr No probs, its quiet hard to find stuff! Also there's http://www.magentocommerce.com/knowledge-base/entry/creating-custom-variables which describes how to add custom variables
June 25, 201412 yr Author Thanks! I actually already learned about the custom variables, which would prove to e very useful
June 25, 201412 yr Author @@citypaul, thank you very much for your offer to help, it's really appreciated I guess the best way to describe what I am doing is trying to gather information, but not sure what to search / ask for. The thing is I am so used to Wordpress, the Magento templating is very different and I still do things the way I would have done with Wordpress. I figured out what I needed earlier and figured out there are 4 ways to do it (two of which, not very practical, though). Let's say one of my goals for now will be to figure out the conditions for almost everything, so I can make a "list" for future use - to just copy and paste when needed. Hope that make sense
June 26, 201412 yr I was looking for an output profiler, most CMS's have them. Found these which may be useful http://www.mgt-commerce.com/magento-developer-toolbar.html http://www.nublue.co.uk/blog/using-magento-profiler-to-speed-up-magento-performance/
Create an account or sign in to comment