steve12345 Posted June 20, 2013 Share Posted June 20, 2013 (edited) Hi Guys Apart from coding in vb over 15 years ago I have not had to keep up with new languages, coding practices etc. I now find myself with an ecommerce store which isn't functioning properly and I need to repair it. I have managed to get everything working except a couple of lines of php and this where I know you are the experts. I want to take this statement: if($_category->getIsActive()) and change it so that it meets that criteria but adds on AND the category is not like "." While Im at it, if anybody here knows Magento and can give me the variant name for the thumbnail url it would be great. The developers have used "$imageurl" throughout the system so my thumnail images are being compressed into rediculously small, unreadable pictures. Thanks in advance Steve Edited June 20, 2013 by steve12345 Quote Link to comment https://forums.phpfreaks.com/topic/279379-and-constraint/ Share on other sites More sharing options...
trq Posted June 20, 2013 Share Posted June 20, 2013 && is the logical "and" operator. Where you going to find the data you need from the category is any ones guess though sorry. Quote Link to comment https://forums.phpfreaks.com/topic/279379-and-constraint/#findComment-1437002 Share on other sites More sharing options...
steve12345 Posted June 20, 2013 Author Share Posted June 20, 2013 (edited) Thanks trq My logic is telling me the same variable used in the first part of the statement should be the same as in the second part. For example if(($_category->getIsActive()) && ($_category <> '.'())) Come to think of it I dont know if the <> is valid or if I have to enclose the . in the inverted commas Edited June 20, 2013 by steve12345 Quote Link to comment https://forums.phpfreaks.com/topic/279379-and-constraint/#findComment-1437015 Share on other sites More sharing options...
trq Posted June 20, 2013 Share Posted June 20, 2013 You logic would be telling you incorrectly. $_category is an object, you will need to call a method or a property of said object. Also, it is common place to use != rather than <> in PHP. Your end result might look something like: if ($_category->getIsActive() && $_category->name != '.') { // rest of code } Quote Link to comment https://forums.phpfreaks.com/topic/279379-and-constraint/#findComment-1437019 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.