How to make Add to cart By id In VueJs? - vue.js

I've been facing a problem whilst I'm working with a eCommerce demo file with VueJs. I have add all the required code but when I click on Add To Cart option in a same file, the product shown like below-The Problem I'm facing

I assume you want the quantity to increase instead of adding a new item. Wherever the logic is that adds a new item, first loop through the cart and check if the matching item already exists. If it does, increment the quantity by one. If not, add a new item.
Can't help much more than that without details.

Related

OroCommerce: Configurable Product display in storefront and backoffice

I've created configurable product (internet connection with different speed) following docs, in storefront I see dropdown with product vairants, all is ok.
But in backoffice (when editing shoppingList or creating order) there is always only one variant of product with no ability to quickly select another option (eg change speed to another one) - is this how oro backoffice works and nothing could be changed to make backoffice user quickly navigate between product variants (eg change speed from 1M to 2M by clients phone request)?
Cant even edit product in shopping list
UPD:
If there's no way to see user-friendly configurable product in backoffice than I need to implement smth like button near each product in LineItem which will show popup with product variants. When user will select another option request will be sent to some route and it will run smth like $lineItem->setProduct($newProduct); , grid reloaded and new product variant selected. Is it ok or it will break something in oro?
Where to start for adding that button and popup? Eg I cant edit oro shopping list template, how to properly extend it?
On the line item editing form you cannot change the product, no matter it's configurable or simple. It's done intentionally.
If you want to change the product, you always can remove a line item and add the new one with updated options manually:

Shopify custom bundle: Products listed as line item properties and inventory update on order

I'm making a custom bundle "builder" with Shopify Theme Sections for my client and I managed to add products from the bundle as Line item properties (it's easier to remove it as only one item, then as 5+ items). Now I'm not sure how to finish the order process and update the inventory of the products listed as line item properties.
How to "connect" the Cart and Checkout pages and transfer the info about the products, so it can affect the inventory after the order is finished? Should I add a hidden fields on the Cart page (for those products listed as the properties), or should I do something else (e.g. add a Private app with some hook that'll update the inventory in the background or maybe add all products to the cart page and hide them with JS and add some logic for their removal)?
Here is the checkout screenshoot as an example - https://www.dropbox.com/s/j6cu985wcpfp4t9/shopify-cart-products-as-line-item-properties.png?dl=0
Thanks in advance!
You are on the right track. You cannot do hidden products or line item properties though. Instead, when you add a bundle to the cart, add all the products in the bundle. That is how you accomplish a checkout. Tie the items together using Line Item Properties, and you can handle delete/remove/update code in the cart with JS. Since the customer would be buying products, inventory is then automatic.
You cannot escape having the customer seeing an paying for a variant ID, with a quantity and a price. Trying to hide that in a bundle will never work, although you can be creative and disguise line items as being together with good code.

How to pass optional attribute to the Product via custom add to cart in Prestashop 1.6

I wonder if there's a way to pass some extra information (attribute) by using custom add to cart button.
We've got clear products with their prices. We also sell the same products with print.
Printed version is more expensive. The product is going out from special generator and there, "add to cart button" will be added to where -if that's possible- I would like to pass attribute to this product (so I could change base price to printed)
Is there any way to pass/add this attribute to the product before it will go to cart?
I think the best way to do that would be use combinations - you can make combination with different prices and then you will be able to send combination_id using your extra button.

Adding user input when adding product to cart

I'm trying to add a textbox to accept user input before they add that product to the cart. I need to add the content of that textbox as an option to that particular lineItem but so far I haven't been able to, i.e., adding that text as an entry in LineItemOption.
I already looked into 'virto-commerce.js' and found out (at least i suppose) that this new dynamic field needs to be passed inside the 'options' parameter but I haven't been successful yet.
Anyone else been through this problem that can help? Thank you.

add custom value to cart from a form, prestashop

I'm creating a simple Prestashop module that places a form in CMS pages. That form will return a custom value (and a new product) that I need to be redirected to the cart after clicking a "submit" button.
How can I send the data to the cart?
Thank you!
Rui
Every customer has a unique cart ID.
1 ) After submit put information to mysql table
2 ) hook module to cart step
3 ) Check if this customer and cart id equal and do what you need to do.
I think its easiest and simplest way to do it. Rather than override system files. Even more you talking about module.
There is a javascript class in prestashop to control the cart.
Simply call ajaxCart.add(params)
This function will add the product to the cart with ajax.