Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Palle Hansen 143 posts 396 karma points
    Feb 19, 2014 @ 17:07
    Palle Hansen
    0

    Get stock from variants

    Hi.
    This maybe an iseay one :) But how to get stock from variants using: 

    <xsl:variable name="stock" select="TC:GetStock( 1, '1076' )"/>

     

    /Palle

  • Anders Burla Johansen 2560 posts 8256 karma points
    Feb 21, 2014 @ 08:18
    Anders Burla Johansen
    0

    Hi Palle

    Just pass in the node id of the variant. And be sure to have the stock data type for the variant doc type.

    Kind regards
    Anders

  • Palle Hansen 143 posts 396 karma points
    Feb 26, 2014 @ 08:08
    Palle Hansen
    0

    Well I have this:
            <xsl:variable name="PageID" select="umbraco.library:Request('PageId')"/>
            <xsl:variable name="Page" select="umbraco.library:GetXmlNodeById($PageID)"/>
    And when I pass either PageID or Page this error shows:

    Error occured

    System.ArgumentException: The model doesn't have a store id associated with it - remember to add the Tea Commerce store picker to your Umbraco content tree 
    at TeaCommerce.Umbraco.Configuration.InformationExtractors.XmlNodeProductInformationExtractor.GetStoreId(XPathNavigator model, Boolean useCachedInformation) 
    at TeaCommerce.Umbraco.Configuration.InformationExtractors.XmlNodeProductInformationExtractor.GetSku(XPathNavigator model, Boolean useCachedInformation) 
    at TeaCommerce.Umbraco.Web.XsltExtensions.GetStock(Int64 storeId, String productIdentifier)

    I'm no t on the actual varaint page. I use the above in a Ajax call.

     

    The PageID is a variant i the shop


     

     

  • Anders Burla Johansen 2560 posts 8256 karma points
    Feb 26, 2014 @ 08:37
    Anders Burla Johansen
    0

    Looks like the node that you ask for doesnt have a parent with a store picker at it. It need that in the Umbraco node structure.

    Kind regards
    Anders

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies