BenPF
December 7, 2022, 10:43am
1
Hello.
We have part numbers which contain hashtag, like this:
RRP584#Sport
We only want to display the part number up to the hashtag, we don’t want anything including and after the hashtag to be displayed, like this:
RRP584
We display the part number (SKU) like this:
Part number:
{% assign current_variant = product.selected_or_first_available_variant %}
{{ current_variant.sku }}
Is there some logic we can add to do this?
Thanks
Hello @BenPF
Could you please share your store URL or the page link ( with a pass if your store password is enabled ). I think I can give you the right solution.
BenPF
December 7, 2022, 11:46am
3
I checked, the code you used is correct
The content displayed is the content entered in the SKU
You should type content with only the content you want
eg: RRP584
BenPF
December 7, 2022, 12:17pm
5
Hello yes, but we would only like to display the part number before the #
@BenPF
Try this code
Part number:
{% assign current_variant = product.selected_or_first_available_variant %}
{% assign sku = current_variant.sku | split: "#" %}
{{ sku.first }}
Try it and let me know
BenPF
December 7, 2022, 4:21pm
7
@ExpertRookie that worked!! THANK YOU