How to get variant metafield value + price combined in shopify collection page's each product - shopify

This is the product page. I have here "variant meta field value" + "variant price" combined. So, when I select a variant, it shows variant price + (related) variant meta field value. As you can see on the right side.
How I can do the same for other pages, where we have a list of products. ex: single collection pages etc. Anyone did/do similar things?
My Aim is to get: Product variant Metafield value + Variant price combined. So, when I select variant from dropdown, I'll get both of them and can show below the product title.

Is there a point to this exercise? When you go to checkout, your customer will only ever pay the variant price, never the combined price with the metafield. So what is the point of the metafield price? Seems like a lot of work for no benefit.

Related

How to show <input type="file">field on selecting a product version on liquid shopify

I want to display/show a field when user select a variant of a product:
For example:
A product (sunglass) has 2 variant
i) normal lens
ii) Power lens
when a user selects option (ii) power lens then a file upload field should open (where user can upload his/her prescription).
I have done this with the help of a tutorial, but the file upload field is visible on both variant.
Now how to show/display it on selecting only second (ii) variant.
Thanks
Asif

Adding product variant title in shopify

I've got a few products that have different variants - i.e. Colour, Size, etc.
I'm trying to output the parent(?) variant title using - {{ variant.title }} but that's only outputting the variant options themselves i.e. Small, Medium, Large for Size. Is there a way to output the "Size" title and not the individual variant titles.
Sorry if that's confusing, I know I'm in the close but maybe in the wrong ball park!
I don't think the option titles are available on the variant object - for those you would normally look on the parent product object.
If you are printing the variant details from the context of a product page (or other situation where you already have a product object), you can use product.options or product.options_with_values to get the option category names. The option names will always be in the same order as the option values are listed on the variant, so the first value of the product.options array will be for the first item in the variant.options array.
Once an item is added to the cart, the resulting line_item object gets its own style of an options_with_values object that has the names and values of the associated options, but unfortunately this object does not appear to exist on the variant object itself.
Above links all go to the relevant Shopify Liquid reference pages

NetSuite API - Adding "Item Group" under a Sales Order

I am trying to integrate with NetSuite API to create Sales Orders. It works fine when I add Non-inventory items. However, when I add Item groups through the API, it fails with the error "Please enter a value for amount".
What I tried so far:
-> Added the Item Group Header Item
-> Added all the line items under the Item group
-> Added the "end of group" line item (item id = '0')
->I have set quantity and rate for all the lines
Yet it fails with the above error. What is the right way to add an item group to a Sales Order Line in NetSuite?
Thanks in advance!
I am not sure, but see if you are using the "custom" price level.
Use custom price levels and set the amount too.

Show the next 5 products from a products collection

Instead of doing "You may like" I'm trying to cheat a little and display the next 5 products within the current products collection at the bottom of the product page.
Is this possible with Shopify?

Shopify selected variant id to update

I have an inquiry form built into my Shopify product page.
Where they can request a callback in regards to the product they're on and the variant id select.
I'm able to call back the current selected variant ID
product.selected_or_first_available_variant.id
But if I change the drop-down selection to another variant, this id will not update.
How do I may this update on the selection of a different variant?
Thank you
Correct - the {{ product.selected_or_first_available_variant.id }} is a Liquid variable, and Liquid is parsed server-side to generate the HTML document that is sent to the browser. Liquid can only ever be accurate as of the time of the initial page load
If you want to respond to user changes after the page has loaded, you'll need to use Javascript. If you are on a product page, there will be some javascript function firing that updates the price, image, etc. when the variant changes. If you can find that function (often, but not always, called selectCallback), you could add the code needed to update your contact form in there.
If you just need a variant ID, one other method to get it would be to write a small javascript function which, on submit of your contact form, takes the current value from the variant ID field in the product form and puts that value into the appropriate field in your contact form.
Hope this helps!