Welcome Guest, Not a member yet? Register   Sign In
Hide item price if user is not logged in
#2

You have syntax errors. You need a developing server with error logs and a PHP editor that support syntax.

PHP Code:
<?php 
if($obj->hasloggedin)
{
?>
    <form class="form-horizontal qtyFrm" onsubmit = "addtocartwithquantity($(this).attr('action')+'/'+$('#qty').val(),this,event);" action = "<?php echo  base_url().'cart/addtocart/'.$obj->product['product_id'];?>">
      <div class="control-group">
        <label class="control-label">
            <?php 
                
if($obj->product["discount_status"] == "1")
                {
                    echo 
'
                        <strong>Price&nbsp;:</strong>&nbsp;<span class = "price-number" style = "text-decoration:line-through;color : red;">R '
.$obj->product["product_price"].'</span><br />
                        <strong>Discount&nbsp;Price&nbsp;:</strong>&nbsp;<span class = "price-number" style = "">R'
.$obj->product["discount_price"].' </span>
                    '
;
                }
                else
                {
                    echo 
'<strong>Price&nbsp;:</strong>&nbsp;<span class = "price-number">R '.$obj->product["product_price"].'</span>';
                }
            
?>
        </label>
        <div class="controls" style="clear: both;margin-left: 0px;">
            <input type="number" id = "qty" class="span1 num_inc" placeholder="Qty."/>
          <button type="submit" class="btn btn-large btn-success pull-right"> Add to cart <i class=" icon-shopping-cart"></i>
          </button>
        </div>                    
      </div>
    </form>
    <li class="">
<?php
}
else 
{
    echo 
'<li class="">';                
}
?>
Reply


Messages In This Thread
RE: Hide item price if user is not logged in - by jreklund - 07-15-2018, 02:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB