burt, on 09 December 2010 - 03:33 PM, said:
So this code did not work for you?
Hello, firstly I would like to apologies for the manner of my posting
I want to be clear, Burt you have been very helpful, and my frustration got the better of me.
I hope you will allow me to give a brief explanation why.
I am not one who like things to be given on a plate.
In the context of the this thread, my thought process was, you could say stuck, on IF / ELSEIF statements, as this is something I have a prior understanding.
Now......
this
$data = '<div class="ui-widget infoBoxContainer">' .
' <div class="ui-widget-header infoBoxHeading"><a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . MODULE_BOXES_WHATS_NEW_BOX_TITLE . '</a></div>' .
' <div class="ui-widget-content infoBoxContents" style="text-align: center;"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br />';
$data .= (SHOW_ACCOUNT > 0) ? '' : $whats_new_price;
$data .= ' </div>' .
'</div>';
Threw me, as you no longer referenced any IF statements, and I failed to understand what had been done. This is my fault and I am sorry. I was frustrated as you didnt explain why you got rid of the IF statements, as I said previously, am not just looking for the answer, but to the reasons, so I can learn.
Now, my solution was by adding the IF statement before the data string.
i.e.
// Mod_Started //
if ( SHOW_ACCOUNT > 0) echo '';
elseif ( SHOW_PRICES > 0) echo '';
else
// Mod_Finished //
if (tep_not_null($random_product['specials_new_products_price']))
{
$whats_new_price = '<del>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del><br />';
$whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';
} else {
$whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
}
$data = '<div class="ui-widget infoBoxContainer">' .
' <div class="ui-widget-header infoBoxHeading"><a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . MODULE_BOXES_WHATS_NEW_BOX_TITLE . '</a></div>' .
' <div class="ui-widget-content infoBoxContents" style="text-align: center;"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br />
' . $whats_new_price . '
</div>' .
'</div>';
I have tried your code, will get it to function correctly as a learning procedure, using it no longer gives me a parsing error, but havnt yet got it to do what I want it to do. Once I have understood the construct I can apply this.
Hope my apology is accepted, sorry for the overdrawn post........
Edited by mongoled, 09 December 2010 - 04:55 PM.