Add Products using Catalog API
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Commerce Server > Commerce Server General > Add Products using Catalog API




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Add Products using Catalog API  
Peter Trell


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-26-07 06:17 PM

Hi,
I am adding products to a Catalog using Catalog API.
I create a Product & a Inventory SKU.
BUT in site Inventory is not reflected, for all the products I get "Out of
Stock" message. Could this be because of "No Variant" getting created?

How do I remove the "Varient" being mandatory? because for our product we do
not have Varients.

The Code is
Product oProd = baseCatalog.CreateProduct("LPProdDef", sProductID,
dOriginal_Price, sCategory,....);
oProd["Manufacturer"] = sManufacturer; //custom property
oProd.Save();
// Get the product family from the catalog.
ProductFamily productFamily =
(ProductFamily)baseCatalog.GetProduct(sProductID);
// Add the variant to the product family.
productFamily.AddVariant(sProductID);

//now save the inventory...
InventorySku oSku =
oLPInventoryCatalog.CreateSku(sCatalogName, sProductID, dQuantity,
StockStatus.Enabled);
oSku.Backorderable = true;
oSku.StockOutThreshold = 1;
oSku.Save();


Regards
Peter







[ Post a follow-up to this message ]



    Re: Add Products using Catalog API  
Tomas Vera


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-30-07 06:26 AM

Peter,
After you crete the Product/SKU do you "set" the inventory value
before you query it on the website?

I ask because I can see where you "create" the product and set the
inventory threshold, but if you don't set an inventory value > 1, then
you will always get the "Out of Stock" message.

-tomas

(I hope I didn't overlook something: I'm getting back into CS, it's
been a while!)


On Tue, 26 Jun 2007 07:48:03 -0700, Peter Trell
<PeterTrell@discussions.microsoft.com> wrote:

>Hi,
>I am adding products to a Catalog using Catalog API.
>I create a Product & a Inventory SKU.
>BUT in site Inventory is not reflected, for all the products I get "Out of
>Stock" message. Could this be because of "No Variant" getting created?
>
>How do I remove the "Varient" being mandatory? because for our product we d
o
>not have Varients.
>
>The Code is
> Product oProd = baseCatalog.CreateProduct("LPProdDef", sProductID,
>dOriginal_Price, sCategory,....);
>oProd["Manufacturer"] = sManufacturer; //custom property
> oProd.Save();
> // Get the product family from the catalog.
>                ProductFamily productFamily =
>(ProductFamily)baseCatalog.GetProduct(sProductID);
>                // Add the variant to the product family.
>                productFamily.AddVariant(sProductID);
>
>                //now save the inventory...
>                InventorySku oSku =
>oLPInventoryCatalog.CreateSku(sCatalogName, sProductID, dQuantity,
>StockStatus.Enabled);
>                oSku.Backorderable = true;
>                oSku.StockOutThreshold = 1;
>                oSku.Save();
>
>
>Regards
>Peter
>
/*-------------------------------
* Tomas Vera
* tomas (at) sbcglobal (dot) net
*-------------------------------
*/





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:25 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register