If else not working
Posted: Fri Jun 13, 2014 9:58 am
Hi guys i have only been doing php for about 1 year so be gentle with me
I have a auction website which is all working ok except one thing product attribute and its all down to if else command
This page has two commands normal quantity and product attribute quantity
this is the code
the product attribute work ok if there is a product attribute but if there is no attribute the listing is show 0 even if the data base has 10
if i remove
The quantity is fine but the attribute do not work but that because i remove the code
too me it looks like a if else problem but im not experienced enough to say
please help i have been on this for over a week
thank you
I have a auction website which is all working ok except one thing product attribute and its all down to if else command
This page has two commands normal quantity and product attribute quantity
this is the code
Code: Select all
$attributes = attributes_display_to_raw($_POST['product_attributes']);
$quantity_unlimited = false;
if ($item_details['enable_product_attributes']) {
$quantity_output = getQuantity($item_details['auction_id'], $attributes);
$item_details['quantity'] = $quantity_output;
}
else {
$quantity_output = $item_details['quantity'];
}
$template->set('quantity_output', $quantity_output);
the product attribute work ok if there is a product attribute but if there is no attribute the listing is show 0 even if the data base has 10
if i remove
Code: Select all
$attributes = attributes_display_to_raw($_POST['product_attributes']);
$quantity_unlimited = false;
if ($item_details['enable_product_attributes']) {
$quantity_output = getQuantity($item_details['auction_id'], $attributes);
$item_details['quantity'] = $quantity_output;
too me it looks like a if else problem but im not experienced enough to say
please help i have been on this for over a week
thank you