Do you drop ship products from several manufacturers all with different expected lead times and you want to display those lead times on individual product pages? No problem, we will do that with metafields.
First, create metafields on your shop. I use Metafields2 to work with metafield data. Your shop metafields are going to have a namespace of "lead" and the Key is going to be the exact same value as your Vendor names on your product pages. So for example if I have a number of products supplied by ABC Company my metafield key will be ABC Company. the value will be the sentence you want to display about lead times. Such as "Please allow 3 - 5 days for delivery". Only enter one line for each vendor. For example:
lead | .ABC Company | Please allow 3 - 5 days for delivery |
lead | XYZ Suppliers | Please allow 1 - 2 weeks for delivery |
Now to display that on the product page. Add the following to product-template.liquid in your sections list.
{% assign vendor_key = product.vendor %}
{% assign lead_time = shop.metafields.lead[vendor_key] %}
Add it anywhere toward the top of the file
Now look for {{ product.description }} and right after it on the next line add {{ lead_time }}
Save your file and go look at a product.