icreation Posted March 1, 2015 Share Posted March 1, 2015 I wish to use Processwire to extend the CMS functionality that is limited in Open Cart and thought of having a /processwire subdirectory and using the API as described in http://processwire.com/api/include/ However, I have stumbled at the first block by trying to include the Processwire index file. I get an error. I tried these: <?php include('/home/opencart/public_html/processwire/index.php'); <?php include('http://absoluteurl/index.php'); <?php include('../../..relativeurl/index.php'); Can someone give more detail on how to access the Processwire API from an external application? Link to comment Share on other sites More sharing options...
bernhard Posted March 1, 2015 Share Posted March 1, 2015 sorry, no experience in using PW api outside of PW, but i bet being more precise on that I get an error. would increase your chances of good answers Link to comment Share on other sites More sharing options...
icreation Posted March 2, 2015 Author Share Posted March 2, 2015 Yes, I get a 500 internal server error. Trying other relative urls gives Warning: include(../processwire/index.php) [function.include]: failed to open stream: No such file or directory in /home/opencart/public_html/catalog/view/theme/default/template/information/information.tpl on line 18Warning: include() [function.include]: Failed opening '../processwire/index.php' for inclusion (include_path='.:/usr/lib/php') in /home/opencart/public_html/catalog/view/theme/default/template/information/information.tpl on line 18 Notice: Undefined variable: wire in /home/opencart/public_html/catalog/view/theme/default/template/information/information.tpl on line 31Notice: Trying to get property of non-object in /home/opencart/public_html/catalog/view/theme/default/template/information/information.tpl on line 31Fatal error: Call to a member function get() on a non-object in /home/opencart/public_html/catalog/view/theme/default/template/information/information.tpl on line 31 Link to comment Share on other sites More sharing options...
LostKobrakai Posted March 2, 2015 Share Posted March 2, 2015 Based on your error you're expecting processwire to be here. /home/opencart/public_html/catalog/view/theme/default/template/processwire/index.php That's your problem at least for relative urls. Includes always start from the file their in, not from any index.php, which would reside in the root folder calling that file. What error did you get for the absolute path? Link to comment Share on other sites More sharing options...
Craig Posted March 2, 2015 Share Posted March 2, 2015 OpenCart defines several constants to various different paths (although not one for the "root" directory it seems), which you may find useful for this. You can see these if you open up config.php. Choose one, and use it in your template. For example, this might work: require_once(DIR_SYSTEM . "../processwire/index.php"); Link to comment Share on other sites More sharing options...
dazzyweb Posted March 2, 2015 Share Posted March 2, 2015 The second error you showed using other relative urls would be because you used incorrect urls. Regarding the internal server error: I also just tried this with Opencart (using the correct relative path) and also got an internal server error. Link to comment Share on other sites More sharing options...
dazzyweb Posted March 2, 2015 Share Posted March 2, 2015 Trying this myself I get the following in processwire errors.txt file: 2015-03-02 05:35:42 ? http://localhost/?/%C2'> Error: Call to undefined method User::setIsLoaded() (line 325 of C:\xampp\htdocs\sites\opencart\pr\wire\core\Pages.php) Link to comment Share on other sites More sharing options...
pwired Posted March 2, 2015 Share Posted March 2, 2015 What about installing opencart and processwire in the same database, maybe that would make things easier ? Link to comment Share on other sites More sharing options...
icreation Posted March 2, 2015 Author Share Posted March 2, 2015 I have both installation in the same database and root directory. On adding the following statement based on Craig's suggestion above I get: require_once(DIR_SYSTEM . "../processwire/index.php"); Internal Server error 500. it is the correct path but the Processwire API will just not work here it seems. Link to comment Share on other sites More sharing options...
Yannick Albert Posted March 5, 2015 Share Posted March 5, 2015 "Oh, look... Off-Topic!" Link to comment Share on other sites More sharing options...
dazzyweb Posted March 5, 2015 Share Posted March 5, 2015 I have read that article before but it didn't really persuade me either way since there are not a whole lot of other alternatives. Also Opencart has improved since then with a new version and at the same time nothing out there is perfect. @Yannick Do you have some other suggestions for an e-commerce site that needs a decent amount of products and features and is open source? I have tried Prestahop & woocommerce. As far as building an online shop I found Opencart to be a better alternative than either of them. Link to comment Share on other sites More sharing options...
Yannick Albert Posted March 10, 2015 Share Posted March 10, 2015 ... @Yannick Do you have some other suggestions for an e-commerce site that needs a decent amount of products and features and is open source? I have tried Prestahop & woocommerce. As far as building an online shop I found Opencart to be a better alternative than either of them. I haven't tried them yet, but i will, for sure ;-) ... Oxid Avactis AbanteCart VamCart/VamShop Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now