snubbr.com

Why is not all internet traffic encrypted using Verisign SSL etc.?!?

Get a Verisign SSL certificate for 30 days FREE. Click here to use coupon...

Get a free trial of Verisign SSL certificates. Click here for this special deal...
My question is Why is not all internet traffic encrypted using Verisign SSL etc.?!? Looking forward for any answer or 2. My other question... This may seem silly but it's been driving me crazy..

On the admin side with some contributions it shows 4 decimal places instead of the 2 as set in Currencies..

I have this - $12.5000 instead of $12.50..

How can I drop those extra 2 zero's?.

The code in the files looks normal:.

$products_query_raw = "p.products_price,.

....

- or -.

$product_query = tep_db_query("p.products_price,.

....

- and -.

<?php echo ($products['products_price']); ?>.

Could it have anything to do with using just.

P.products_price.

And not including.

Pd.products_price.

In the query?..

Comments (15)

I would like to know the answer too. Anyone here know what is the answer to your question. I'll do some investigation and get back to you if I bump into an useful answer. You should email the people at Verisign as they probably could assist you..

Comment #1

Ok, before I make a big mess of things....

I just changed some database settings:.

Table = tax_rates, Field = tax_rate - Length/Values to 7,2.

Table = currencies, Field = Value - Type to Decimal, Length/Values to 13,2.

I am still getting four decimal places..

I Googled for an answer and found.

This.

:.

".

Looks as if you are outputting the raw price from your database instead of a parsed price through the currency class. Look in the relevant module displayed on your homepage, and where the price display is called, ensure it matches the following structure.

:.

$currencies->display_price($data_array['products_price'], tep_get_tax_rate($data_array['products_tax_class_id'])).

Replacing data_array with the array name holding all the database information in the particular module.

.".

Don't know if or how that might solve my problem. Here is the code from a complicated file:.

NOTE: I don't need/charge tax so I'd like to dump that code if it's unnecessary..

Require(DIR_WS_CLASSES'currencies.php');.

$currencies = new currencies();.

/* Skipping some irrelevant code */.

}.

If(isset($HTTP_GET_VARS['cPath']) && $HTTP_GET_VARS['cPath'] != 0){.

$current_category_id = $HTTP_GET_VARS['cPath'];.

$product_query = tep_db_query("select pd.products_name, p.products_id, p.products_price, p.products_quantity, p.products_model, p.products_weight, p.products_status, p.products_tax_class_id, tr.tax_rate from "TABLE_PRODUCTS" p left join "TABLE_PRODUCTS_DESCRIPTION" pd on p.products_id = pd.products_id inner join "TABLE_PRODUCTS_TO_CATEGORIES" p2c on p.products_id = p2c.products_id left join "TABLE_TAX_RATES" tr on p.products_tax_class_id = tr.tax_class_id where pd.language_id = '"(int)$languages_id"' and p2c.categories_id = "(int)$HTTP_GET_VARS['cPath']$search_qry$stock_qry" order by p.products_model ");.

} else {.

$product_query = tep_db_query("select pd.products_name, p.products_id, p.products_price, p.products_quantity, p.products_model, p.products_weight, p.products_status, p.products_tax_class_id, tr.tax_rate from "TABLE_PRODUCTS" p left join "TABLE_PRODUCTS_DESCRIPTION" pd on p.products_id = pd.products_id left join "TABLE_TAX_RATES" tr on p.products_tax_class_id = tr.tax_class_id where pd.language_id = '"(int)$languages_id"'"$search_qry$stock_qry" order by p.products_model ");.

$current_category_id = '';.

}.

/* Skipping some irrelevant code */.

<script language="javascript"><!</P> <P>function doRound(x, places) {.

Return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);.

}</P> <P>function updateGross(taxRate, product_id) {.

// var taxRate = getTaxRate();.

Var grossValue = document.getElementById('price_' + product_id).value;.

If (taxRate > 0) {.

GrossValue = grossValue * ((taxRate / 100) + 1);.

}.

Document.getElementById('price_gross_' + product_id).value = doRound(grossValue, 4);.

// document.forms["new_product"].products_price_gross.value = doRound(grossValue, 4);.

}</P> <P>function updateNet(taxRate, product_id) {.

// var taxRate = getTaxRate();.

Var netValue = document.getElementById('price_gross_' + product_id).value;.

If (taxRate > 0) {.

NetValue = netValue / ((taxRate / 100) + 1);.

}.

Document.getElementById('price_' + product_id).value = doRound(netValue, 4);.

// document.forms["new_product"].products_price_gross.value = doRound(grossValue, 4);.

}.

//></script>.

/* Skipping some irrelevant code */.

