nikita's Profile
Reputation: 0
Neutral
- Group:
- Community Member
- Active Posts:
- 26 (0.01 per day)
- Most Active In:
- General Support (13 posts)
- Joined:
- 06-June 05
- Profile Views:
- 3,596
- Last Active:
Oct 30 2009 03:53 PM- Currently:
- Offline
Latest Visitors
-
chieuhado 
20 Jan 2010 - 10:09 -
dickie 
15 Jan 2010 - 01:16 -
jeltoesolnce 
25 Jun 2009 - 14:57 -
rashid idris 
24 Sep 2008 - 17:01 -
radkog 
16 Sep 2008 - 04:48
Topics I've Started
-
Cookie used language
Posted 26 Oct 2009
I need a very simple cookie add to my osc site:
- when website user select one language, system sets a necessary cookie and remeber choosen language for that user;
- when this user comes back to the website (eg. after a week) our system automaticaly reads cookies and show website in a saved language.
How to get this simply? -
Add % to each customer price.
Posted 23 May 2009
I thought about price in the shop.
Decided that there is an opportunity to add to "currencies.php" class another value to calculate the price for each customer.
1. I have made a new collumn in 'customers' table named 'customers_percentage';
2. In 'application_top.php' I have added the request which will give me the value:
$percent_query = tep_db_query("select customers_percentage from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");$percent = tep_db_fetch_array($percent_query);
3. Opened class 'includes/classes/currencies.php' and decided to correct the line:
$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'];
4. By adding another calculation based on my new cell value in customers table (... * ($percent['customers_percentage']) ...), and the line become the following:
$format_string = $this->currencies[$currency_type]['symbol_left'] . number_format(tep_round($number * $rate * ($percent['customers_percentage']), $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'];
Finally, the prices in my shop become zeros! Mistake!
Than I decided to change my value to simple number. For example: +2, -4 (... number_format(tep_round($number * $rate * (-4) ...). The result was great - I mean all the calculation works for now, but only with number, but I need it to work wih my value!
And so, why I can't give the value when I put my request -> $percent['customers_percentage'] in a class?
I hope there are lot cool coders which could give me examples, corrections and comments on my post?
My Information
- Age:
- 23 years old
- Birthday:
- December 25, 1986
- Real Name:
- Nikita
- Gender:
- Add-On Dev:
- Yes
Contact Information
- E-mail:
- Click here to e-mail me
- Website URL:
-
http://www.bonbon.lv
Friends
nikita hasn't added any friends yet.

Sign In
Register
Help

Find Topics
Find Posts
Comments
nikita has no profile comments yet. Why not say hello?