The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.
 
 
Thread Tools Display Modes
  #1  
Old 05-13-2011, 06:14 PM
Nathan D.'s Avatar
Nathan D. is offline
Junior Member
 
Join Date: Apr 2011
Posts: 3
Default

Product catalog, wholesale and WordPress


Hi All,

I am working on a website for a client that sells wholesale products, but also wants a product catalog without prices or the ability to purchase from the site.

So to break it down:
  • Anyone can view the products, by default without price or purchasing option
  • Wholesale members must be approved prior to being able to purchase or view prices
  • Once approved, wholesale members can see prices and purchase products

After researching these forums and considering how to do this, this is what I came up with:
  1. Install a WordPress membership plugin, I used s2member
  2. Create a Catalog page to display all products, paste Ecwid code on this page
  3. Create Wholesale Catalog page, requiring an approved membership level to view using s2member settings, paste Ecwid code on this page

This sets the base for controlling who can see or do what.

Next, I wanted to change the CSS so that certain portions were hidden, but doing so in the Ecwid theme would mean that it would cause both the open Catalog and the Wholesale Catalog to appear the same.

So using some of WordPress's features, I used the following code (either in the header.php or page.php file):

PHP Code:
<?php
    
if ( is_user_logged_in() ) {
    echo 
'';?>
<!-- Don't do anything -->
    <?php
    
} else {
    echo 
'';?>
    <style type="text/css">
/* Remove the Login/Signup box */
    div.ecwid-productBrowser-auth {
    display: none;
    }
/* Remove the SKU, Price and Add to Bag section */
    div.ecwid-productBrowser-backgroundedPanel {
    display: none;
    }
/*Hide the Product price */
    div.ecwid-productBrowser-price {
    display: none;
    }
    </style>
    <?php 
    
}
?>
This turns the open Catalog into a bare-bones product description and image, unless the user is logged in - then they can use it just like a normal store. I understand that there may not be a use for a separate Wholesale Catalog section since the regular catalog would function exactly the same, but we chose to make the wholesale customers feel like they had a special privilege

In addition, we decided to use the following code in the sidebar to either show an "Apply for wholesale membership" or the Mini Cart widget:

PHP Code:
<?php
                
if ( is_user_logged_in() ) {
                echo 
'';?>
                <div>
                <script type="text/javascript" src="http://app.ecwid.com/script.js?379195" charset="utf-8"></script>
                <!-- remove layout parameter if you want to position minicart yourself -->
                <script type="text/javascript"> xMinicart("style=","layout=attachToCategories"); </script>
                </div>
                <?php
                
} else {
                echo 
'';?><li class="widget-container widget_text">
                <div class="textwidget"><h3 class="widget-title"><a href="<?php echo home_url'/' ); ?>wp-login.php?action=register">Apply For A Wholesale Account</a></h3>
                </div>
            </li><?php 
                
}
?>
So far, this is working for us but I'd be interested to see what others have come up with or if anyone has any other methods that may be superior.
  #2  
Old 05-16-2011, 08:52 PM
Nathan D.'s Avatar
Nathan D. Nathan D. is offline
Junior Member
 
Join Date: Apr 2011
Posts: 3
Default One issue

In testing, it seems that I overlooked one issue (so far):

If a user registers for an account they need to be approved for a wholesale account (LevelX). Until that happens, they are a Level0 and should still not see certain areas of the site (pricing, minicart and Ecwid sign in). However, using the method above - the will be able to see that stuff due to my using of the standard "if logged in" code.

What should be used instead is:
PHP Code:
if (current_user_is("s2member_levelX")){ 
in place of
PHP Code:
if ( is_user_logged_in() ) { 
This way, they can still log in to WordPress but won't be allowed to view the content we want to hide.

There are more examples in the S2Member > API /Scripting > Using Advanced Conditionals section of the plugin.
  #3  
Old 12-15-2014, 12:12 PM
Matt Ecwid's Avatar
Matt Ecwid Matt Ecwid is offline
Ecwid Team
 
Join Date: Oct 2011
Posts: 4,947
Default

You can now implement the scheme you described using the following features:
1) Customer groups / memberships: http://help.ecwid.com/customer/porta...ustomer-groups
2) Hide prices until customer is logged in: http://www.ecwid.com/forums/showthread.php?t=31583
__________________
Matt K
Ecwid Team

Ecwid Guide for Beginners

Ecwid Help Center

Ecwid video tutorials
 
The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.

Tags
hide background panel, hide mini cart, hide prices, wholesale

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:13 PM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.