phpphpphp Posted March 31, 2006 Posted March 31, 2006 Hello, I installed oscommerce and filled it with cellular phones, but sometimes I get a negative price. I never want a negative price to be shown to the customer. When negative it needs to be 0. I've tried some things like this: includes\class\shopping_cart.php: $zoekterm = "-"; $products_price = $products['products_price']; $products_price = str_replace($zoekterm, "", $products_price); Or: \shopping_cart.php: <?php $findme = '-'; $pos = strpos($cart->show_total(), $findme); if ($pos === false) { echo "The string '$findme' was not found in the string '$cart->show_total'"; } else { $cart = str_replace ( chr ( 45 ), '', $cart ); } ?> Or: $products_price = str_replace ( chr ( 45 ), "", $products_price); Nothing works, please help! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.