It is effectively nothing more than having two templates that look the same.
Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products
My Wordpress simply has a (multi-store) shop selector page so I guess I would have a version in each language. As far as Opencart goes, each store can have a different default language no problem, so you could have uk.yourstore.com and spain.yourstore.com with a common admin opening in different languages.
Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products
I've integrated OC into WP as it was suggested in this topic. I have managed to look the design the same. What I can't figure out is how to return to the wp section - blogs etc. from the shop? I would put the main site's link to the Home tab and/or when people click on the header/logo. Or would ad a new tab...
Please give me a detailed answer with codes.
Thank you!
Wordpress is installed at root, and OpenCart is installed under the directory gallery/.
Can't I just create another table within the "Wordpress Database" for OpenCart? Would OpenCart and Wordpress interfere with each other?
How can I make this work? Or is another database necessary....
Thanks.
Although the databases are still effectively seperate, other than that they are in the same physical database for convenience, it does make queries that contain information from both easier.
Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products
so I added this to home.php
Code: Select all
define('WP_USE_THEMES', false);
require('./wordpress/wp-load.php');
query_posts('showposts=1');
I tried creating a new wp-config.php and wp-load.php by duplicating them, renaming them and directing to them, but got in a whole mess of trouble.
anyone see a work around?
thanks.
I am attempting the same thing as 3rdcorner. Any reason why this would happen?
Using 1.4.9 OpenCart and 3.0 Wordpress... Wordpress is in the root and Opencart in ./shop/
Code: Select all
<?php
/**
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <div id="main">
*
* @package WordPress
* @subpackage Twenty_Ten
* @since Twenty Ten 1.0
*/
require_once('./shop/config.php');
//require_once(DIR_SYSTEM . 'startup.php');
require_once(DIR_SYSTEM . 'engine/registry.php');
require_once(DIR_SYSTEM . 'library/session.php');
require_once(DIR_SYSTEM . 'library/request.php');
require_once(DIR_SYSTEM . 'library/db.php');
require_once(DIR_SYSTEM . 'library/customer.php');
// Session
$session = new Session();
Registry::set('session', $session);
// Request
$request = new Request();
Registry::set('request', $request);
// Database
$db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
Registry::set('db', $db);
$customer = new Customer();
$logged = $customer->isLogged();
?><!DOCTYPE html>
Kevin Davidson
Purolator Shipping Module
Canpar Shipping Module
VQMod - Paypal Transaction ID to Payment Details
I have opencart in the directory shop. Wordpress is in the root. After I logged in to opencart as a customer, I went back to the wordpress page that I have print_r($_SESSION). I would have half expected to see customer_id in there somewhere.
Kevin Davidson
Purolator Shipping Module
Canpar Shipping Module
VQMod - Paypal Transaction ID to Payment Details
For this to work on opencart 1.5 I have made the following changes:3rdcorner wrote:So far I've gotten wordpress to pull in customer login information from OpenCart by including the bare minimum requirements for /system/library/customer.php
Here's what I include in my wordpress header.php:Code: Select all
require_once('./shop/config.php'); //require_once(DIR_SYSTEM . 'startup.php'); require_once(DIR_SYSTEM . 'engine/registry.php'); require_once(DIR_SYSTEM . 'library/session.php'); require_once(DIR_SYSTEM . 'library/request.php'); require_once(DIR_SYSTEM . 'library/db.php'); require_once(DIR_SYSTEM . 'library/customer.php'); // Session $session = new Session(); Registry::set('session', $session); // Request $request = new Request(); Registry::set('request', $request); // Database $db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE); Registry::set('db', $db); $customer = new Customer(); $logged = $customer->isLogged();
Code: Select all
require_once('../development/oc/config.php');
require_once(DIR_SYSTEM . 'engine/registry.php');
require_once(DIR_SYSTEM . 'library/session.php');
require_once(DIR_SYSTEM . 'library/request.php');
require_once(DIR_SYSTEM . 'library/db.php');
require_once(DIR_SYSTEM . 'library/customer.php');
// Registry
$registry = new Registry();
// Session
$session = new Session();
$registry->set('session', $session);
// Request
$request = new Request();
$registry->set('request', $request);
// Database
$db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
$registry->set('db', $db);
$customer = new Customer($registry);
$logged = $customer->isLogged();
Thanks for 1.5!
http://forum.opencart.com/viewtopic.php?f=128&t=26860
My Blog / Site
$1 Hosting and Free Domain Name for OpenCart, Wordpress, Joomla, Droopal
Hmmm... I checked the link and the last pages have no complete code. Can you verify?heizo wrote:Ive gotten many of the features asked for working in pre 1.5 open cart installations. Here is the forum for example code (scroll to the last pages for complete code).
http://forum.opencart.com/viewtopic.php?f=128&t=26860
This is very nice topic.
My question is, If a web site has 3 years with WordPress (WP) and all the products, descriptions and prices, are already in WP,
1.- Could it be possible to add a buy button for each product in WP that takes to OpenCart (OC) so the visitor can browse WP for products and click in their respective buy button?.
2.- Can I pass to OC through the buy button the product information like name, brief description, price and quantity via get or post in the URL?
OpenCart should add that product to the shopping cart, OpenCart will also be displayed inside an iframe of a WP page, so the buyer can see how is going his shopping cart, and do the checkout when he is ready.
I do not need to show OC menu, just the registration and shopping cart, because products description and prices are already in WP, I do not want to eliminate the products from WP and to include them in OC, too much work I think.
How can I do all this integration?, are there tutorials, examples or related links or documentation?
Hope I was able to explan myself.
Thanks for your nice help in advance
Best regards
joejac
Replace the code from above with this, still in your wordpress header.php:
Code: Select all
//Pull in some stuff from opencart so that we can check if the user is logged in TO OPENCART (not necessarily wordpress!!)
require_once('../config.php'); //Changed to point at Opencart root (one level up)
require_once(DIR_SYSTEM . 'engine/registry.php');
require_once(DIR_SYSTEM . 'library/session.php');
require_once(DIR_SYSTEM . 'library/request.php');
require_once(DIR_SYSTEM . 'library/db.php');
require_once(DIR_SYSTEM . 'library/customer.php');
// THIS BIT IS NEW!
// Registry
$registry = new Registry();
// Session
$session = new Session();
$registry->set('session', $session); //Changed
// Request
$request = new Request();
$registry->set('request', $request); //Changed
// Database
$db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
$registry->set('db', $db); //Changed
$customer = new Customer($registry);
$logged = $customer->isLogged();
Hope this helps... I found this thread from a google search, so hopefully this can help a few more people than just me!
EDIT:
OK, so having re-read some of this thread this is the same as the Opencart 1.5 code, but nevertheless, its helpful!
I did come across a few more errors when wordpress was trying to access the database later in the page load (particularly around the comments area of the page). I solved this problem by moving all of the code above OUT of the header.php and putting it into the wordpress index.php (in my case "/news/index.php").
By doing this the page loads the relevant stuff from opencart into the session right at the start, and is then able to overwrite variables if they are needed within wordpress itself.
If it helps, I put the code above after "define('WP_USE_THEMES', true);" but before "require('./wp-blog-header.php');".
The only "problem" I can see with having this code in the index.php rather than header.php is that the resulting variables etc will be visible to all themes, but personally I think this is an advantage as it means we can create a new wordpress theme if required and not have to remember to add the code again!
Oh... and the fact that upgrading wordpress will nuke the code out Bugger
Web developer for Cotswold Web Services / Innuo Ltd
Need help with your Opencart website? Give us a call to see how we can help.
Users browsing this forum: No registered users and 21 guests