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

Check for url paramater existance

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-18-2007, 02:32 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,471
 

Default Check for url paramater existance

Hello ..

Wondering if there is a way in smarty to find out if a certain parameter exists in the url's query string?

e.g: current url - product.php?productid=16137&cat=0&page=1&featured
and I need to check if the parameter 'featured' exists ...

{if $php_url.query_string eq "featured"} ... {/if} doesn't seem to work, because that outputs the whole query string ...

Can anyone help ?

Thanks

Shafiq :sK
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #2  
Old 10-18-2007, 02:57 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Check for url paramater existance

Try...
Code:
{if $php_url.query_string eq "productid=`$product.productid`&cat=0&page=1&featured"} THIS IS A FEATURED PRODUCT! {/if}
__________________
xcartmods.co.uk
Reply With Quote
  #3  
Old 10-18-2007, 03:07 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,471
 

Default Re: Check for url paramater existance

Thats Great ... Thanks Phil ..

Regards

Shafiq :sK
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #4  
Old 10-29-2007, 06:51 AM
 
dpm dpm is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 43
 

Default Re: Check for url paramater existance

IS there a way to read just part of the query string? Like an instring function of some sort? I need to look for "mode=checkout" within the query string, but there may be more parameters then that.

Any help is appreciated.

-dpm
__________________
x-cart-4.1.8gold
Reply With Quote
  #5  
Old 10-29-2007, 06:53 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Check for url paramater existance

Code:
{if $mode eq "checkout"} ... {/if}
__________________
xcartmods.co.uk
Reply With Quote
  #6  
Old 10-29-2007, 07:30 AM
 
dpm dpm is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 43
 

Default Re: Check for url paramater existance

Hi Phil...

Thanks for your quick response... I should have been a little more clear... I have 2 options:

1. cart.php?mode=checkout
2. cart.php?mode=checkout&signup=1

If the signup=1 is present then I show the user a hidden div tag where they can signup for a membership.

I tried this but it didnt work.

{if $signup eq "1"} ... {/if}
Any ideas?

Many Thanks,
-dpm
__________________
x-cart-4.1.8gold
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 08:39 AM.

   

 
X-Cart forums © 2001-2020