Best way to implement Wholesale pricing?

Highlighted
New Member
17 0 0

I have a Shopify site where I want to offer wholesale pricing. here's what i'm looking to do:

Each product will have tiered pricing per quantity, ex: 36 - 71 pieces will be $10.15, 72-107 will be $8.60, etc.

Each product will typically have a Size variant.

Currently, i've built a form in javascript that totals up the number of pieces they have, so there's the total quantity. What I now need to know is how I can have that total quantity have the accurate price for the checkout.

What would the best way be to go about doing this? I'm fairly certain i'll be having to utilize more Javascript obviously, just wondering if anyone has done it before and if there's already a way to do this so i'm not re-inventing the wheel.

thanks!
truck

0 Likes
Highlighted
New Member
5 0 0

I am actually looking for a similar answer, I would like tiered pricing based on quantity but how?

0 Likes
Highlighted
Shopify Staff
Shopify Staff
5704 1 326

Hi Robyn,

This will get you started: http://support.myshopify.com/faqs/help-articles-faq/can-i-offer-wholesale-or-bulk-pricing

Best,

Caroline @ Shopify

0 Likes
Highlighted
New Member
17 0 0

Caroline, what's a workaround for someone in my situation?

0 Likes
Highlighted
Shopify Staff
Shopify Staff
5704 1 326

You'll have to create a variant for each quantity range, and use JavaScript to add the proper variant based on the quantity.

0 Likes
Highlighted
New Member
17 0 0

Do you have any examples of what you mean?

0 Likes
Highlighted
Shopify Staff
Shopify Staff
5704 1 326

Hi Truck,

What is it you don't understand?

Say I have a product with these variants:

Variant no 1. For qty 1 to 4: $1.99.

Variant no 2. For qty 5 to 9: $1.75.

Variant no 3. For qty 10 and more: $1.25.

You place a quantity field on the product page and listen to the submission of the add to cart form with JavaScript.

When the form is submitted, you read the quantity, then, based on that quantity, you update the value of a hidden input field with the proper variant ID. When done, you 'return true' so that the form is submitted.

Best,

Caroline @ Shopify

0 Likes
Highlighted
New Member
17 0 0

Hi Caroline, this is what i've come up with, and it's not adding to the cart. Any ideas?

 

 

{% if product.available %}

		<form action="/cart/add" method="post" id="franchises-form">

		<!-- Our price tier -->
		{% for variant in product.variants %}
		<input type="hidden" name="_" value="{{ variant.id }}" pricing_tier="{{ variant.option2 }}" pricerange="{{ variant.option1 }}" class="remove_before_submit">
		{% endfor %}
		<!-- Populate before pushing user -->
			<input class="id" type="hidden" value="0">
			<input class="quantity" type="hidden" value="0">

			<!-- Auto sort by variant type and pricing -->
			{% for variant in product.variants %}
				<label>{{ variant.option2 }}:</label>
				<input style="background: white;" class="remove_before_submit" type="text" variant_id="{{ variant.id }}" prefixed_pricing_tier="{{ variant.option2 }}">
			{% endfor %}

			<label>Total:</label>
			<input id="_item_cost_total" name="_" type="text" readonly="readonly">
			<br />
<input type="submit" name="add" id="add-to-cart" value="Add To Cart" />
			
		</form>

<!-- js test -->
<script src="http://code.jquery.com/jquery-1.4.2.js" type="text/javascript"></script>
<script type="text/javascript"><!--
var cache = {}; $("input[prefixed_pricing_tier]").each(function() { var $t = $(this), tier = $t.attr("prefixed_pricing_tier"); if (!cache[tier]) { cache[tier] = true } else { $t.prev().andSelf().hide(); }  })

var $j = jQuery.noConflict();
$j(function() {

    // Locate all "Small" products
    $j("input[pricing_tier='Small']").each(function (i) {
    //    alert( "Range: " + $j(this).attr("pricerange") );

        // Split the range into two ints.
        var price_range;
        price_range = $j(this).attr("pricerange").split("-");

     //   alert( parseFloat(price_range[0], 10) );

    });

});
//--></script>

it's obviously not pushing the items into the cart, do you have any idea how i can do this?

thanks

 

0 Likes
Highlighted
Excursionist
54 0 5

truck, did you find the final code?

 

if so could you post?!

0 Likes
Highlighted
New Member
26 0 0

Any luck on this trunk?

I too am trying to see how to get this to work. Having some sample code would really help!

 

0 Likes