Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how to show % sign


zegar911

Recommended Posts

Posted

hi,

how to show % sign in Oscommerce, in product in.php

as i want to replace this

define('TEXT_DATE_ADDED', 'This product was added to our catalog on %s.');

 

to this

define('TEXT_DATE_ADDED', 'We have 99.9% customer satisfaction and 100% ontime delivery');

 

Thanks in advance

Posted

If you're getting an error message, did you change the sprintf/fprintf/printf call to not include the date variable? If the call still has a data string in it, it will look for % codes in the format string (usually %s) and gag if it doesn't find something valid. Actually, I'm not sure if %code drives PHP to look for input data, or input data argument in the call drives PHP to look for a %code in the format string. So the first thing would be to change the usage of this string to get rid of any replacement string data. Then, % as percentage should hopefully work. If you still have problems, try \% or %%.

 

It might be cleaner, in the long run, to remove/comment out the use of the TEXT_DATE_ADDED string, and add your own TEXT_GUARANTEED_SATISFACTION string. That way you can easily go back if you want to, later.

Posted

hi,

how to show % sign in Oscommerce, in product in.php

as i want to replace this

define('TEXT_DATE_ADDED', 'This product was added to our catalog on %s.');

 

to this

define('TEXT_DATE_ADDED', 'We have 99.9% customer satisfaction and 100% ontime delivery');

 

Thanks in advance

Bad idea. The '%s' is used by the sprintf() function to insert the date. Not sure what will happen if there's no '%s' in the text.

 

To add a literal percent, use two percent signs: %%

 

Perhaps you should just insert your own text instead of hijacking the Date Added string.

Check out Chad's News.

Posted

thanks for help. i tried %% its working, i tried to add my new line there

 

define('TEXT_GUARANTEED_SATISFACTION', 'We have maintain 99.99%%Customer\'s Satisfaction, 100%% Secure transaction & 100%% Ontime delivery.');

 

but its not showing any thing in produt info, do i have to add this some where else too,,

thanks alot,.,.

Posted

OK, somewhere (probably near where TEXT_DATE_ADDED is or used to be displayed) you have to print out the new TEXT_GUARANTEED_SATISFACTION.

define('TEXT_GUARANTEED_SATISFACTION', 'We maintain 99.99%% customer satisfaction, 100%% secure transactions, & 100%% ontime delivery.');

...

<td align="center" class="smallText"><?php echo TEXT_GUARANTEED_SATISFACTION; ?></td>

Posted

OK, somewhere (probably near where TEXT_DATE_ADDED is or used to be displayed) you have to print out the new TEXT_GUARANTEED_SATISFACTION.

define('TEXT_GUARANTEED_SATISFACTION', 'We maintain 99.99%% customer satisfaction, 100%% secure transactions, & 100%% ontime delivery.');

...

<td align="center" class="smallText"><?php echo TEXT_GUARANTEED_SATISFACTION; ?></td>

 

Thanks a lot for your help, now i added new line in both product info file, and // date added. also now i just entered one % sign and it displayed well in TEXT_GUR... line,

Thanks a lot,

Take care

 

Zegar

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...