Announcement

Collapse
No announcement yet.

Removing 00-decimals on EasyCart frontend

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Removing 00-decimals on EasyCart frontend

    I built a shop for a client using WP EasyCart. I'm stuck with one small thing my client asked me to do.

    I'm using Swiss franc (CHF) as currency. If an item is, let's say, CHF 5.00, the price tag should look like this: CHF 5.??? (the ".-" indicating that there are no decimals). If an item is CHF 5.50 it should exactly look like this without the ".???" in the end. Since I didn't find any option in the admin panel to achieve this I set the "Currency symbol" to ".???" and used
    PHP Code:
    str_replace('.00''', [PRICE]) 
    in the templates to remove the decimals. It worked everywhere except on the product page itself (/shop/?model_number=X)

    I edited the file ec_product_details_page.php and replaced
    PHP Code:
    <div class="ec_details_price ec_details_single_price"><?php $this->product->display_product_list_price(); ?><?php $this->product->display_price(); ?></div>
    (lines 293 and 472)

    with

    PHP Code:
    <div class="ec_details_price ec_details_single_price"><?php str_replace('.00'''$this->product->display_product_list_price()); ?><?php str_replace('.00'''$this->product->display_price()); ?></div>
    But there was no result. Did I edit the wrong template file? Or has it something to do with all the jQuery on the lines 1653-1940? Glad if you could point me to the right direction.

    The store address is: http://www.ideenservice.biz/ressourcen/
Working...
X