Passing data to shopify product/cart from a custom page - shopify

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

Related

Limit product to only one per customer

I'm trying to code a solution for a client, that doesn't wish to use apps. We need to be able to limit one of our products, so there only can be one of it in cart at a time.
Is there an easy way to achieve this without an app?
I'm fairly known in JS, HTML and basic liquid solutions. Is it possible to create a pure liquid solution or do we need javascript aswell? The store use ajax cart, which we need to keep.
Thank you,
Magnus
Any time you have a call to add to cart, ensure the quantity is 1
Any time you have a call to add to cart, first ensure that item is not in the cart
When you render the cart, take all the inputs for updating the cart away. Allow only delete.
With that, you can hope that for the most part, customers will only ever have one of something in the cart.
You can then focus on removing any ability to change the quantity when adding to cart, and ensuring that when checkout is selected, items do in fact only have a quantity of 1.
No Apps needed.

Does ebay API allows to create a listing draft?

I would like to create a listing ebay draft as it is possible to do manually using this flow:
Go to the new listing sell creation page
Choose category id
Put some random data (title, description, etc.)
Close tab
You will see now unfinished draft, when you go to the new listing sell creation page.
Can I do the same thing using eBay api?
The reason of it is that I don't want to implement all functionality of addItem, currently.
eBay API will not allow to create draft listing.
when you call API for creating new listing, API needs all required fields value.
eBay Listing API provide one attribute PrivateListing.it will hide your product for selling.
If PrivateListing is true, designates the listing as private.customer can't see private listing.
eBay Listing API provide one more attribute ScheduleTime.
When you export product in eBay via API you can give ScheduleTime as well, eBay will active product for selling based on ScheduleTime.
You can make product inactive/draft using this alternative way.
http://developer.ebay.com/devzone/xml/docs/Reference/eBay/AddItem.html#AddItem
You can refer above link for eBay API.
As of now, I can confirm eBay does provide the API to create listing draft, though it's in beta at the moment.
POST - /item_draft/
Official doc is here
To my knowledge this cannot be done, since there are some pretty strict constraints around using the addItem API call, and eBay will throw an error if you don't complete the all the required fields. The required fields of addItem are numerous enough that if you could populate these fields, then you are already 90% of the way to completing your listing anyways.
If you are using Selling Manager Pro, you can create product templates which may be a way to accomplish what you are looking for.

Need a link in Shopify that adds items to cart and redirects to checkout

I am attempting to add a "quick purchase" option for my products in Shopify. I'd like to have one link that adds qty:1 for a specific product ID and then redirects the user to check out.
Is it possible to create a query string that will accomplish this?
Shopify has an inbuilt AJAX functionality for the purpose. Refer to the link: Shopify's Ajax API

How to get list carts with magento API?

I working on Magento with carts. I using SOAP to create cart and add products to it. but can i get list of carts. And how to active it.
In dashboard of magento admin, i see
Reports > Shopping Cart > Abandoned Carts
with list of carts is active. Can i get it?
Thank a lot, sorry for my bad english.
If you want to see how the query behind the report is generated, have a look at https://github.com/magento/magento2/blob/83132783e0a6bed32c45e6d06df851865e668abc/app/code/Magento/Reports/Model/Resource/Quote/Collection.php#L54 - this is the code that forms the query. You can see the table fields it uses (e.g. checking if is_active, must be at least one item in cart, etc), then sorts by updated_at so oldest cart comes up first.
There is also a blog post at http://cyrillschumacher.com/2015/01/02/magento2---search-parameters-for-the-rest-api/ which describes (for the REST API) how to build a search. It is backed by the same data constructs as for SOAP.
You can use the end point http:///soap/default?wsdl&services=quoteCartRepositoryV1 to bring up the WSDL file.
Sorry, I don't have time right now to build up the SOAP request myself, but hopefully these pointers are useful to help you make some progress.

Method for letting customers add additional personal information (ex: default size) in 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.