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

Climbing Turn logo

Clear understandable advice from Climbing Turn

Give us a call on +44 (0)1438 791010

Let's talk

Other blog items

AI UK opening address at the Conversation Stage

AI UK 2024

The AI UK Conference held on the 19th and 20th of March 2024

IT Business owner has just had a great idea

Should you be selling something else?

Victorian Cash Register

Engage your website visitors

What is your number one service or product?

The terminator from the film of the same name

Teaching Ethics to AI

I will be back!

The blockchain visualised as a metaverse of objects

Blockchain Consensus for change

It's More than Just Crypto Currency

AI image created from text: Black stallion creates thunderbolt of business innovation

How AI Benefits Business

5 Business Benefits of AI

Storage at London Drum Company

London Drum Company New Site Launch

Online Drum and Percussion Hire

Cartoon image of a spy

How much do you share?

Privacy at a bus stop

Example of a Google Analytics page

Google Analytics

MAMP setup

How to use MAMP (Mac Apache MySql php)

How to run multiple projects simultaneously with MAMP

Image of Desktop and mobile views of site

Introducing BTR International

International move management services

DragonVet Branding

DragonVet: a Hand-crafted Digital Presence

Make your message clear

Images from the How and Why website

How and Why has Launched

A website made to stand out from the crowd

Merlin Logo

Merlin Engine API builder

Get Ready… It’s Almost Here!

Criminal stealing you data

How to prevent Phishing

Phishing is associated with a particular type of nasty fraud.

GDPR

General Data Protection Regulation

This new regulation comes into enforcement on the 25th of May 2018.

Lasting Impressions for Expression Engine v4

Lasting Impressions for ExpressionEngine

Lasting Impressions is ExpressionEngine 4 ready!

Skull and crossbones

Cyber Security

Five tips on how to keep your business safe

Key Performance Indicators

Is Your Website Rubbish?

How to measure its success online

Make your customers happy

Top tips to woo customers

Things that customers love

Customer Satisfaction

Top mistakes that lose you customers

Top 5 mistakes to avoid when publishing on the internet.

EU and British Flags

Is your Web Site Ready for Brexit?

Leaving the EU will bring both threats and opportunities

Whack a Witch

Primary School Children Code HTML

Climbing Turn blog image

Curse of the Brochure Site

Missing the opportunity

Climbing Turn blog image

A Web “Page”

It’s NOT a page!

Climbing Turn blog image

Exceptionally Dull Weirdos

This is a response to Willard Foxton's recent article on the Daily Telegraph blog

Climbing Turn blog image

The Website Machine

What is a website?