Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

different problems with oscommerce


sidefx

Recommended Posts

hello forum users.

 

Probably I'm not the first asking those questions, but I couldn't find any returns via the search engine (or I used the wrong words to search for)

 

I would like to know how to solve some problems.

 

1: I need to add a space between the price and the currency, so that it appears like: 150.10 CHF, now it displays the price like 150.10CHF. Where do I have to adjust that?

 

2: I would like to set a wider border on the left, where you can choose product category. How can I do that?

 

3: I would like to edit the text that is displayed in information box. Like Shipping, Privacy notice etc. etc. How do I do this best. I opened the php file in dreamweaver and edited it there. But it's somehow strange to do it this way. Could I aswell open it in a text editor ?

 

Thx and excuse me if this has been asked alot or is covered in any faq. I couldn't find it

Link to comment
Share on other sites

1> Try changing the following line if catalog/includes/classes/currencies.php

 

      } else {

        $format_string = $this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . $this->currencies[$currency_type]['symbol_right'];

      }

 

to

 

      } else {

        $format_string = $this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number, $this->currencies[$currency_type]['decimal_places']), $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . ' ' . $this->currencies[$currency_type]['symbol_right'];

      }

 

 

2> In catalog/includes/application_top.php, look for the line:

 

// customization for the design layout

  define('BOX_WIDTH', 125); // how wide the boxes should be in pixels (default: 125)

 

 

3> Have a look at:

 

http://www.oscommerce.com/community/contributions,2841

Link to comment
Share on other sites

hello I'm back.

 

1)ok number 2 I could solve.

 

but with 1) I still have my problems. I changed this currency.php according to your suggestion. I tried to search for the exact code you gave me so it's identical. I'm pretty sure this didn't work. Maybe I did something wrong in setting the default currency?

 

Basically I have to insert a . ' ' so it displays a blank space.

 

Sorry I come up with so easy problems it's obvious as you explained :)

 

Maybe wanna have a look at the page I'm doing it's at www.megalgas.ch / the shop - german index. (I'll add english later)

 

this is the content of my currencies.php (maybe contains already errors?

 

<?php

/*

  $Id: currencies.php,v 1.16 2003/06/05 23:16:46 hpdl

 

Exp $

 

  osCommerce, Open Source E-Commerce Solutions

 

 

http://www.oscommerce.com

 

  Copyright © 2003 osCommerce

 

 

 

Released under the GNU General Public License

*/

 

////

//

 

Class to handle currencies

// TABLES: currencies

  class

 

currencies {

    var $currencies;

 

// class constructor

   

 

function currencies() {

      $this->currencies = array();

   

 

  $currencies_query = tep_db_query("select code, title,

 

symbol_left, symbol_right, decimal_point, thousands_point,

 

decimal_places, value from " . TABLE_CURRENCIES);

      while

 

($currencies = tep_db_fetch_array($currencies_query)) {

     

 

$this->currencies[$currencies['code']] = array('title' =>

 

$currencies['title'],

                                       

 

              'symbol_left' => $currencies['symbol_left'],

   

 

                                                 

 

'symbol_right' => $currencies['symbol_right'],

               

 

                                      'decimal_point' =>

 

$currencies['decimal_point'],

                               

 

                      'thousands_point' =>

 

$currencies['thousands_point'],

                             

 

                        'decimal_places' =>

 

$currencies['decimal_places'],

                               

 

                      'value' => $currencies['value']);

     

 

}

    }

 

// class methods

    function format($number,

 

$calculate_currency_value = true, $currency_type = '',

 

$currency_value = '') {

      global $currency;

 

      if

 

(empty($currency_type)) $currency_type = $currency;

 

      if

 

($calculate_currency_value == true) {

        $rate =

 

(tep_not_null($currency_value)) ? $currency_value :

 

$this->currencies[$currency_type]['value'];

       

 

$format_string =

 

$this->currencies[$currency_type]['symbol_left'] .

 

number_format(tep_round($number * $rate,

 

$this->currencies[$currency_type]['decimal_places']),

 

$this->currencies[$currency_type]['decimal_places'],

 

$this->currencies[$currency_type]['decimal_point'],

 

$this->currencies[$currency_type]['thousands_point'] . '') .

 

$this->currencies[$currency_type]['symbol_right'];

// if the

 

selected currency is in the european euro-conversion and the

 

default currency is euro,

// the currency will displayed in

 

the national currency and euro currency

        if (

 

(DEFAULT_CURRENCY == 'EUR') && ($currency_type == 'DEM' ||

 

$currency_type == 'BEF' || $currency_type == 'LUF' ||

 

$currency_type == 'ESP' || $currency_type == 'FRF' ||

 

$currency_type == 'IEP' || $currency_type == 'ITL' ||

 

$currency_type == 'NLG' || $currency_type == 'ATS' ||

 

$currency_type == 'PTE' || $currency_type == 'FIM' ||

 

$currency_type == 'GRD') ) {

          $format_string .= '

 

<small>[' . $this->format($number, true, 'EUR') .

 

']</small>';

        }

      } else {

        $format_string =

 

$this->currencies[$currency_type]['symbol_left'] .

 

number_format(tep_round($number,

 

$this->currencies[$currency_type]['decimal_places']),

 

$this->currencies[$currency_type]['decimal_places'],

 

$this->currencies[$currency_type]['decimal_point'],

 

$this->currencies[$currency_type]['thousands_point']). ' ' .

 

$this->currencies[$currency_type]['symbol_right'];

      }

 

 

 

  return $format_string;

    }

 

    function is_set($code) {

 

 

    if (isset($this->currencies[$code]) &&

 

tep_not_null($this->currencies[$code])) {

        return

 

true;

      } else {

        return false;

      }

    }

 

   

 

function get_value($code) {

      return

 

$this->currencies[$code]['value'];

    }

 

    function

 

get_decimal_places($code) {

      return

 

$this->currencies[$code]['decimal_places'];

    }

 

   

 

function display_price($products_price, $products_tax,

 

$quantity = 1) {

      return

 

$this->format(tep_add_tax($products_price, $products_tax) *

 

$quantity);

    }

  }

?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...