Related / Friend Blogs
Top Poster
#1 ramon fincken 93
#2 Site admin 2
#3 Jan 0
[solution] Using SunShop shoppingcart with a problem in decimal prices?



Rating : 3 / 5

Tags:

 
Post new topic   Reply to topic    Ramonfincken.com Forum Index -> PHP coding
View previous topic :: View next topic  
Author Message
ramon fincken
Site's programmer


Joined: 03 Aug 2007
Posts: 93
Location: Amsterdam, the Netherlands/Europe

PostPosted: Wed Aug 13, 2008 11:12 am    Post subject: [solution] Using SunShop shoppingcart with a problem in decimal prices? Reply with quote

Using
Code:
  SunShop Shopping Cart
  http://www.turnkeywebtools.com/sunshop/


And having trouble showing decimal prices?

Here's a fix for global.php 's functions-file for the listitem-function:
Code:
/*
  global.php - 03/18/2005 - 5:08:12pm PST - 3.4 Final Repack 2

  SunShop Shopping Cart
  http://www.turnkeywebtools.com/sunshop/

  Copyright (c) 2001-2005 Turnkey Web Tools, Inc.
*/


OPEN
global.php

FIND
Code:
// ###################### listitem ##################
function listitem($id) {


FIND
Code:
   $isoptions=$DB_site->query("SELECT * FROM ".$dbprefix."itemoptions where productid='$id' order by order1");
   if ($iteminfo[price] != $lang_index[login_first]) {


BEFORE, ADD
Code:
   /**
    * Ramon Fincken, WebsiteFreelancers.nl RamonFincken.com
    * Fix to show decimals like xx.yy instead of xx.00
    */
   $iteminfo[price] = str_replace(',','.',$iteminfo[price]);
   



FIND
Code:
// ###################### output item ##################
function outputitem ($itemid, $forceview="") {
   global $templates, $settings, $numon, $action, $id, $start, $lang_index, $DB_site, $dbprefix;
   $iteminfo = iteminfo($itemid);


FIND
Code:
   if ($iteminfo[price] != $lang_index[login_first]) {


BEFORE, ADD
Code:

   /**
    * Ramon Fincken WebsiteFreelancers.nl RamonFincken.com
    * Fix to show xx.yy instead of xx.00
    */
   $iteminfo[price] = str_replace(',','.',$iteminfo[price]);
Back to top
View user's profile Send private message Visit poster's website
Google adsense
Advertisement





PostPosted: Wed Aug 13, 2008 11:12 am    Post subject: [solution] Using SunShop shoppingcart with a problem in decimal prices?

Advertisement
Back to top
Post new topic   Reply to topic    Ramonfincken.com Forum Index -> PHP coding All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
General forums
The world of freelance
Programming
Other projects
Poll
I love gifts

Yes goodies and presents! [1]
No but I love polls ! [0]

Technorati Profile