X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   How to access admin area php functions from customer side (https://forum.x-cart.com/showthread.php?t=75138)

Joe Thompson 03-28-2017 08:02 AM

How to access admin area php functions from customer side
 
We have a moderately customized store that utilizes a unique ordering function. All of the set-up that takes place prior to allowing customers access to their "area" to order is done on the admin side by someone with an administrator account. One piece of this process is inputting a name and email address, which is then fed through a few different functions that add this information to other options/settings that gets the system ready to take orders.

So right now, someone with an administrator's login is responsible for inputting all this information. What I'd like to have happen is allow our customers to be able to provide their name and email address themselves in a form (from within our site, so they'd be logged in under a customer account) - and then their information is then passed to the admin side where all the necessary functions are that will manipulate and do what they need to.

I have a form on the cart.tpl page that collects the name and email address, and then actions are taken in cart.php on the data. I'm running into issues when trying to require the admin files that are necessary to process the data that is being submitted.

I'd like to find a clean (and safe) way to send the information to the right files for processing, but I think I'm running into user account issues. I don't want to permit customers to login as an administrator in order to have access to the files in the admin area.

Any idea on how to get input from the customers passed into a few functions that are housed on the admin side, and then eventually saved into the db?

qualiteam 03-31-2017 03:54 AM

Re: How to access admin area php functions from customer side
 
I think you should provide more information as at the moment it is unclear what files you want to use.
Perhaps, an easier way will be creating a new script in the storefront "area" and copy-pasting some code from the "admin" script(s).

Joe Thompson 05-03-2017 08:51 AM

Re: How to access admin area php functions from customer side
 
Moving some of the scripts to the storefront area was a good suggestion - I did so and am now able to complete the solution. Thank you for the suggestion!


All times are GMT -8. The time now is 03:54 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.