Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I'm using Shopify B2B to setup wholesale prices on my site. When a customer logs in, all the prices switch to the B2B discounted price based on the catalog discount.
What is the liquid code I would use to display the Base Price of my product above the discounted B2B price once a customer logs into their B2B account?
Thanks for your help!
We would also like to do this, preferably comparing to retail price, but using 'compare at' price would also be satisfactory. I expect we would need to use some sort of 'if b2b...' call.
We need this as well! Any solusion?
Wondering the same as well. I was hoping we could at least use the `compare_at_price` but that seems to always display as null for b2b catalogs 😕
I have not found anywhere to actually grab the original "standard" price yet.
I see the "Product Price" listed when editing the specific catalog, maybe its a miss as this is a new feature?
You can now add compare-at prices to B2B catalogs via CSV import. Both the price and compare-at price fields need to be set, so you can't use global price adjustment rules, meaning a metafield is probably still a more flexible choice.
Trying to do the same thing! I don't know enough to make this work ... but perhaps using a variant metafield can help?
Ya, exactly what I did for now. Got fancy and dynamically created price break tables too. Hopefully it’ll be available natively as I’d prefer
not to have to manage the extra fields if not needed.
Great idea! What's complicating my situation is that some of the variants on my site have different retail prices. So I'm not able to just display one "Retail Price". I'd have to figure out how to display each variant Retail price (metafield) as each variant is selected.
Agreed. Without this how is a wholesale store supposed to show the discount from MSRP that the buyer is getting?
B2B price catalog also seems to set the compare_at_price to null when trying to retrieve with liquid code even though it's set in Shopify on the variant
I am also trying to figure out how to do this.
Adding another interested party to this thread... Would prefer a native solution, but would be open to exploring a custom fix if someone has used current Shopify B2B platform to do this.
Add another, its frustrating because I have a 20% general discount then all of the price breaks setup for volume and it all works great, but I need the product page to show the retail price so dealers have a better sense of their discount and can easily see how much they should charge as a retailer.
We would also like to know how to have the MSRP show up, this is a must have for B2B orders.
So I did a decent amount of digging and found a solution. It takes a couple of steps but ends up being decently easy:
1. Add a Metafield description for MSRP in the Metafield list under Content (on the right main menu of shopify) > Metaobjects > Add Definition
2. Go to your items and add the MSRP value to the Metafield at the bottom of the PDP
3. Edit your theme's product page (without going into the code) click add a block and select "custom liquid" and add this code or editing to match your metafield:
{% if customer.b2b? %}<p><strong>MSRP</strong>: {{ product.metafields.custom.msrp | metafield_tag }} </p>{% endif %}
Then it will only show up when a customer logs in to a B2B account. See below
Hope this is helpful as it worked for me!
Does this work for variants as well ? That is the issue for me.
You can assign Metafields to a variant so you would follow these instructions but when creating the meta definition you would choose reference variant instead of Product. Then the code will be slightly different because it wouldn't be "product.metafields.custom.msrp" it would be "variant.metafields.custom.msrp".
This is great, seems like a perfect solution. I can't seem to get the metafield to pull into the theme / PDP though. Using Impulse theme, any idea on what might be the issue here?
View in the editor (that $650 showing is actually from the main product price, not the metafield):
variant metafield definition:
metafield value:
JuliusJ,
Without seeing your theme and the editor I can't really help. I would need access to see your theme editor.
Yea but that's only if you're dealing with 1 level of discount tiers.. What if your dealing with 3 levels of discounts?
Hi There,
I extended this solution a bit to include variants (requires the variants to have a mrsp metafield), showing the selected variant (if product has variant, otherwise it shows the mrsp from the product metafield).
{% if customer.b2b? %}
{%- unless product.has_only_default_variant -%}
{% for variant in product.variants %}
{% if variant == product.selected_variant and variant.metafields.custom.msrp != blank %}
{% assign msrp = variant.metafields.custom.msrp.value | money %}
{% endif %}
{% endfor %}
{%- else -%}
{% assign msrp =product.metafields.custom.msrp.value | money %}
{%- endunless -%}
{% endif %}
// place this after the shown price in your price.liquid snippet
{% if customer.b2b? %} <span style="font-size: 75%;opacity: 0.8;">(MSRP: {{ msrp }})</span>{% endif %}
Hope this helps.
This is great news that we can do this. I'm having trouble finding this to put the code.
3. Edit your theme's product page (without going into the code) click add a block and select "custom liquid" and add this code or editing to match your metafield:
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024