How can I create a metafield with the type: product, for a shopify input? - shopify

I have made several metafields with the type as product, so I know they work, but in this section they don't show up for this link. I can hardcode the link to a specific product, but I want it to be dynamic using metafields. I'm using the palo alto theme.
and this is the result when I click the dynamic source button:
I'd rather leave any theme customization or coding as a last resort.

A link would take a metafield of type url but you are trying to add a metafield of type product. Type product stores the product object with all its data that's not what you need here if you just need to link to the product page.
Id just set up another metafield of type url and pop the url of the product in there.
I'm not familiar with where you are adding this in the Palo Alto theme but unless this is a section that appears on multiple pages, like product pages or blog pages, where you need to link to a different product on each page you may not need a metafield at all.

Related

Liquid - get product ID and display custom/specific information dynamically

I am trying to add a small 'lockup' / promo to a page that loads information dynamically based on page.metafield information. Replacing images, video ID's etc. Which all works just fine.
My client is asking for a small area to display a product that relates to this dynamically changing content and I am struggling to come up with a good way to do this.
The current setup is that we have 30 pages with a set of 8 metafields each page. Each one of these pages must show a different , single product with an image, title, price, buy button and another button that links out to a partner site.
I can create snippet and load almost all of this info through metafields manually (price, title etc the client could just add to another metafield) but I would prefer to load a product to pull this info so it can be added to cart. Although I can add product data manually, I still don't actually know which product will get added to the cart, because I'm on a 'page' not a 'product'.
The products themselves are using a custom template that is different to the rest of the site so that seems like its not an option. The template for this content page is just 'page' but surely I can call the product object someway? If the client entered a product ID in the metafields, is there a way of pulling that IDs data easily?
Whatever you mean by pulling ID's, but there are a couple of ways of dealing with this. One, you have a Storefront API token, allowing you to freely and securely call Shopify with JS and get back all the data about the ID you're interested in. Or, you have an App installed in the store, in which case you can setup and callback an App Proxy, providing that ID, and getting back all the info you need. Lots of options!

How to add a metafield to Shopify product pages that displays a video?

I would like to create a way for an admin to add a different video on each product page. Such as a field that would take a YouTube embed code. Video needs to be underneath the product description (not part of the description or in place of the product image). Is there an easy way to do this?
If you are using Google chrome you have an extension "ShopifyFD" to add metafields.
There are other apps and API (useful for bulk) that will also help you in adding metafields to product.
Once done you can use {{ product.metafields.___.___ }} format to call the metafield value.

Add custom fields on adding product in shopify

How to add some extra details while adding products?
Currently I am able to add Variant in Product which shows an input field for the product in product details page. But then, I require to add the same Variants for all products.
My Requirement was to add custom field, e.g. Weight, Height, Wood Type, Color etc. that would appear for all products that are of category Table.
Is this possible some how?
This can be accomplished by creating a new template for your product. You can find some documentation for manually configuration additional product options here.
Most merchants on Shopify use apps to avoid manually configuring additional product options.
A simple task for you would be to add the information using the API for metafields since you are saying they are to be added to all the products. More information on metafields API and liquid are in the links below
Metafield Object and Metafield API
If they are only a few products, you can give this app a spin - ShopifyFD
If the different fields affect the price, create variants. Metafields can also be defined at variant level.
Product metafields can be managed from the Shopify adminpanel directly. You don't need a third-party app or chrome extension anymore!
From the adminpage, go to settings (bottomleft corner) and go to Metafields. From there, you can add the metafields to the product and set the desired contenttype (inputfield, image upload, checkbox, etcetera)
You will need to provide a namespace and key, which you can refer to from the code template. For instance: setting the "namespace and key" field to my_custom_fields.somefield, you will be able to access it from the product template file (product.liquid) like so:
{{ product.metafields.my_custom_fields.somefield }} or, of course, assign it like so:
{% assign myField = product.metafields.my_custom_fields.somefield %}
The created metafields will appear on the product editpage at the bottom. No chrome extensions needed!!
The accurate answer to your question is NO, You can't
But, the good news is there are some apps to accomplish the result. Here is one of the apps which is free!

Prestashop : Adding a field to choose Shipping carrier in product page front office

I'm using PrestaShop 1.5.5.0.
I want to add a custom check box list to the product page so a customer can choose shipping carrier on the product details page. Can it be possible ? I can add a specific fields in the product details page. As I'm new it's little difficult for me to figure out how can I add other details and carry the values to the order page and that is also dynamically. Is there any module available by which I can accomplish the task ? Please suggest me.
What I want to do is this : Choosing shipping carrier in product page :
http://www.wayfair.com/LifeStyle-Solutions-Zurich-Platform-Bed-LS3-ZUR-X-CP-LF1087.html
Well It's a tough task. You need to work on the controller if you want to carry the values or create a module like shipping estimate and hook it to the product page that might work.

Different Variants per product: Shopify

I have started to create my eCommerce website and I have run into a road block. I have used a Shopify tutorial to create extra variants (excluding the variant options built in) to allow extra options (http://wiki.shopify.com/Line_Item_Properties). Shopify calls them line item properties. The problem I am running into is, this line property shows up for every product I add. Each product should have its one class of line properties.
Example:
Collection 'A' comes with choices 1, 2, and 3
Collection 'B' does not come with choices (but line property still shows on page)
Collection 'C' comes with choice 5, 6, and 7
Has anyone modified the products.liquid theme to allow such dynamics?
I have attached an image that represents my question. The image above is correct for the assigned product in the assigned collection. The image below should not have the line properties that are added in the product theme page. Is it possible to apply these line properties per product?
The red circle = error
What you'll need to do is create alternate product templates for the different types of products you want to display. See the section on product template variations in the Line Item Properties article on the Shopify wiki:
It’s unlikely that every product of your shop needs to collect the same data when added to the cart. For this reason Shopify supports template variants. To access this feature, head over to the Template Editor. In the sidebar click “Add a new template”. Select your product.liquid and choose a name such as “monogram”. This adds a second copy of the product.liquid to your store called product.monogram.liquid. In this file you can add the form that you wanted. Once created you can go to your product page and you will see a new option in the sidebar where you can select which template to use for the product you are looking at. This allows you to design a series of forms for various kinds of products and associate them later to the products that need them.
Other useful links:
Can I create and use an alternate template for pages, products, collections or blogs?
Alternate templates
template