Welcome Guest, Not a member yet? Register   Sign In
Cart Helper function passing products to cart without URI string
#1

[eluser]Unknown[/eluser]
As an overview of my project. I have built it in Codeigniter and am using FUEL CMS as the content management system for the client side. The site connects to an external ASP.NET server via an API. The external server is using postgreSQL and XML.

The site needs a very simple shopping cart based on the products that I'm returning from the external server. At the moment I am passing product details to my cart via the URL like so:

Code:
localhost/cart?id=+&qty=6&price=2.05&name=BUILDING+SAND+RED+PRE+PACKED&part=01100015

However, this is obviously not massively secure as anyone could change the value of a product etc.

I would like to pass the details to the cart page without having to go through the URL. Can anyone help? I'll post my MVC below {although I can't post all my code here}

PRODUCTS
MODEL: http://codepad.org/aheO9yOT
VIEW: http://codepad.org/RW2KI5Xg
CONTROLLER: http://codepad.org/P9FxrYX6

CART
MODEL: no model as not storing in db at present
CONTROLLER: http://codepad.org/pebhYU8z
VIEW: http://codepad.org/qECTWu57

I'm not sure if you'll need all the code but I thought I'd provide as much as a I can.

So my goal is to pass qty, price, part, desc1 through to the cart page without using the URL

#2

[eluser]larsonator[/eluser]
A little more info would be useful.

Is this to inspect each item in the cart?
How is the data for the whole shopping cart stored?

If this was done on the database, typically it would use a weak entity, IE, a reference to the user, a reference to the item, and a quantity. (after the transaction is complete it would be moved to some form of log table to store past transactions).

Since you already know the user, you should only need to provide a product id, and the rest would be sourced from the database.

This is of coarse assuming you are developing the API as well.




Theme © iAndrew 2016 - Forum software by © MyBB