Site icon WP Smith

How to Make a Private eCommerce Store Using Shopp

So one person asked if I could make Shopp available for users who have a registered customer login that they control. So the first thing you have to do is setup Shopp on the backend by allowing Customer Accounts via Shopp > Settings > Checkout. I always select Enable Account Logins integrated with WordPress Accounts just in case the person wants to move towards some sort of Client Portal as well.

Then in Shopp > Settings > Presentation, I used Enable theme templates, which enables me to edit some files without having to worry about hacking core (never hack core!) to customize the way I want it. So then I open my catalog.php template file. As you can see the catalog.php template consists of only one line.

[php]<?php shopp('catalog','catalog-products'); ?>[/php]

Then I open login.php template file, which contains the login information I need for a private ecommerce store for my customers, or my invite-only elite customers. I copy the entire file and paste it with my catalog.php. Then I add one line ahead of the login.php file:
[php]if( ! shopp('customer','loggedin')) {
//login.php login form code
}
else
shopp('catalog','catalog-products');
[/php]

Don't forget that you may also want to hide/unregister your sidebars, or if you are using a genesis theme you can force a content only layout.

So now my store page which calls the shortcode [ catalog ] will now refer to my edited template forcing customers to login before they can see anything. Since I have my customers connected to WordPress accounts, I could also refer customers to the WordPress login screen. Since my store was a bit more complicated as I used a secondary menu system (full of custom links referring to Shopp Categories), connecting customers to WordPress accounts made making the menu system workable. For the front page, I created a fake WordPress custom menu and upon login, the menu system was replaced with a live custom menu, which I talk about here.