-
Get Google Chrome.
-
Install the Chrome extension ShopifyFD. Direct link to install extension.
-
Install the Chrome extension Custom Fields. Direct link to install extension.
-
Go to your shop main settings page. Just click here once you're logged-in the right store.
-
On that page, click on the Shopify FD icon in your extensions bar. It's a green icon with a plus sign in the center. Doing that will load the following form on the page: http://take.ms/Cy5wz
-
Right under Add New Metafield, enter
c_f
. (Means 'custom field') -
Below that, type
Related Products
. (Or whatever, but that will impact the Liquid you'll need later.) -
And below that, type
[p][_c]Pick a collection to pull related items from on this product's page
. ( [p] means to add to product pages only, and [_c] means a collection picker, and what follows are instructions for merchants, you can change those instructions. ) -
Click on the SAVE button right below the form. ( Not the Save button at the top of the page, you turkey. )
-
Go to any product page in your admin where you want to handpick your 'relevant collection'.
-
On that page, click on the Custom Fields icon in your extensions bar. It's a pink icon, you can't miss it. That will load the following on the page: http://take.ms/ZmhhD
-
Pick your collection in the 'Pick a collection' drop-down.
-
Click on the Save Custom Fields button on the left, NOT the 'Save (without Custom Fields)' button at the top of the page.
-
Then add this bit of code at the very top of your related-products.liquid snippet:
{% if product.metafields.c_f['Related Products'] %}
{% assign collection = collections[product.metafields.c_f['Related Products']] %}
{% endif %}
As a result of adding the code at the top of your snippet, it will be business as usual if you have not handpicked a collection for a particular product: the collection in scope will be used if it's relevant, and if not some other one.
Repeat steps 10 to 13 for any product where you want to handpick a relevant collection for related products.