Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #11251
    Profile photo of beverlyclaire
    beverlyclaire
    Participant

    Hi Chris,

    Thank you very much! I added you back. 🙂

    I love the header image and top page slide show of your site!

    #10833
    Profile photo of beverlyclaire
    beverlyclaire
    Participant

    Hi Christine,

    Thanks for the welcome! I went over to StackExchange/StackOverflow to ask for ideas and found a solution:

    In the cart.php file’s get_cart_value() function:

        public function get_cart_value(){

    $cart = $this->cart;
    $prices = array();

    $cart = apply_filters('ss_mod_cart_value', $cart);

    foreach ($cart as $product){

    array_push( $prices, array('price'=>trim($product), 'discount' => trim($product )));
    }

    $total = 0;

    foreach($prices as $price){


    $price = $this->calc_discount($price, $price);

    //$price = str_replace('.', '', $price);
    $price = floatval(preg_replace('/[^d.]/', '' , $price));

    $total += $price;
    }

    //$total = number_format($total/100, 2);
    $total = number_format($total, 2);

    return $total;

    }

    I replaced the string conversion to float and changed the total to fit the number of decimal places. Now the cart displays the 4-digit values correctly 😀

    Here is the thread I started at StackExchange:
    http://stackoverflow.com/questions/22979537/displaying-currency-values-greater-than-1000

    The thread I used for reference:
    http://stackoverflow.com/questions/5139793/php-unformat-money

    Hope this will be helpful to someone else looking for a solution while waiting for the big new version (Symbio 3.4? 4.0? 🙂 )

Viewing 2 posts - 1 through 2 (of 2 total)