How do I specify different prices for different preferences within my Subscription Box?

There may be instances where you want to charge more or less if a specific preference is selected by a subscriber. 

For example, if you have a Coffee Subscription Box with preferences for the size of the bag of beans (ex: Large Bag or Small Bag), you might want to charge more for the larger bag. In order to do this, head to the Overview tab of the Subscription Box page and scroll down to the section marked "Preference Pricing":

Enter the difference in price you want to add or subtract for the preference. For example, to charge more for the Large Bag, you could enter "10" (which will charge $10 extra on top of the base subscription box price). To charge less for the Small Bag, you could enter "-5" (which will charge $5 less than the base subscription box price).

Once you've done that, you'll need to edit either your theme or Shopify Scripts to display the correct price in your store when the preference is selected. What you need to do depends on whether your store is using Shopify Plus or not.

Shopify Plus Stores

If you have Shopify Plus, you'll need to add some code to your Shopify Scripts Line Item script. If you don't have Shopify Script Editor, go download the app here. If you don't already have a line item script, create one, and then add the following code:

Input.cart.line_items.each do |line_item|
  product = line_item.variant.product
  if product.product_type == 'Conjured Subscription'
    if line_item.properties_was.key?('_Bag Size') and line_item.properties_was['_Bag Size'] == 'Large Bag'
      line_item.change_line_price(line_item.line_price + Money.new(cents: 1000), message: 'Large Bag selected')
    elsif line_item.properties_was.key?('_Bag Size') and line_item.properties_was['_Bag Size'] == 'Small Bag'
      line_item.change_line_price(line_item.line_price - Money.new(cents: 500), message: 'Small Bag selected')
    end
  end
end

Output.cart = Input.cart

Note that you'll need to edit the preference name, the preference selection, and the prices according to your subscription box settings.

Non-Shopify Plus Stores

If you don't have Shopify Plus, you will need to edit your theme. You'll need to find every instance where price is displayed in your theme, as well as the Checkout page on the Page Styles page of the app, and change it to something like the following:

{% if line_item.product.type == 'Conjured Subscription' %}
  {% for property in line_item.properties %}
    {% if property.first == '_Bag Size' and property.last == 'Large Bag' %}
      {{ line_item.final_price | plus: 10 | money }}
    {% elsif property.first == '_Bag Size' and property.last == 'Small Bag' %}
      {{ line_item.final_price | minus: 5 | money }}
    {% endif %}
  {% endfor %}
{% endif %}

Note that you will also need to edit anywhere that displays the subtotal or grand total to adjust the price as well.

If you have any trouble with it, please email support@conjured.co and we can help you out!

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us