The Official Website of AgoraCart and Agora.cgi
AgoraCart.com Demos Download AgoraCart User Manuals & Wiki Gold Members Forum Go Gold Now! Gold Version Memberships

AgoraCart.com

About
Features
Download
Payment Gateways
Send a Donation
Founders Club
BLOG: News & Updates

Showcases & Demos

AgoraCart Demos
Shop Live Stores

Downloads & Add-ons

Gold Version Downloads
DBwizz Database Mgr.
AgoraCart.com Store

Help & Support

User Manuals
Gold Version Users Forum
Gold Version Chat
Tech Support
Certified Agora Pros
Certified Designers
Hire a Freelancer

Gold Version Members

Member Benefits
Join Today!
Gold Members Home
Gold Version Users Forum
Gold Version Chat Rooms
Gold Version Downloads

For Store Owners

Merchant Accounts
Cool Resources
Advertise Here
"Powered by" Logos
Web Hosting Search

Misc.

Contact Us
MEET's Talking Guide
The Ancient Greek Agora






AgoraCart Free User Forums

This is the official FAQ and Cool Tips guide For the AgoraCart shopping Cart software


Official Sponsors of the AgoraCart Project:

       


RegisterSearchFAQLog in
Reply to topic Page 1 of 1
Suppress printing a price of $0.00
Author Message
Reply with quote
Post Suppress printing a price of $0.00 
This question is related to the following page:
http://www.agoracart.com/agorawiki/index.php?title=Variable_Option_Files

"Using the method above, you can have a base price in the database, and add an extra amount to it via the option file. Or you can set the price to 0.00 in the database and put all your prices in the option file. If you do the latter you may need to replace some code in your productPage.inc file to suppress printing a price of $0.00 for that item. If so, the following works in most instances (and is optional) -- just find the code that prints out the price & replace it with:"

Code:
 
<code><!-- agorascript-pre {<br>
&capture_STDOUT;<br>
local($readprice);<br>
$readprice = $database_fields[$db{'price'}];<br>
if ($readprice =~ /^0.00/i) {$newprice = "";}<br>
if ($readprice =~ /^0/i) {$newprice = "";}<br>
else {$newprice = "%%price%% ";}<br>
if ($readprice =~ /^0.00/i) {$pricelabel = "";}<br>
if ($readprice =~ /^0/i) {$pricelabel = "";}<br>
else {$pricelabel = "Price: ";}<br>
<br>
print qq~<br>
<p><b>$pricelabel</b>$newprice</p>~;<br>
&uncapture_STDOUT;<br>
}<br>
--></code>


I have put all my prices in my options files, and I want to suppress the printing price as it says above. Part of the directions say "just find the code that prints out the price & replace it with:"

-----

So my question is, where is the code that prints out the price in the productPage.inc file?

Regards,
~Ken

Reply with quote
Post  
%%price%%
That is what prints the price in the productPage.inc file.

HTH!


_________________
God Bless!
Bonnie - AgoraCart Moderator

Get a Gold Membership
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
Hello,

Replacing %%price%% on my ProductPage.inc file with the exact code in SoundScape's post produces the error:

Quote:
We're sorry, an error has occured.
Please hit the browser back button, change what was done in error, and try again.

Does this technique not work any more? Confused

View user's profile Send private message
Reply with quote
Post  
This same code was posted as a sticky in the forum, here, at:
http://www.agoraguide.com/faq/viewtopic.php?t=4614

It does work... Make sure you do not copy in the <code></code> tags... Also, there are a bunch of <br> tags at the ends of the lines from the wiki, that is messing things up, too.
It should only be:
Code:
<!-- agorascript-pre {
&capture_STDOUT;
local($readprice);
$readprice = $database_fields[$db{'price'}];
if ($readprice =~ /^0.00/i) {$newprice = "";}
if ($readprice =~ /^0/i) {$newprice = "";}
else {$newprice = "%%price%% ";}
if ($readprice =~ /^0.00/i) {$pricelabel = "";}
if ($readprice =~ /^0/i) {$pricelabel = "";}
else {$pricelabel = "Price: ";}

print qq~
<p><b>$pricelabel</b>$newprice</p>~;
&uncapture_STDOUT;
}
-->


Also, make sure that you download/upload the file in ASCII mode.


_________________
God Bless!
Bonnie - AgoraCart Moderator

Get a Gold Membership
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger ICQ Number
Reply with quote
Post  
Thank you - it was the <br> tags Smile

View user's profile Send private message
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum