I will try my best to describe the whole scenario as clearly as possible.
Wordpress site 1
Website name: Seller portal
Database: db1
Wordpress site 2
Website name: Customer portal
Database: db2
Both sites are made with (wordpress + woocommerce). Both db1 and db2 are hosted on the same server.
On site 1, as a merchant you can publish new products for sale and you can also view your sales report. Let's say, on db1, table a,b,c,d,e are used to host your product information and sales report.
As mentioned before, site 2 running on database db2. But only for the product and sales section, it directly communicates with db1 (table a,b,c,d,e).
Therefore, site 1 and 2 store their user info, theme info everything on different databases. But when it comes to product and sales section, they share the same database. So, when anyone buys anything on site 2, merchants instantly gets the sales info on site 1. And when merchant publishes a new product to sale on site 1, users of site 2 will instantly see that new product on site 2.
Can anyone directs me to the right path how to achieve this? From wp-config files I see option to connect to only one database.
Thank you.
Since the two sites are essentially the same instance, what is the purpose of having two separate databases?
If I had to use something like that I would try creating a network. It is pretty easy to set up and you end up with basically what you are describing, two different sites that run on the same data, but with only one database.
The only problem is that if you decide to try it you will have to handle the merging of the two databases yourself.
Related
I've been working on some developmental tweaks and theme updates to a client's website on a staging version. The site has a live ecommerce component, so over the few months that I've worked on it, there have been a whole bunch of orders which are on the live site, but not the staging site.
Since Woocommerce (for some strange reason) keeps orders in the same table as its posts, products, pages etc., many of the order ids have already been "used up" in the staging site, so when I try to import them (using a tool like https://wordpress.org/plugins/order-import-export-for-woocommerce/ ) they desync and the order numbers are wrong. There are a few options here; I could try to divorce the visible order number from the post id #, but this is a bit wonky. I've tried some solutions, but these tend not to work with the import plugins I've used. Alternatively, I could always dig into the mysql tables, but this isn't something I want to do everytime I push from staging to live.
Is anyone willing to share a solution, plugin recco or best practice for dealing with this? Thanks!
You cannot keep the orderID for new import , as WP treating everything as post. You can add it as extra meta with order. It will update if the order is existing in the Database. Also you can rise a support ticket here for help
You can also get a plugin that can manage order extra meta from here
I am working on a admin page on a different sub domain.
e.g Main website - www.mydomain.com
Admin Website - admin.mydomain.com
Both websites have completely different themes because Admin Website will be running a customise theme, and will have additional backend features like accounting/CRM etc.
I'm currently running on 2 installations of wordpress and 2 databases. Main website is running a Reviews function and a Private Message function that allows me to write a review for a user, and send private message to user.
I log all reviews and private message in Main Website Database by using $wpdb->Insert
However, now, i want to let all these reviews and private message to be available to my user, and I want to let Admin Website and Main Website share same USER database (for the convenience of login and log out), because on the Admin website the user can change his personal information etc which will be reflected in the Main Website.
TLDR Version: How do I use 1 database for 2 installations and let both access get_post, get_usermeta, get_postmeta etc in their own installation?
I understand if share database i will have problem with the hyperlinks etc.
You need to create install WordPress multi sites and here is the link below,
http://codex.wordpress.org/Create_A_Network
Hope this will be helpful for you.
I plan to have 15 different websites will sell the same products but will be in different languages connected to the domains. For example www.shop-a.it will be Italian, www.shop-b.de will be in German and www.shop-c.co.uk will be in English and so on. Is it best to have 15 different Magento websites with 1 store in each or is it best to have 1 or 2 websites with up to 7 stores in each.
There is no correct answer for your question based on the information you provided.
Both approaches are equally valid.
But this will help you decide.
I would go with the 1 website 15 store views approach but if the answer to at least one of the questions below is "YES" or "Maybe" then you need to have 15 websites with one store view each.
Do you want the users for www.shop-a.it to NOT have access automatically to www.shop-b.de?
Do you have at least one product that will have a different price on at least 2 websites?
Do you plan to have promotions that will apply to www.shop-a.it and will not apply to www.shop-b.de ?
Do you plan to have different category trees for at least 2 websites? (I'm not talking about just translating the categories - but a different tree structure all together)
Do you plan to have different payment methods on at least 2 websiste?
You can have one magento installation in base domain. You can create multiple stores , like each store for one language. You can ping each store to the separate domain .
As you have mentioned that you would be selling same products on all websites, then it will be better to have 1 installation of Magento and manage multiple website environment from single admin panel.
Reasons why to choose 1 magento with multi websites setup:
1 time product entry for all websites.
single admin area to manage all customers and orders.
It will be better (in my opinion), because by using single Magento it will be easy to manage for you.
I'm about to start on a new project but I'm doubting if I should use Multisite for the company's structure or not.
The situation is as follows;
Corporation is based in a few EU countries, which each of the country websites have a consumer website and a professional website.
My thought was; Use multisite to make the consumer/professional switch and use WPML for each website. Things went fine so far. Yet; all websites have one shared product database. I'd like to make a custom post type "Products" and have them available in every language on every website (Consumer/Pro). Yet I cant find a way to have it (easily managable) share that product database and its relations.
So there's my doubt on using MultiSite, and as of yet, I dont see any other option to get what I want; Consumer/Professional sites, all with their own content, but with a shared product database.
You can use the switch_to_blog() function within your product archive (http://codex.wordpress.org/WPMU_Functions/switch_to_blog). This would allow you to get the products from another site within the multisite. Then use restore_current_blog() to return back to your individual site.
I am currently working on (a part of) a site where people buy an item from a magento based e-commerce website. However, to use that item, they need to go to another website. Basically that "other" website is what I am working on (and doing it via codeigniter)
I dont know much about magento. the only information my website needs from the magento website is some information regarding products (id, name and status). This information will be linked to other tables, i.e the product ID may be a foreign key in a table in my database. I did a little research and was able to figure out how data is stored in the magento database.
Both websites will be on same server.
Now I have two options which I could think of to get products from the magento website into my website,
first is that I create insert,update and delete triggers for the required tables in the magento website so that when a product is added, modified or deleted, it first tries to do the same on my database, and if successful, continues to do it in the magento database.
second option is that I simply merge the two databases of my website and magento website creating a direct relation link between the tables.
Like I previously stated, I dont know much about magento. So i wanted to know which was the safer, better approach or if there was an approach I diddnt think of.
Any help would be appreciated. Thanks.
further clarification of task:
Basically there is a magento website (lets call it "WEBSITE A") which sells "products". When a person buys a "product", they are basically given a "code" for that product. To use this "code", they have to go to another website which I am building using codeigniter (lets call this "WEBSITE B").
Now as you can guess, the code needs to be used in WEBSITE B, and once used it unlocks stuff for the user based upon the product to which the code belonged.
As you can guess, this will create a lot of links between product and other stuff.
product although created in WEBSITE A , is used in WEBSITE B.
Your first option: Never duplicate data unless you can help it. Why couldn't you query the Magento database instead, since it's on the same server?
Your second option: Never merge databases that aren't related.
Both options are basically anti-patterns. What you should do is query the Magento database directly, or if you want to use the Magento helper functions, include Magento and use its API directly:
<?php
require_once 'path/to/Mage.php';
// Use Magento APIs
?>