Jump to content

Using Processwire with Open Cart (or other applications)


icreation
 Share

Recommended Posts

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

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 31
    Fatal 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

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

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

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

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

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

...

@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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...