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

Edited by steve12345
Link to comment
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

Edited by steve12345
Link to comment
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.