Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Here is the Variant dropdown (XSLT):
<xsl:variable name="product" select="CommerceLibrary:GetProduct($catalogName, $productSku)/product"/><select class="sel required" name="variantSku"> <xsl:for-each select="$product/variants/product"> <option value="{./@variantSku}">...</option> </xsl:for-each></select>
HTML output:
<select class="sel required" name="variantSku"> <option value="vvariant2">...</option></select>
Add to cart:
<xsl:variable name="catalogName" select="umbraco.library:RequestQueryString('catalog')"/> <xsl:variable name="productSku" select="umbraco.library:RequestQueryString('product')"/> <xsl:variable name="postedSku" select="umbraco.library:RequestForm('sku')"/> <xsl:variable name="postedVariant" select="umbraco.library:RequestForm('variantSku')"/> <xsl:variable name="postedQuantity" select="umbraco.library:RequestForm('quantityInput')"></xsl:variable> <xsl:if test="string-length($postedSku) > 0"> <xsl:variable name="addToBasketResult" select="CommerceLibrary:AddToBasket($catalogName, $postedQuantity, $postedSku, $postedVariant)"/>
This is what I get:
The variant with SKU '201194-vvariant2' does not exist.
What am i doing wrong? This problem only happens, if it's a product I have created using the API.
Further investigation shows that it works if my product SKU and variant SKU is numeric. Why do we have this limitation?
Hi Martin,
It might be a casing issue, i.e. sku "ABC" is different from "abc".
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
AddToBasket problem
Here is the Variant dropdown (XSLT):
<xsl:variable name="product" select="CommerceLibrary:GetProduct($catalogName, $productSku)/product"/>
<select class="sel required" name="variantSku">
<xsl:for-each select="$product/variants/product">
<option value="{./@variantSku}">...</option>
</xsl:for-each>
</select>
HTML output:
<select class="sel required" name="variantSku">
<option value="vvariant2">...</option>
</select>
Add to cart:
<xsl:variable name="catalogName" select="umbraco.library:RequestQueryString('catalog')"/>
<xsl:variable name="productSku" select="umbraco.library:RequestQueryString('product')"/>
<xsl:variable name="postedSku" select="umbraco.library:RequestForm('sku')"/>
<xsl:variable name="postedVariant" select="umbraco.library:RequestForm('variantSku')"/>
<xsl:variable name="postedQuantity" select="umbraco.library:RequestForm('quantityInput')"></xsl:variable>
<xsl:if test="string-length($postedSku) > 0">
<xsl:variable name="addToBasketResult" select="CommerceLibrary:AddToBasket($catalogName, $postedQuantity, $postedSku, $postedVariant)"/>
This is what I get:
The variant with SKU '201194-vvariant2' does not exist.
What am i doing wrong? This problem only happens, if it's a product I have created using the API.
Further investigation shows that it works if my product SKU and variant SKU is numeric. Why do we have this limitation?
Hi Martin,
It might be a casing issue, i.e. sku "ABC" is different from "abc".
is working on a reply...