Method for letting customers add additional personal information (ex: default size) in Shopify? - shopify

I'm a first-time Shopify developer looking for a way to let customers enter additional data about themselves in Shopify. Specifically, I'd like to add a page or modify the account info page so the customer can enter measurements. I'd then like to take that measurement information, process it, and return a recommended size for products in the shop.
Is this possible in Shopify? I am trying to figure out how to add metafields for customers to record their measurements, but I'm a bit lost.

This should work, but would require a fair bit of customization on the merchant's part and is a bit of a hack:
When a customer is logged in their info is available through Liquid.
This allows you to reference that customer's data when rendering shop pages, e.g. a Product page.
You can assign Metafields to customers using the API. These are also available through Liquid.
Putting this all together, you can have a form on the shopfront asking the customer for info once they're logged in. The form submits to your server where you add the info to the Customer object as Metafields using the API. Then you have some clever Liquid on the Product page that either does the necessary calculations itself or embeds the relevant info into javascript to be processed client-side.

Related

How can I get tax details from my personal webserver and display on the checkout page in shopify?

I want to create a shopify app that can fetch tax and HS code details from my website and display that to checkout page of the user as soon as user adds a product to cart. How can I build this?
You can use an App Proxy at the cart level to show off information. The proxy serves as a secure way of contacting your server and returning results. In checkout itself, you can offer up information too, with checkout scripts post-purchase.
Note that without integrating a tax service into Shopify itself and using that, none of the tax data or numbers you show off will have any use in the actual order calculations, meaning all your work is simple convenience of showing off an estimation to customers. The tax numbers the customers may actually see will be done by Shopify and/or the integrated tax solution your merchant account uses.

Shopify changing product price for variation by app

I am a shopify partner, I am trying to get around the the variant limits of shopify by coding an app and also because my client has a complicated formula for calculating the price. I don't have a problem with the part that adds the information for my variants to the order, however when I want to modify the price based on the user selection, it doesn't seem an easy task to do.
I came across couple of apps which does the same thing by adding a new product or variation which is not optimal for my use case, is there any app that does the job without adding extra information to the database, if so, how?
Qualified Yes
Unfortunately, Shopify doesn't give us a lot of options to edit prices of items dynamically. Here are the two options that I know of that will allow you to adjust the price of a product directly - however, both have limitations.
Using Shopify Script Editor
If you're working with a Shopify Plus merchant, you can use the Shopify Script Editor to dynamically adjust the prices of products, provided that the direction you adjust is down. You cannot increase the price of a product using the script editor - so for your use case, the list price would have to be the most expensive possible price that the item sells for, which you would then discount appropriately using the app.
Using draft orders
Using an app, you can use Shopify's Draft Order API to create an order with custom discounts and/or create completely custom items that are independent of the products set up in the product database.
The basic flow for this is that when the customer clicks 'checkout' you halt the normal navigation, send the cart contents to your app, create a draft order with the appropriate pricing, then supply the front-end code with the draft-order checkout/invoice URL so that you can send the customer there instead of the normal checkout. This has several limitations, however, including that prices of existing products can only be discounted, not increased, and the fact that Shopify will not allow a customer to use discount codes on a draft order invoice - once an order is set up this way, Shopify's assumption is that all prices are final.
Disclaimer: Sorry if someone sensible doesn't like a response with a link :) I'm not related to this app I'm just a user.
On a project with complex pricing, we use the app Wholesale Pricing Discount by Wholesale Helper we liked because is easy to import multiple pricing by-product and relate it by customer.
this app does not multiply the products, they use customer tags. maybe that can give you some guidance.
An important rule on Shopify is you can't increase the price by API on an order, you can just reduce i

Passing data to shopify product/cart from a custom page

I have made this page https://tns.webwars.eu. This is a form that creates a skymap in away by filling the fields and then posts the data to https://the-night-sky.com/cart. I am using the cart.attributes feature at the moment but this applies for the whole cart and I want individual data for each item. Eg. If someone tries to add another map with different information.
Is there another way to pass the field values to the cart and therefore to checkout and confirmation email?
Thank you in advance
You should use Line Item Properties as described in good detail here: https://help.shopify.com/en/themes/customization/products/features/get-customization-information-for-products
That technique is per product, works perfect with the cart, checkout and admin, and is much easier to maintain than cart attributes.
You can use Shopify's Ajax API for that purpose:
https://help.shopify.com/en/themes/development/getting-started/using-ajax-api
Shopify provides shop-owners with an Ajax API that returns JSON-encoded responses.
This Ajax API makes it possible to add items to the cart, update quantities in the cart, and fetch information about the cart, without a page refresh. With this API, you can also fetch information about a particular product using its handle.
For example, on site: https://weedrepublic.com

How to get value from customer's notes field?

I am working on shopify and my requirement is to add some extra information of user and I did that following this link :-
http://docs.shopify.com/manual/configuration/store-customization/communicating-with-customers/accounts-and-newsletters/capture-additional-information-in-the-account-registration-form
But now I want to know how to get values from customer[note][label] field in my liquid code.
Like I am able to get customer's name using {{customer.name}} which is store in customer[name] field but unable to get values from customer[note][label] field.
customer.note is not exposed via the the customer Liquid object. It is currently only available via the Shopify API. This is because customer notes are not meant for displaying in your store, they are for shop owners to manage customers in the admin area. An alternative is to use metafields instead.
Relevant discussions on the Shopify forums:
Accessing Customer Note in Account.liquid template
how to access to the customer.note with Liquid

Switch the shipping rate dynamically in Shopify

I'm planning a new Shopify project, and the site requires a different shipping cost depending on the postal area of a postcode (e.g. SE1, N7). The plan was to manually add different shipping options inside of Shopify, then AJAX GET /cart/shipping_rates.json, and manually filter to the correct shipping rate by matching the name to postal area.
But my question is -- is there any way to carry over this shipping method to the Checkout as a selected option, and hide the Shipping Method drop-down from the checkout to prevent them choosing a different the shipping cost?
... Or, ideally, is there a way for me to directly override shipping costs through the API?
I don't know of any onboard functionality, which can facilitate this.
But there is a quite hacky workaround, that I use to filter the shipping rates in the checkout page.
Through the "Additional Google Analytics Javascript" field you can sneak a JS on every page of the shop, including the checkout. Here you can basically manipulate the shipping rates as you like.
In your case, the code must be aware of the shipping_address zip code. You can try to set a cookie on the first checkout page and then read the same cookie on the second.
Unfortunately, this isn’t possible with Shopify’s existing checkout.