Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18
  1. #11
    Join Date
    Sep 2007
    Location
    Dublin, Ireland
    Posts
    1,288
    Plugin Contributions
    8

    Default Re: Conditional code - how to?

    Quote Originally Posted by DrByte View Post
    ... or look at Ajeh's post ...
    I've just seen it and tried to edit my post- Missed the 7 Minutes
    Andrew

    Andrew Moore
    Omnicia Agile Development
    www.omnicia.com

  2. #12
    Join Date
    Mar 2005
    Posts
    123
    Plugin Contributions
    0

    Default Re: Conditional code - how to?

    Thanks for that - the code is NEARLY working as it's only showing 1 link now - but it is showing the ASK_A_QUESTION link all the time and not showing the ASK_A_QUESTION_SAMPLE link on "phone for price" items?

    I guess it doesn't understand the IF statement and is defaulting to the ELSE ?

  3. #13
    Join Date
    Sep 2007
    Location
    Dublin, Ireland
    Posts
    1,288
    Plugin Contributions
    8

    Default Re: Conditional code - how to?

    Quote Originally Posted by twdhosting View Post
    Thanks for that - the code is NEARLY working as it's only showing 1 link now - but it is showing the ASK_A_QUESTION link all the time and not showing the ASK_A_QUESTION_SAMPLE link on "phone for price" items?

    I guess it doesn't understand the IF statement and is defaulting to the ELSE ?
    it means the code I posted doesn't work- the code that says

    PHP Code:
    if($_GET['product_is_call']) 
    should be replaced with

    PHP Code:
    if(zen_products_lookup($_GET('product_id'), 'product_is_call')) 
    as per Ajeh's post.
    Andrew

    Andrew Moore
    Omnicia Agile Development
    www.omnicia.com

  4. #14
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Conditional code - how to?

    Close ...

    But no cigar ...

    See if this helps you out as php is fussy about brackets and parens and mixing them up etc. etc. etc.
    PHP Code:
    if(zen_products_lookup($_GET['products_id'], 'product_is_call')) {
      echo 
    'I am CALL!!';
    } else {
      echo 
    'I am NOT CALL!!';

    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #15
    Join Date
    Sep 2007
    Location
    Dublin, Ireland
    Posts
    1,288
    Plugin Contributions
    8

    Default Re: Conditional code - how to?

    Closer, but no cigar for you either

    PHP Code:
    if(zen_products_lookup($_GET['products_id'], 'product_is_call'))
     echo 
    '<a href="'zen_href_link(FILENAME_ASK_A_QUESTION_SAMPLE'products_id=' $_GET['products_id']) . '">' ASK_A_QUESTION_SAMPLE '</a>'
    else
     echo 
    '<a href="' zen_href_link(FILENAME_ASK_A_QUESTION'products_id=' $_GET['products_id']) . '">' ASK_A_QUESTION '</a>'
    Andrew

    Andrew Moore
    Omnicia Agile Development
    www.omnicia.com

  6. #16
    Join Date
    Mar 2005
    Posts
    123
    Plugin Contributions
    0

    Default Re: Conditional code - how to?

    Thanks hem - that cracked it! :)

  7. #17
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Conditional code - how to?

    I like to make 'em work for it ... ... makes them understand the code better in the end, along with the reasons for it.
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #18
    Join Date
    Sep 2007
    Location
    Dublin, Ireland
    Posts
    1,288
    Plugin Contributions
    8

    Default Re: Conditional code - how to?

    Good work
    Andrew

    Andrew Moore
    Omnicia Agile Development
    www.omnicia.com

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. how to change this two osc code into zc code?
    By sunrise99 in forum General Questions
    Replies: 3
    Last Post: 21 Nov 2011, 05:30 AM
  2. Adding conditional code to emails
    By Scott_C in forum General Questions
    Replies: 7
    Last Post: 17 May 2010, 09:15 AM
  3. How Do I Wrap This Conditional Array in tpl_main_page.php?
    By limelites in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 8 Apr 2009, 10:15 AM
  4. Add Conditional Code To Some Pages
    By Anuragji in forum General Questions
    Replies: 4
    Last Post: 9 Jun 2006, 02:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg