Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Need If statement help!

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-09-2010, 09:02 AM
 
sharingsunshine sharingsunshine is offline
 

Senior Member
  
Join Date: Aug 2005
Location: Palmyra, VA
Posts: 149
 

Default Need If statement help!

Hello,

I have a function for displaying a message if certain shipping criteria are met.

1. shipping address isn't blank
2. they have put PO box in their ship to
3. they haven't already selected Parcel Post

{if $po_address ne "" and $cart.shippingid ne "51"} this works fine. Now I have a new method of shipping that I have to test for called Mail Innovations.

So this is what it needs to test for

1. shipping address isn't blank
2. they have put PO box in their ship to
3. they haven't already selected Parcel Post or Mail Innovations - if they have no need to show warning.

I have tried several ways to test for it but they don't seem to be working

{$userinfo.s_address} {if $po_address ne "" and ($cart.shippingid ne "122" or $cart.shippingid ne "51")}

Can someone tell me what I am doing wrong?

Thanks,

Randal
__________________
***********************
Visit Our Other Web Sites!
∙ Nutritional Herbs and Supplements
<a href="http://www.theherbsplace.com"> The Herbs Place </a>
∙ Frugal Ideas and a Forum To Submit Your Questions
<a href="http://www.thefrugallife.com"> The Frugal Life </a>
∙ Healthy and Natural Pet Products
<a href="http://www.healthypetcorner.com"> Healthy Pet Corner </a>
***********************

Joined 08/02/05
X-Cart Gold Version 4.3.2
Linux RedHat Enterprise
Reply With Quote
  #2  
Old 08-09-2010, 09:37 AM
 
hooter hooter is offline
 

X-Adept
  
Join Date: Dec 2004
Posts: 519
 

Default Re: Need If statement help!

Try changing your boolean constructs - your current method of using an "or" conjunction to test for "not equals" condition will not give you desired results.
Change:
Code:
{$userinfo.s_address} {if $po_address ne "" and ($cart.shippingid ne "122" or $cart.shippingid ne "51")}
to this:
Code:
{$userinfo.s_address} {if $po_address ne "" and ($cart.shippingid eq "122" or $cart.shippingid eq "51")}{else}DISPLAY WARNING{/if}
__________________
Blog for X-Cart | Ebay Auction Manager
Reply With Quote

The following user thanks hooter for this useful post:
sharingsunshine (08-09-2010)
  #3  
Old 08-09-2010, 10:30 AM
 
sharingsunshine sharingsunshine is offline
 

Senior Member
  
Join Date: Aug 2005
Location: Palmyra, VA
Posts: 149
 

Default Re: Need If statement help!

Thanks that was a big help.
__________________
***********************
Visit Our Other Web Sites!
∙ Nutritional Herbs and Supplements
<a href="http://www.theherbsplace.com"> The Herbs Place </a>
∙ Frugal Ideas and a Forum To Submit Your Questions
<a href="http://www.thefrugallife.com"> The Frugal Life </a>
∙ Healthy and Natural Pet Products
<a href="http://www.healthypetcorner.com"> Healthy Pet Corner </a>
***********************

Joined 08/02/05
X-Cart Gold Version 4.3.2
Linux RedHat Enterprise
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:53 AM.

   

 
X-Cart forums © 2001-2020