Jump to content

AND constraint


steve12345

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/279379-and-constraint/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/279379-and-constraint/#findComment-1437015
Share on other sites

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 }
Link to comment
https://forums.phpfreaks.com/topic/279379-and-constraint/#findComment-1437019
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.