Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 4 of 4

Thread: Individual Item Shipping Cost - update in variants

  1. #1
    gigi is offline Junior Member
    Join Date
    Sep 2008
    Posts
    4

    Question Individual Item Shipping Cost - update in variants

    I am trying to import shipping costs in variants, while using Individual Item Shipping Cost.

    I uploaded the following via WSI interface:

    <?xml version="1.0" encoding="utf-8"?>
    <AspDotNetStorefrontImport Version="7.1"
    SetImportFlag="true"
    Verbose="true">
    <Transaction Name="TEST Shipping">
    <Product Action="Update" ID="1145">
    <Variants>
    <Variant Action="Update" ID="2607">
    <ShippingCosts>
    <ShippingMethod ID="47" Cost="50.00"/>
    <ShippingMethod ID="48" Cost="100.00"/>
    <ShippingMethod ID="4" Cost="75.00"/>
    </ShippingCosts>
    </Variant>
    </Variants>
    </Product>
    </Transaction>
    <ResetCache Confirm="true"/>
    </AspDotNetStorefrontImport>

    Although it shows as if it worked, my database does not seem to be updated in the admin panel:

    <?xml version="1.0" encoding="utf-8"?>
    <AspDotNetStorefrontImportResult Version="7.1" DateTime="4/15/2013 10:49:15 AM">
    <Verbose Message="Import Starting" />
    <Transaction Name="TEST Shipping">
    <Verbose Message="Processing Product, Name=, Action=Update, ID=1145, GUID=" />
    <Verbose Message="Product OK" />
    <Item NodeType="Product" Name="" GUID="" ID="1145" ActionTaken="Update" Status="OK" Message="" />
    <Verbose Message="Processing Variant, Name=, Action=Update, ID=2607, GUID=" />
    <Verbose Message="Variant OK" />
    <Item NodeType="Variant" Name="" GUID="" ID="2607" ActionTaken="Update" Status="OK" Message="" />
    <Verbose Message="Executing SQL: update ProductVariant set IsDefault=0 where Deleted&amp;lt;&amp;gt;0 or Published=0 and ProductID=1145" />
    <Commit />
    </Transaction>
    <Verbose Message="Processing ResetCache, Confirm=True" />
    <Verbose Message="Executing SQL: exec aspdnsf_CreateMissingVariants" />
    <ResetCache />
    <Verbose Message="Import Completed" />
    </AspDotNetStorefrontImportResult>

    Can anyone help? Is there any other method I could use to update these fields using WSI?

    Thank you!

  2. #2
    gigi is offline Junior Member
    Join Date
    Sep 2008
    Posts
    4

    Question Did it manually...

    I finally made it, manually, one by one... And I am happy, the calculation works perfectly.

    But I have a new issue: the google base. I am trying to generate the xml file that would include individual item cost, as required by Google Base.

    As this is not a documented shipping method, I don't know how to do the SQL query to extract the information.

    WSI data def inition presents it like this (within the variant node):

    <ShippingCosts AutoCleanup="boolean" PullFromVariantID="integer" PullFromVariantGUID="uniqueidentifier">
    <ShippingMethod ID="integer" GUID="uniqueidentifier" Cost="decimal"/>
    <ShippingMethod ID="integer" GUID="uniqueidentifier" Cost="decimal"/>
    <ShippingMethod ID="integer" GUID="uniqueidentifier" Cost="decimal"/>
    <ShippingMethod ID="integer" GUID="uniqueidentifier" Cost="decimal"/>
    </ShippingCosts>

    Anyone can help? My ShippingMethod Ids are 47 and 48...
    Who can help in letting me know how to get the values stored in the variant fields?

  3. #3
    GoVedia is offline Member
    Join Date
    Oct 2012
    Location
    Orange, CA
    Posts
    98

    Default More Info

    @gigi,

    What approach are you taking to generate the XML file? For example, is this being done from an XML Package?

    The Shipping class (AspDotNetStorefrontCore.Shipping) contains a method that may be of assistance; perhaps by way of example.
    Code:
    static public decimal GetVariantShippingCost(int VariantID, int ShippingMethodID)
    It uses the following SQL:
    Code:
    SELECT ShippingCost 
    FROM ShippingByProduct WITH(NOLOCK)
    WHERE VariantID = {VariantID}
    AND ShippingMethodID = {ShippingMethodID}
    Let me know if that helps!

    Sincerely,
    Robert
    Robert Kanaan
    AspDotNetStorefront Development Partner
    robert@GoVedia.com
    408-758-8845

    GoVedia
    http://GoVedia.com
    Approved AspDotNetStorefront Development Partner
    AspDotNetStorefront Recommended Reseller

  4. #4
    gigi is offline Junior Member
    Join Date
    Sep 2008
    Posts
    4

    Red face Thank you Robert!

    I am using an xml file, yes.
    I mostly had trouble with the SQL query, which always gave me errors. I will try with the info you kindly provided and let you know!
    I really appreciate your input, thank you so much!!!