Jump to content

Guys im stuck (poor php skills)


alwaysme

Recommended Posts

i try to edit a script but i cannot seem to figure. Basically the line below display the PRICE, and if the user chose to have EBAY LISTING, the price will not display and instead an image will SHOW with a link. What i want is, THE PRICE TO SHOW even if there is an ebay listing, and the image to appear below it or above (it doesnt really matter). The script works fine with display the price until the account holder chooses to have ebay listing which will appear as an image instead of the numbers (price).

 

hope u understand me

 

// price, availability, condition
	echo "<div class='price'>";

	echo "Price: ";
	if($row[ebay_url]) echo "<a href='$row[ebay_url]' target='_blank'><img class='none' src='comn/ebaymotors.gif'/></a>";
	elseif($row[price])	echo $conf[currency].number_format($row[price]);
	elseif($row[price_alt]) echo $row[price_alt];
	else echo "Call for Price";
	if($row[sale]) echo "<br/><span>New Price: <strong>".$conf[currency].number_format($row[sale])."</span>";
	echo "</strong><br/>";

 

 

Link to comment
Share on other sites

Try like this

=======

 

// price, availability, condition
	echo "<div class='price'>";

	echo "Price: ";
	if($row[price])	echo $conf[currency].number_format($row[price]);
	elseif($row[price_alt]) echo $row[price_alt];
	else echo "Call for Price";
	if($row[ebay_url]) echo "<BR><a href='$row[ebay_url]' target='_blank'><img class='none' src='comn/ebaymotors.gif'/></a>";

	if($row[sale]) echo "<br/><span>New Price: <strong>".$conf[currency].number_format($row[sale])."</span>";
	echo "</strong><br/>";

Link to comment
Share on other sites

its your if statment it hits the first if  {if($row[ebay_url])}  and does not do the elseif

echo "Price: ";
	if($row[ebay_url]) echo "<a href='$row[ebay_url]' target='_blank'><img class='none' src='comn/ebaymotors.gif'/></a>";
	if($row[price]) echo $conf[currency].number_format($row[price]);
	elseif($row[price_alt]) echo $row[price_alt];
	else echo "Call for Price";
	if($row[sale]) echo "<br/><span>New Price: <strong>".$conf[currency].number_format($row[sale])."</span>";
	echo "</strong><br/>";

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.