Zen Cart Logo
Forums / General Questions / inject new order from outside php source

inject new order from outside php source

Locked

Views: 1,035

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
8 Jun 2008, 10:27 AM
#1
kender avatar

kender

New Zenner

Join Date:
Jun 2008
Location:
Central USA
Posts:
2
Plugin Contributions:
0

inject new order from outside php source

Okay, what I am wanting to do is use an existing PHP page that selects a large group of variables and inject an order directly

I will need to

  • search if there is an active order with items already
    if theres no order
    • create it
      if there is
  • then add info to existing order as new line

is there an example of where i can find this, or a pointer to what fields i will need to directly edit (once the order is entered, i am sure the view cart feature will allow deletion of whatever i add, so that shouldnt be an issue)

I will be adding a custom defined product id (which will be generated by the selections on the page) a description and price (quantity will always be 1, with no editing of quantity)

8 Jun 2008, 11:25 AM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: inject new order from outside php source

At one level Zen cart is just a database with 1,300 php scripts to control input and output of the data. So you could bypass the Zen Cart code and address the database directly from your own script. But I suspect that you would have to write a lot of complex PHP to do so.

I can't help feeling that this is a case of the tail wagging the dog. In essence you're asking how to replicate the order class, and all the stuff that goes around it, when maybe a better approach would be to take advantage of the existing back end processing and instead inject your php page specific information into a clone of the checkout_confirmation page.

But whichever way you choose to do this, it's way bigger than can really be handled in a forum post.

8 Jun 2008, 1:08 PM
#3
kender avatar

kender

New Zenner

Join Date:
Jun 2008
Location:
Central USA
Posts:
2
Plugin Contributions:
0

Re: inject new order from outside php source

well, i cant find a way to create the ability i need within the system

basically its this

select dropdown 1 (numeric value, 1-50)
select dropdown 2 (numeric value, 1-50)
select from 2 checkboxes (optional, 8 total)
insert data into 4 input boxes

thats the basics of what it is, actually theres a few more boxes but from the top of my head cant list them all, it fits though in a simple line, and can be limited to 50-80 chars most likely on printout, the unique id will be mostly what defines it

this data will determine pricing and all need to be entered