<td valign="top" class="dataTableContent"><input type="text" name="price[]" id="price_<?php echo $product['products_id'];?>" value="<?php echo $product['products_price'];?>" size="6" onKeyUp="updateGross(<?php echo ((tep_not_null($product['tax_rate'])) ? $product['tax_rate'] : 0)?>, <?php echo $product['products_id'];?>)"></td>.

Here is the code from a simple file:.

<?php.

If ($HTTP_GET_VARS['page'] > 1) $rows = $HTTP_GET_VARS['page'] * 20 - 20;.

$products_query_raw = "select p.products_id, pd.products_name, p.products_quantity, p.products_price, p.products_model, l.name from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_DESCRIPTION" pd, "TABLE_LANGUAGES" l where p.products_id = pd.products_id and p.products_id = pd.products_id and l.languages_id = pd.language_id order by p.products_model ASC";</P> <P> $products_query = tep_db_query($products_query_raw);.

While ($products = tep_db_fetch_array($products_query)) {.

$rows++;</P> <P> if (strlen($rows) < 2) {.

$rows = '0'$rows;.

}.

?>.

/* Skipping some irrelevant code */.

<tr class="tableRow">.

<td width="90" class="dataTableContent"><?php echo $products['products_model']; ?></td>.

<td width="*" class="dataTableContent"><?php echo $products['products_name']; ?></td>.

<td width="30" align="center" class="dataTableContent"><?php echo $products['products_quantity']; ?></td>.

<td width="60" align="right" class="dataTableContent"><?php echo $products['products_price']; ?></td>.

</tr>.

I would truely appreciate any help, thoughts or ideas especially with the simple file...

Comment #2

Off the top, I'd say replacing this code:.

<?php echo $products['products_price']; ?>.

With.

<?php echo $currencies->display_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id'])); ?>.

In the simple file will work for you...

Comment #3

Thanks Jim!.

Somethings not quite right....

Received this error when the page loads:.

Fatal error.

: Call to a member function display_price() on a non-object in.

/home3/handesho/public_html/catalog/admin/stats_products.php.

On line.

66.

Line 66:.

<td width="60" align="right" class="dataTableContent"><?php echo $currencies->display_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id'])); ?></td>..

Comment #4

At the top of.

/catalog/admin/.

Stats_products.php.

Just.

AFTER.

This line:.

Require('includes/application_top.php');.

ADD.

These lines if they aren't there:.

Require(DIR_WS_CLASSES'currencies.php');.

$currencies = new currencies();..

Comment #5

WOW awesome!.

Thank you so much Jim for helping me fix that...

Comment #6

I tried playing with the complicated file and changed this code:.

<td valign="top" class="dataTableContent"><input type="text" name="price[]" id="price_<?php echo $product['products_id'];?>" value="<?php echo $product['products_price'];?>" size="6" onKeyUp="updateGross(<?php echo ((tep_not_null($product['tax_rate'])) ? $product['tax_rate'] : 0)?>, <?php echo $product['products_id'];?>)"></td>.

To this:.

<td valign="top" class="dataTableContent"><input type="text" name="price[]" id="price_<?php echo $product['products_id'];?>" value="<?php echo $currencies->display_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id'])); ?>" size="6" onKeyUp="updateGross(<?php echo ((tep_not_null($product['tax_rate'])) ? $product['tax_rate'] : 0)?>, <?php echo $product['products_id'];?>)"></td>.

And I tried this:.

<td valign="top" class="dataTableContent"><input type="text" name="price[]" id="price" value="<?php echo $currencies->display_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id'])); ?>" size="6"></td>.

Both dropped the 2 extra decimal places, BUT changed all the prices to $0.00...

Comment #7

Maybe this:.

<td valign="top" class="dataTableContent"><input type="text" name="price[]" id="price_<?php echo $product['products_id'];?>" value="<?php echo $currencies->display_price($products['products_price'], 1.0); ?>" size="6" onKeyUp="updateGross(<?php echo ((tep_not_null($product['tax_rate'])) ? $product['tax_rate'] : 0)?>, <?php echo $product['products_id'];?>)"></td>..

Comment #8

Two decimal places, but all prices zero again = $0.00..

Comment #9

A couple of things to try:.

<td valign="top" class="dataTableContent"><input type="text" name="price[]" id="price_<?php echo $product['products_id'];?>" value="<?php echo $currencies->display_price($products['products_price'], 100.0); ?>" size="6" onKeyUp="updateGross(<?php echo ((tep_not_null($product['tax_rate'])) ? $product['tax_rate'] : 0)?>, <?php echo $product['products_id'];?>)"></td>.

(I screwed up the tax value.

).

<td valign="top" class="dataTableContent"><input type="text" name="price[]" id="price_<?php echo $product['products_id'];?>" value="<?php echo number_format($products['products_price'], 2, '.', ''); ?>" size="6" onKeyUp="updateGross(<?php echo ((tep_not_null($product['tax_rate'])) ? $product['tax_rate'] : 0)?>, <?php echo $product['products_id'];?>)"></td>.

(A totally different appraoch altogether.

)..

Comment #10

Same for both = $0.00.

Can there be something wrong with some of the other code on the page?..

Comment #11

The second method I posted uses PHP routines only..

If the output was zero so was the input...

Comment #12

Please forgive my ignorance Jim, but that just confussed the heck out of me..

I know the prices are in the database..

With using the below code, I get the result in the top picture..

<td valign="top" class="dataTableContent"><input type="text" name="price[]" id="price_<?php echo $product['products_id'];?>" value="<?php echo $product['products_price'];?>" size="6" onKeyUp="updateGross(<?php echo ((tep_not_null($product['tax_rate'])) ? $product['tax_rate'] : 0)?>, <?php echo $product['products_id'];?>)"></td>.

But once I change to your second method of code (below), I get the results in the picture below..

<td valign="top" class="dataTableContent"><input type="text" name="price[]" id="price_<?php echo $product['products_id'];?>" value="<?php echo number_format($products['products_price'], 2, '.', ''); ?>" size="6" onKeyUp="updateGross(<?php echo ((tep_not_null($product['tax_rate'])) ? $product['tax_rate'] : 0)?>, <?php echo $product['products_id'];?>)"></td>.

Can you explain what you mean by the input being zero?..

Comment #13

<td valign="top" class="dataTableContent"><input type="text" name="price[]" id="price_<?php echo $product['products_id'];?>" value="<?php echo $currencies->display_price($product['products_price'], 100.0); ?>" size="6" onKeyUp="updateGross(<?php echo ((tep_not_null($product['tax_rate'])) ? $product['tax_rate'] : 0)?>, <?php echo $product['products_id'];?>)"></td>.

<td valign="top" class="dataTableContent"><input type="text" name="price[]" id="price_<?php echo $product['products_id'];?>" value="<?php echo number_format($product['products_price'], 2, '.', ''); ?>" size="6" onKeyUp="updateGross(<?php echo ((tep_not_null($product['tax_rate'])) ? $product['tax_rate'] : 0)?>, <?php echo $product['products_id'];?>)"></td>.

Try one of those..

It will help when I get the variable name right..

I was using.

$product.

S.

['products_price'].

When it should have been.

$product['products_price'].

..

$product.

S.

['products_price'].

Didn't exist so PHP created it and gave it a value of ZERO and printed it..

This post has been edited by.

Germ.

: 21 December 2008, 12:36..

Comment #14

I think we've fallen victim to the GIGO (garbage in garbage out) Syndrome..

The code in your "simple" file uses the array.

$products.

The code in your "more complicated" file uses the array.

$product.

(no.

S.

At the end)...

Comment #15

Fantastic! That worked.

You are a.

Saint.

Jim, thank you so much for all the help..

I can't believe all the time it was a nasty little.

S.

Causing the problem..

Oh my GOD!!!.

I just deleted a few of those nasty little.

S.

's in another section of code I've been messing with for two weeks and now that works too..

Thank you for the early Christmas gift!.

One more addition to the file and I'll be all set..

Thank you, Thank you, Thank you!!!..

Comment #16


This question was taken from a support group/message board and re-posted here so others can learn from it.

 

Categories: Home | Diet & Weight Management | Vitamins & Supplements | Herbs & Cleansing |

Sexual Health | Medifast Support | Nutrisystem Support | Medifast Questions |

Web Hosting | Web Hosts | Website Hosting | Hosting |

Web Hosting | GoDaddy | Digital Cameras | Best WebHosts |

Web Hosting FAQ | Web Hosts FAQ | Hosting FAQ | Hosting Group |

Hosting Questions | Camera Tips | Best Cameras To Buy | Best Cameras This Year |

Camera Q-A | Digital Cameras Q-A | Camera Forum | Nov 2010 - Cameras |

Oct 2010 - Cameras | Oct 2010 - DSLRs | Oct 2010 - Camera Tips | Sep 2010 - Cameras |

Sep 2010 - DSLRS | Sep 2010 - Camera Tips | Aug 2010 - Cameras | Aug 2010 - DSLR Tips |

Aug 2010 - Camera Tips | July 2010 - Cameras | July 2010 - Nikon Cameras | July 2010 - Canon Cameras |

July 2010 - Pentax Cameras | Medifast Recipes | Medifast Recipes Tips | Medifast Recipes Strategies |

Medifast Recipes Experiences | Medifast Recipes Group | Medifast Recipes Forum | Medifast Support Strategies |

Medifast Support Experiences |

 

(C) Copyright 2010 All rights reserved.