Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Conditional logic

Featured Replies

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 by BlueDreamer

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.

  • 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 by teodora

  • 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 :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.