Howdy Howdy Howdy ,
So we recently have seen an increase in our B2B side and are getting requests to add the ability to add products to basket via CSV. I have done some digging thru the Merchant-Source and found "ADPM" will add an array of products. Now it seems that i am stuck when it comes to reading in the csv. Has anyone had any luck with reading in a csv and mapping out the data? If so would you mind sharing how you accomplished it?
Below is the current chunk of code i am working with. I am using the Tool Belt to fetch product data from a code currently. Im thinking the main loop would also take advantage of the g.found and skip an add attempt if the code is not found.
So we recently have seen an increase in our B2B side and are getting requests to add the ability to add products to basket via CSV. I have done some digging thru the Merchant-Source and found "ADPM" will add an array of products. Now it seems that i am stuck when it comes to reading in the csv. Has anyone had any luck with reading in a csv and mapping out the data? If so would you mind sharing how you accomplished it?
Below is the current chunk of code i am working with. I am using the Tool Belt to fetch product data from a code currently. Im thinking the main loop would also take advantage of the g.found and skip an add attempt if the code is not found.
Code:
<form method="post" action="&mvte:global:sessionurl;Screen=BASK"> <input type="hidden" name="Action" value="ADPM"> <input type="hidden" name="Attributes" value="Yes"> <input type="hidden" name="Store_Code" value="&mvte:store:code;"> <input type="file" accept=".csv" /> <mvt:item name="ry_toolbelt" param="Product_Load|g.found|'84-1011-22'|myproduct" /> <mvt:assign name="l.settings:category_listing:products[1]" value="l.settings:myproduct" /> <mvt:item name="ry_toolbelt" param="Product_Load|g.found|'80-14110-20'|myproduct" /> <mvt:assign name="l.settings:category_listing:products[2]" value="l.settings:myproduct" /> <mvt:item name="ry_toolbelt" param="Product_Load|g.found|'25-banditng'|myproduct" /> <mvt:assign name="l.settings:category_listing:products[3]" value="l.settings:myproduct" /> <mvt:foreach iterator="product" array="category_listing:products"> <input type="hidden" name="Products[ &mvt:product:id; ]:code" value="&mvte:product:code;"> <input type="hidden" name="Products[ &mvt:product:id; ]:quantity" value="1"> <mvt:item name="product_attributes" param="product:id" /> </mvt:foreach> <input type="submit" value="Add to Basket"> </form>
Comment