Nesting PhP tags inside other Php Tags? How to:?
Posted: Thu Dec 22, 2011 11:34 am
Let me start by first saying I am not a PhP coder by any means. That being said, let me state my issue
I have a e-commence site that sells products. Buy each product It says "in stock" or "out of stock". I would like a "digital download" link to appear below the in stock or out of stock depending on a value from the database. I have the PhP code working properly to see if there is a value or not. The issue I have is when I try to plug in the php code to the "in stock / out of stock" php code.
"In stock / out of stock" PhP code: (This is just part of the huge code but its the part that deals with the in stock / out of stock section that i need. The opening php tag and closing php tag are there, just not shown)
And here's the digital download PhP code: (Each download link is unique to the product so it pulls part of its link from the product)
So I am trying to have the digital download appear right after the in stock and out of stock... any ideas?
Thanks for taking a look,
Kyle
I have a e-commence site that sells products. Buy each product It says "in stock" or "out of stock". I would like a "digital download" link to appear below the in stock or out of stock depending on a value from the database. I have the PhP code working properly to see if there is a value or not. The issue I have is when I try to plug in the php code to the "in stock / out of stock" php code.
"In stock / out of stock" PhP code: (This is just part of the huge code but its the part that deals with the in stock / out of stock section that i need. The opening php tag and closing php tag are there, just not shown)
Code: Select all
$lc_align = 'center';
if ((STOCK_CHECK == 'true')&&(tep_get_products_stock($listing['products_id']) < 1)) {
$lc_text = '<span class="markProductOutOfStock"><b>Out of Stock</b></span>';
} else {
$lc_text = '<span class="markProductInStock"><b>In Stock</b></span>';
}
break;And here's the digital download PhP code: (Each download link is unique to the product so it pulls part of its link from the product)
Code: Select all
<?php if($product_info['products_digital'] != "") { ?>
<A href="https://comics.comixology.com/ret/72/Impulse_Creations_Digital_Store/<?php echo $product_info['products_digital']; ?>"
target=_blank>Digital Download</A><BR><BR>
<?php } ?>So I am trying to have the digital download appear right after the in stock and out of stock... any ideas?
Thanks for taking a look,
Kyle