Skip to content

Commit 34e84d3

Browse files
added note about timeout to addProducts/createProduct
* DocWorks for wixcode-stores - 1 change detected, but 1 issue detected changes: Service wix-stores.Cart operation addProducts has changed description issues: Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating * DocWorks for wixcode-stores - 1 change detected, but 1 issue detected changes: Service wix-stores.Cart operation addProducts has changed description issues: Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating * DocWorks for wixcode-stores - 1 change detected, but 1 issue detected changes: Service wix-stores.Cart operation addProducts has changed description issues: Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating * DocWorks for wixcode-stores - 1 change detected, but 1 issue detected changes: Service wix-stores.Cart operation addProducts has changed description issues: Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating * DocWorks for wixcode-stores - 1 change detected, but 1 issue detected changes: Service wix-stores.Cart operation addProducts has changed description issues: Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating * DocWorks for wixcode-stores - 1 change detected, but 1 issue detected changes: Service wix-stores.Cart operation addProducts has changed description issues: Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating * DocWorks for wixcode-stores - no significant changes detected, but 1 issue detected issues: Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating * DocWorks for wixcode-stores - 1 change detected, but 1 issue detected changes: Service wix-stores.Cart operation addProducts has changed description issues: Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating * DocWorks for wix-stores-backend - 1 change detected, but 6 issue detected changes: Service wix-stores-backend operation createProduct has changed description issues: Message SeoTag has an unknown property type object (products.js (94)) Message SeoTag has an unknown property type object (products.js (94)) Message ItemMetadataError has an unknown property type object (products.js (637)) Message SeoTag has an unknown property type object (products.js (94)) Message SeoTag has an unknown property type object (products.js (94)) Message ItemMetadataError has an unknown property type object (products.js (637)) Co-authored-by: roysha-wix <[email protected]>
1 parent 3879612 commit 34e84d3

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

wix-stores-backend/wix-stores-backend.service.json

+7-8
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,8 @@
14871487
"extra":
14881488
{ } },
14891489
{ "name": "createProduct",
1490-
"labels": [],
1490+
"labels":
1491+
[ "changed" ],
14911492
"nameParams": [],
14921493
"params":
14931494
[ { "name": "productInfo",
@@ -1511,9 +1512,9 @@
15111512
" Creating a product is the first step in the process of enabling visitors to buy your products. After you create a product, you can",
15121513
" add choices and variants to the product.",
15131514
"",
1514-
"> **Note:** Do not pass important information from client-side code.",
1515-
"Doing so opens a vulnerability that a malicious user can exploit to change information, such as a buyer’s personal details (address, email, etc.) or product price information.",
1516-
"To learn more about how to keep your code secure, see [Security Considerations When Working with Wix Code](https://support.wix.com/en/article/velo-security-best-practices#code-visibility)." ],
1515+
"> **Notes:**",
1516+
"+ If you create a product immediately before adding it to the cart, we suggest [setting a timeout](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) for `\"1000\"` milliseconds (1 second) before calling [`wix-stores.cart.addProducts()`](https://www.wix.com/velo/reference/wix-stores/cart/addproducts). While this slows down the operation slightly, it also ensures proper retrieval of the newly created product before adding it to the cart.",
1517+
"+ Do not pass important information from client-side code. Doing so opens a vulnerability that a malicious user can exploit to change information, such as a buyer’s personal details (address, email, etc.) or product price information. To learn more about how to keep your code secure, see [Security Considerations When Working with Wix Code](https://support.wix.com/en/article/velo-security-best-practices#code-visibility)." ],
15171518
"links":
15181519
[ "[getProduct()]($w.ProductPage.html#getProduct)" ],
15191520
"examples":
@@ -10833,8 +10834,7 @@
1083310834
"members":
1083410835
[ "productId",
1083510836
"inventoryId" ] } ] },
10836-
"labels":
10837-
[ "changed" ] },
10837+
"labels": [] },
1083810838
{ "name": "Discount",
1083910839
"locations":
1084010840
[ { "lineno": 547,
@@ -12079,8 +12079,7 @@
1207912079
"members":
1208012080
[ "productId",
1208112081
"inventoryId" ] } ] },
12082-
"labels":
12083-
[ "changed" ] },
12082+
"labels": [] },
1208412083
{ "name": "InventoryItem",
1208512084
"locations":
1208612085
[ { "lineno": 1,

wixcode-stores/wix-stores.service.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -2038,8 +2038,7 @@
20382038
"labels":
20392039
[ "removed" ] } ],
20402040
"extra":
2041-
{ "scopes":
2042-
[ "frontend" ] },
2041+
{ },
20432042
"menuSections": "APIs",
20442043
"relatedContent":
20452044
[ { "icon": "video",

wixcode-stores/wix-stores/Cart.service.json

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{ "name": "Cart",
22
"memberOf": "wix-stores",
33
"mixes": [],
4-
"labels": [],
4+
"labels":
5+
[ "changed" ],
56
"location":
67
{ "lineno": 18,
78
"filename": "stores-index.js" },
@@ -20,7 +21,8 @@
2021
"properties": [],
2122
"operations":
2223
[ { "name": "addProducts",
23-
"labels": [],
24+
"labels":
25+
[ "changed" ],
2426
"nameParams": [],
2527
"params":
2628
[ { "name": "products",
@@ -58,9 +60,9 @@
5860
" You can use [`product.getOptionsAvailability()`](https://www.wix.com/velo/reference/wix-stores/product/getoptionsavailability)",
5961
" to determine if an item with specific options is available for purchase.",
6062
"",
61-
"> **Note:** This function replaces the deprecated [`$w.cartIcon.addToCart()`]($w/carticon/addtocart) and [`$w.cartIcon.addProductsToCart()`]($w/carticon/addproductstocart).",
62-
"The deprecated functions will continue to work, but they will not receive updates.",
63-
"To keep any existing code compatible with future changes, see each function's [migration instructions]($w/carticon/addtocart#migration-instructions)." ],
63+
"> **Notes:**",
64+
"+ If you use [`wix-stores-backend.createProduct()`](https://www.wix.com/velo/reference/wix-stores-backend/createproduct) immediately before adding that product to the cart, we suggest [setting a timeout](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout) for `\"1000\"` milliseconds (1 second) before calling `cart.addProducts()`. While this slows down the operation slightly, it also ensures proper retrieval of the newly created product before adding it to the cart.",
65+
"+ This function replaces the deprecated [`$w.cartIcon.addToCart()`]($w/carticon/addtocart) and [`$w.cartIcon.addProductsToCart()`]($w/carticon/addproductstocart). The deprecated functions will continue to work, but they will not receive updates. To keep any existing code compatible with future changes, see each function's [migration instructions]($w/carticon/addtocart#migration-instructions)." ],
6466
"links": [],
6567
"examples":
6668
[ { "title": "Add products to the cart",

0 commit comments

Comments
 (0)