Copied to clipboard

Flag this post as spam?

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


  • Ansar 181 posts 291 karma points
    May 06, 2012 @ 08:55
    Ansar
    0

    Use product data from custom tables instead of Umbraco nodes

    Is it possible to use product data from custom database tables instead of Umbraco nodes in Teacommerce APIs?

    We have a quite big external product database which changes quite frequently and synching it to Umbraco nodes is not easy..http://our.umbraco.org/forum/developers/extending-umbraco/31471-InsertUpdate-nodes-directly-in-Database

    Any pointers on this topic will be a great help..

    Thanks,
    Anz

  • Rune Grønkjær 1371 posts 3102 karma points
    May 07, 2012 @ 08:19
    Rune Grønkjær
    0

    Hi Anz,

    Tea Commerce can do that. Not out of the box, but with a small custom extension it will do the trick. A few pointers:

    1. You will need at least ONE product node in Umbraco. Tea Commerce needs that to be able to ad products to the order. This product have a price of 0,-
    2. You will need to use the addUniqueOrderLine method to add the products. That way your one product can be added multiple times.
    3. List and show your products in your umbraco solution any way you like/can. When a product is added to the cart you use the product from 1. AND you send your own product ID as a orderline property. This way you will know on the server which product have been added.
    4. Now you use the Tea Commerce .NET API to hook into the orderLineAdded event where you will add the critical product information like the price. You might also want to add some other orderLineProperties from your custom products database. You might also need to check for stock and that the product have been added to the cart before.
    5. Now your product is on the Tea Commerce order and Tea Commerce will handle the rest.

    I hope it makes sence.

    /Rune

  • Spyros Spyriadis 46 posts 70 karma points
    Oct 15, 2012 @ 15:23
    Spyros Spyriadis
    0

    I have used the above method to create an e-shop but I have a strange problem. If I leave the cart session open for a couple of minutes some of the products (other every time) lose the price. It's like the cart is being reloaded from the database but the price is loaded from the product used as dummy when calling the addUniqueOrderLine method. 

    I have used both WebshopEvents_OrderLineAdded and WebshopEvents_OrderLineChanged to make sure that the details are loaded but still get the same problem.

    Any ideas? Is the price being refreshed when a product sits in the cart for a long time? And if that is the case can I prevent that?

  • Rune Grønkjær 1371 posts 3102 karma points
    Oct 15, 2012 @ 15:32
    Rune Grønkjær
    0

    Hi Spyros,

    Did you remember to save the order? If not it will not be persisted to the database and your changes will die with the cache, which, if i'm correct, runs out after 10 minutes. All changes should be followed by an:

    order.Save()

    /Rune

  • Spyros Spyriadis 46 posts 70 karma points
    Oct 15, 2012 @ 15:46
    Spyros Spyriadis
    0

    No I didn't know you have to save the order after changing the properties! Sounds like this is exactly the problem I have...

    Thanks a lot...

Please Sign in or register to post replies

Write your reply to:

Draft