Welcome Guest, Not a member yet? Register   Sign In
Question about CI shopping cart class code
#11

[eluser]TWP Marketing[/eluser]
[quote author="GSV Sleeper Service" date="1247077880"]wait, CI has a cart library? since when?[/quote]

In case you're serious... The CI cart (in the SVN trunk) is a good basic design and fairly easy to modify if needed.

I needed to support gold and silver currency, denominated in goldgrams and silver ounces respectively, to three decimal places. It was a simple couple of hours work, over a couple of days, to go through the code and add the changes. I also added a shipping charge denominated in goldgrams and another in silver ounces, plus I changed the "format_number" function to accept a decimal places variable and remove the comma separator.

I'll send a copy of my modified cart to anyone interested in using the gold or silver currencies. I left intact the standard, 2 decimal place currency unit, in case you are forced to use the fiat currencies such as US$, Euro, etc.

One warning, I did NOT add the shipping variable for fiat currency, since I don't use it. Which means that you either need to go through the code and add a 2 decimal place shipping charge variable for fiat, or place your shipping charge in the "options" area.
Dave
#12

[eluser]GSV Sleeper Service[/eluser]
[quote author="Dam1an" date="1247079431"]
I'm not sure if thats a genuine or sarcastic question lol Tongue
It's in the SVN trunk[/quote]

it was a serious question, but thanks for the sarcastic reply.

I agree with jondolar, this part seems a bit daft.
Code:
// Is our cart empty?  If so we delete it from the session
if (count($this->_cart_contents) <= 2)
...




Theme © iAndrew 2016 - Forum software by © MyBB