Expression Engine MSM and CartThrob
We are building two sites using Multi-site Manager (MSM) for one of our clients using CartThrob to manage the e-commerce end of things.
How to sell products from a channel on a different site.
The client has one site which sells B to C and another which sells wholesale, the sites sell subsets of items from the same pool of products. So it is important to the client that the products are stored in the same database and in the case of Expression Engine this means the same channel. You might ask why, it’s simple, who wants to key in hundreds of products twice?
Now the problem with this was that there was no module/plugin off the shelf which could take entries from a channel that is not registered with the current site. This means that channels from Site 1 cannot be seen on site 2.
CartThrob is MSM compliant so I thought “this is great, we’ve used CartThrob before so it should be reasonably painless to get it up and running”. However, there is always a “however” isn’t there? CartThrob is MSM compliant but that doesn’t mean you can use entries from another sites channel. So I asked the guys at CartThrob if there was any way round this. CartThrob doesn’t/didn’t support this out of the box but guess what? Chris Newton came to my aid and made some changes so that it would work! How cool is that?
The code still needed a little tweaking and we had to understand how CartThrob uses the config variables (see Techy Stuff, below).
So now we have two sites using the same products and orders channels from site 1. We added a custom field in the Orders channel to store the name of the site of origin to help the client identify where the orders come from.
Techy stuff
To enable this I added the following variables to the following files:
Config variables
Site IDFilenameVariable1Index.php$assign_to_config['ct_msm_show_all'] =TRUE;2Index.php
$assign_to_config['ct_msm_show_all'] =TRUE;
$assign_to_config['ct_msm_use_site_id'] = 1;
N/A/expressionengine \
/config/Config.php$assign_to_config['ct_msm_show_all'] =TRUE;2/themes/third_party/Cartthrob/ \
lib/Extload.php$assign_to_config['site_id'] = 1;
N.B. This is in addition to any configuration you need for MSM itself.
This configuration was done on EE version 2.7.3 and Cartthrob 2.5
Other blog items
Tackling Immersive Harms
Innovate UK event 12th September 2024
Your Customers Need to Trust You
First impressions matter
AI UK 2024
The AI UK Conference held on the 19th and 20th of March 2024
Should you be selling something else?
Engage your website visitors
What is your number one service or product?
Teaching Ethics to AI
I will be back!
Blockchain Consensus for change
It's More than Just Crypto Currency
How AI Benefits Business
5 Business Benefits of AI
London Drum Company New Site Launch
Online Drum and Percussion Hire
How much do you share?
Privacy at a bus stop
Google Analytics
How to use MAMP (Mac Apache MySql php)
How to run multiple projects simultaneously with MAMP
Introducing BTR International
International move management services
DragonVet: a Hand-crafted Digital Presence
Make your message clear
How and Why has Launched
A website made to stand out from the crowd
Merlin Engine API builder
Get Ready… It’s Almost Here!
How to prevent Phishing
Phishing is associated with a particular type of nasty fraud.
General Data Protection Regulation
This new regulation comes into enforcement on the 25th of May 2018.
Lasting Impressions for ExpressionEngine
Lasting Impressions is ExpressionEngine 4 ready!
Cyber Security
Five tips on how to keep your business safe
Is Your Website Rubbish?
How to measure its success online
Top tips to woo customers
Things that customers love
Top mistakes that lose you customers
Top 5 mistakes to avoid when publishing on the internet.
Is your Web Site Ready for Brexit?
Leaving the EU will bring both threats and opportunities
Primary School Children Code HTML
Curse of the Brochure Site
Missing the opportunity
A Web “Page”
It’s NOT a page!
Exceptionally Dull Weirdos
This is a response to Willard Foxton's recent article on the Daily Telegraph blog
The Website Machine
What is a website?