Multiple Product Price Levels?

New Member
6 0 0
I have a client who is very interested in switching to shopify. The only problem is, he needs to have 3 different levels of pricing, depending on the type of customer (wholesale, buyer, or individual). The prices need to switch site-wide to reflect this level once the customer logs in. Is this possible with shopify?
0 Likes
Shopify Partner
285 0 2

1 way to do this I can think of doing this would be to have 3 shopify sites Eg.

wholesale.myshop.com buyer.myshop.com individual.myshop.com

Then have a landing page which is outside Shopify and directs people to the right place.

Another way (f you only have simple products) is to set up 3 varients for each product and then hide the other 2 using javascript – based on a cookie set at login.

Both ways would need at least 1 page outside of shopify.

Richard Quick - Finalist: SxSW Web Awards 2009 (CSS Category) - SEO and Web design - http://www.successfulsites.co.uk - http://www.mailright.co.uk
0 Likes
New Member
31 0 0

If shopify allows you to make sales while your shopify store is password protected you could have separate sites (using passwords where appropriate to screen users).

I have clients who need this type of setup also but I haven’t thought about it yet.

0 Likes
New Member
6 0 0

That’s interesting, thanks for the responses. I’m no JavaScript expert, but is there a way to keep the hidden variant prices from showing up in the source code as well?

If an individual did a “show source” and saw the three prices side by side, it could lead to some uncomfortable moments for my client ;)

0 Likes
Shopify Partner
285 0 2

You could certainly make it so it wasn’t easily human readable.

You could get liquid to write three variables and give them names that someone wouldn’t immediatly associate with price.

For example:


/* Height in EMs */
totalHeight = 9.99

/* Width in EMs */
totalWidth = 12.99

/* Transparency */
transparency = 14.99

/* Detect Browser */
if (cookieVar12 = 3){
   dispVar = totalHeight
} elseif (cookieVar12 = 2) {
   dispVar = totalWidth
} else (
   dispVar = transparency
)

When what you ACTUALLY mean is:


/* Wholesale price */
priceWholesale = 9.99

/* Buyer Price */
priceBuyer = 12.99

/* Retail price */
priceRetail = 14.99

/* Detect Which type of customer you're dealing with so you can price differently */
if (userType = "wholesale"){
   priceToShow = priceWholesale
} elseif (userType = "buyer") {
   priceToShow = priceBuyer
} else (
/* Else, assume they're retail */
   priceToShow = priceRetail
)

Basically, just a good old fashioned bit of obfuscation.

A good javascript programmer would be able to work out what you’d done, but unless your clients are javascript programmers that shouldn’t be an issue.

It doesn’t toally take away the potential for embarassement (people have clever kids) but it does mitigate it quite a lot.

HTH

- Rich

Richard Quick - Finalist: SxSW Web Awards 2009 (CSS Category) - SEO and Web design - http://www.successfulsites.co.uk - http://www.mailright.co.uk
0 Likes
Shopify Partner
285 0 2

Also – if you wanted to add a bit more confusion to the thing, you could put some junk javacript between the prices (functions you never intend to use). eg:


/* Height in EMs */
totalHeight = 9.99

function compendiumSorter(){
  if (totalValues == 1 | totalValues != 12){
    i = 12
    while (i < 300){
       document.write($newsVar)
       i++
    }
  }
}

// This converts a javascript array to a string in PHP serialized format.
// This is useful for passing arrays to PHP. On the PHP side you can 
// unserialize this string from a cookie or request variable. For example,
// assuming you used javascript to set a cookie called "php_array" 
// to the value of a javascript array then you can restore the cookie 
// from PHP like this:
//    <?php
//    session_start();
// Width in EMs
totalWidth = 12.99
//    $my_array = unserialize(urldecode(stripslashes($_COOKIE['php_array'])));
//    print_r ($my_array);
//    ?>
// This automatically converts both keys and values to strings.
// The return string is not URL escaped, so you must call the
// Javascript "escape()" function before you pass this string to PHP.
function js_array_to_php_array (a)
{
    var a_php = "";
    var total = 0;
    for (var key in a)
    {
        ++ total;
        a_php = a_php + "s:" +
                String(key).length + ":\"" + String(key) + "\";s:" +
                String(a[key]).length + ":\"" + String(a[key]) + "\";";
    }
    a_php = "a:" + total + ":{" + a_php + "}";
    return a_php;
}

/* Transparency */
transparency = 14.99

Richard Quick - Finalist: SxSW Web Awards 2009 (CSS Category) - SEO and Web design - http://www.successfulsites.co.uk - http://www.mailright.co.uk
0 Likes
New Member
6 0 0

Well, it turns out there is a set formula to the different pricing levels, so that makes life easier in terms of source. What about setting the various account levels?

In the cookie/landing page solution would you have to keep a separate set of logins and passwords outside of shopify in a separate database? How would that integrate with check out in shopify?

It won’t look very good to make users log in twice…

Sorry for all the extra questions, I am trying to get a bit of a headstart since I am new to liquid (time to have a bit of a sit down with the documentation).

(I really appreciate the help in getting together a solution, this looks like a great user community in the makings.)

0 Likes

@bizartist 

 

Hope you are well I have just been skimming through your discussion here and I believe we can help we have over 10 years experience working with these Shopify B2B and Wholesale situations.

 

I woudlnt suggest using Javascript for this as you and others have pointed out this is fraught possible insecurities etc. Depending on your approach and variant setup on your products I would suggest adopting the following approach as it means that the basis of the restrictions is done with liquid code ( which is run server-side ) and therefore is far more secure.

 

In this example here are the prerequisites

 

1. Products have variants for the different pricing    

2. You create an indicator on the variants to identify which level of client it is applicable to ( pick a field not in use )

3. Customer is logged in with an active storefront account that is Tagged to indicate the level they are

 

On the products page, you can then modify the variant output in liquid to something similar to this 

 

If customer 
>if customer.tags contains (X)
> For variant in product.variants
>if field Y = Value
> output variant
>endif
>endfor
>elsif customer.tags contains (W)
> For variant in product.variants
>if field Y = Value
> output variant
>endif
>endfor
>else
Standard customer code goes here
>endif


This is just a loose sketchy example but should give you a jumping off point 

 

Should you want us to help and further just reach out to us directly and give our post a thumbs up there are a million different variations of solutions like this depending on your exact requirements 

 

Cheers

Mike

 

 

 

 

 

Twiiter: http://twitter.com/inspiradigital Website Development: https://www.inspiradigitial.co.uk B2B https://www.inspiradigital.co.uk/our-services/b2b-ecommerce-on-shopify
0 Likes
Highlighted
Shopify Expert
9965 84 1469

@Inspira_Digital wrote:

 

Hope you are well I have just been skimming through your discussion here and I believe we can help we have over 10 years experience working with these situations...

 

 


Mike, You've replied to something that's 13 years old. Fair to say a solution was found by now. Let's not revive old posts like this please.
I can see aspects where you're offering some help but it still feels like a reply to advertise more than anything else.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes