View Single Post
Old 11-25-2013, 05:56 PM  
alcstrategy
Confirmed User
 
Industry Role:
Join Date: May 2012
Posts: 124
Quote:
Originally Posted by mkx View Post
I suck with php. Don't post unless i spent over an hour trying to figure out a simple equation.

What is the correct way to say this?

If the item is part1, part2, or the ebay fees are under 25, sig is 0, otherwise sig is 1.

I tried putting the brackets in different spots with no luck, sig keeps being declared as 0 even though the item is for part1 and the ebay fees are over 25.

Below is the most recent code I tried.
Code:
<?php if ($item->SKU != 'part1' || $item->SKU != 'part2' || $recipient->ebay_fees < '25'){ $sig='0';} else { $sig='1';} print $sig ?>
why are you using strings for ints like $recipient->ebay_fees < '25' dont use quotations because it is an integer not string. Same thing with the assignments.

php isnt stricly typed but just for purposes of practice

if (($item->SKU != 'part1' || $item->SKU != 'part2') || $recipient->ebay_fees < '25'){ $sig='0';} else { $sig='1';} should work

Last edited by alcstrategy; 11-25-2013 at 05:58 PM..
alcstrategy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote