How to show <input type="file">field on selecting a product version on liquid shopify - 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

Related

Appsmith to change the default value of the Input Box

The Process
I am going to use Appsmith to edit the item price using rest API
The Item List Table
Code
{{menitems.data.content}}
Explanation
From the Image, I have been Displaying my Item with the Edit Button in a table that I got from Rest API
While Clicking I have been showing Item's details and the price to be changed
While Clicking the Edit Price Button
I have been Passing the Price from Table to the javascript object which I have been using storevalue to store the price which I will get the price and show in the popup
Code for Passing Table data to the Javascript Object
{{priceCalculation.openModal(currentRow.pricetype,currentRow.price)}}
Description
I have been passing the price from the table to the popup using the above code
Javascript Object code Open a Modal and storeValue
openModal:(price) => {storeValue("price",price);}
Description
Then in the Javascript object, I have been using storeValue to save in a local storage
The Modal Popup
Explanation
As you can see I have been getting the price from storeValue and adding in the input box's Default Value
In the Popup Price Input
{{appsmith.store.pricebefore}}
Description
From the above code I have been adding the price from the store value
Problem
When I change the text it rolls back the value from the storeValue
For Example
price in storeValue = 300
if I tried to change the price input to = 200
then the input price rolls back to = 300
Solution Tried
in the price Input onTextChanged
{{(function({storeValue("pricebefore",price_before_discount.text);priceCalculation.price_before_change(price_before_discount.text);})()}}
Description
In the above code I have to change the text in storeValue too but it's way too slow if I edit too fast like double clear and add text way fast then it's taking too much time to reflect by the time it reflects it's rolling back the value in storeValue
For Example:
The Text in Input = 12345
if I press double bacspace then it's too slow it only clears one
in the price input onSubmit
If I use this it's working fine on Desktop but on mobile I can't
submit the Input there is no Tick button on keyboard
Conclusion
I just need an alternative using the process of getting the price from the table and putting in the input and allowing the user to edit that input without interference

Choose one result in Splunk table Query

I would like to add radio button / any way to select - one of the results of my below REST query search,
QUERY : |rest /services/data/ui/views | table id label updated "eai:userName" "eai:data" "eai:appName"
Dashboard showing the results
This Query search is saved as a dashboard (auto-refresh) and I have added few text boxes (User Name, Commit Branch, User Token) as show in the attached image. These text boxes will be manually filled by user.
Use Case: I need to choose any one row via radio button (or any other technical way) and then click on the SUBMIT button to send the selected row data and text box (manually entered by user) data to my custom python script.
What is the way to achieve this use case in Splunk, Any help on this is appreciated.
If you want to pass results of a Dashboard elsewhere, you need to use a drilldown
See the Dashboard XML reference for more
Splunk will only send to a URL, however - so if you want it to go to a "custom python script", it will need to be accessible via URL
What does your "custom python script" do?

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!

Crystal Reports - Prompt for Total Page Count

I have a report that I'm using to create individual shipping labels for product delivery. Company Name, Address, additional fields are all straight forward and drag and drop into report, requiring little manipulation.
My issue comes about in trying to determine how I can prompt the user for the quantity of labels needed for print. This will change from shipment to shipment based on how many boxes are required to fulfill the order. Each box requires its own shipping label. I would simply have the user specify quantity at the "copies" section of the print screen but I also need a field on the label stating n of m so the customer knows total boxes shipped and has an identifier for each individual box. For this reason, I'm curious if and how I can prompt the user before print to provide "total page count", where I can then create the number of needed documents and increment per label using the "page number" field, creating a prompted n of m function.
"Total page count" and "page number" are special fields that I seem to have little access in manipulating so if you know how I can prompt a user for necessary label quantity "total page count" then increment per label with "page number",(to achieve an incrementing N of M function where M is defined by the user) in this manner or another let me know.
Thanks,
Travis

Syntax for SharePoint 2010 BCS URL Action to populate New form

Have seen several posts with solutions for native SharePoint lists, including the very useful SPUtility.js (only for native SharePoint lists). But nothing to pass a value from a BCS list to a new BCS list. The Query string filter will not connect on the New form (no web part to connect it to) and does me no good on the lists page (already have that working).
A "go write custom code for everything" is not a solution for me.
There should be a way to 1) pass the value in the URL (ideal - what's the syntax?) or 2) make some other simple change, perhaps to the select list for the item -- I just can't find it. Have seen quite a few posts with similar questions. The Microsoft documentation is not useful and there are more questions on the "social" topics than answers.
Here's what I have:
I have a BCS list (sends item) tied to a BCS related list (receives item).
I have an action on the related list (ECT) to create a new item. Works fine with no parameters. I get a blank new form. The new form allows me to enter two items and choose two items (exactly as intended).
What I would like to have is the necessary ?something=something string so that my user does not have to select one of the choice items (MNumber - set as a key / required value)
User selects "New" from Actions.
Form Opens
MNumber is automatically filled in based on the MNumber of the current item displayed in the BCS related list.
The string I supply is accepted. Does nothing.
/intake/Lists/ContactsList/NewForm.aspx
/intake/Lists/ContactsList/NewForm.aspx?MNumber=1234
The string I supply is rejected - cannot be saved or insufficient values.
/intake/Lists/ContactsList/NewForm.aspx?MHICNumber={$MHICNumber}
Have also tried passing a string to one of the text fields (instead of the select field). Can't get that to work either. I've spent quite a few hours with the various boards. Nothing helpful.
Would also be nicer if I could set the New form to display in a pop-over window (as it does when I select New from the list view). Opening a new browser window is hokey and replacing the existing one is a navigation pain for the user.
Have this working ... Thanks to Kit Menke!
Created an Action on the External Content Type in the BCS....
/intake/Lists/ContactsList/NewForm.aspx?IDnumber={0}&Source=/intake/scheduling.aspx
where
parameter property 0 is the IDNumber from the ECT
The NewForm.aspx was edited to add a hidden content editor web part with references to three scripts Kit wrote - two supporting and one that sets the values.
http://site/list/NewForm.aspx?toolpaneview=2
User selects the Action on the displayed ECT list
Action uses the URL to go to the New page with the data
Kit's script adds the data to the form and puts in the date and time.
Note: The ID field needs to be a text field. Cannot be a selection list.