In template based feed, how to tell when inventory tracking is off for a product?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kayakbabe
    Mega Mivite




    • Jun 2008
    • 1520

    #1

    In template based feed, how to tell when inventory tracking is off for a product?

    In template based feed iterator template, the array for the products is named record.
    I've only found one inventory related variable at the product level. That is &mvt:record:inventory; which displays the quantity of inventory available.
    I have a mix of products (records), some with inventory tracking turned on and some that we do not track inventory on.

    &mvt:record:inventory; contains 0 for the qty if inventory tracking for a product is turned on and qty=0
    and also
    &mvt:record:inventory; contains 0 for the qty if inventory tracking for a product is turned off.

    That is the crux of my problem. I can't tell in the output if a product is actually tracked and has zero inventory.. or if the product just isn't tracked.

    How do I find out if inventory tracking is off for that product(record)? What I am want is a super fast simple yes or no kind of response so I can do an if statement with logic like this

    Code:
    if inventory tracking is off, then output "NA" else output &mvt:record:inventory;
    I've looked at the api and the documentation is unbearably sparse. So I'm guessing one of these will be what I need to find the necessary information to use in my if statement. But not sure which one is the lightest and fastest and thus the best choice. (I am creating output of thousands of products in a report type table, so the least impact on processing is the best choice to prevent timing out).

    <mvt:do file="g.Module_Feature_INV_RT" name="l.success" value="Runtime_Product_InventoryFields_Read(produc t var)" />

    <mvt:do file="g.Module_Feature_INV_RT" name="l.success" value="Inventory_Tokenize_Message(product var, text)" />

    <mvt:do file="g.Module_Feature_INV_RT" name="l.success" value="Inventory_Check_Available(product var, quantity)" />

    <mvt:do file="g.Module_Feature_INV_DB" name="l.success" value="InventoryProductCount(product_id)" />

    <mvt:do file="g.Module_Feature_INV_DB" name="l.success" value="InventoryProductSettings_Read(inventoryprod uctsettings var)" />

    <mvt:do file="g.Module_Feature_INV_DB" name="l.success" value="InventoryProductCount_Read(inventoryproduct count var)" />

    <mvt:do file="g.Module_Library_DB" name="l.success" value="Product_Load_ID_WithRuntimeInventory(id, product var)" />

    Anyone know which is the best choice for my needs?
  • Bruce - PhosphorMedia
    Developer Partner











    • Mar 2006
    • 11256

    #2
    What if you used a custom field to denote whether inventory is tracked? That custom field would be in the records: One could even create a simple script (in a product_list template) to routinely update that field based on the actual product tracking information.
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment

    • kayakbabe
      Mega Mivite




      • Jun 2008
      • 1520

      #3
      Bruce that would be a duplicate of something that already exists.. Miva already has the data stored in the store database for product inventory tracking. keeping a separate customfield up to date and manually in sync with the real live working field that actually controls whether inventory tracking is happening... doesn't make any sense to me.

      It also seems kinda odd to me.. that since to find out what the inventory qty is... the store has to check to see if the product has inventory active or not in the first place. That way the template feed can report either the actual inventory qty or zero. I looked at the LSK and it appears that one of the functions actually looks for inv_active for the product and then sets the qty to zero if the product inventory is not active. ... why doesn't the inv_active flag get passed on to the template. It would be really useful in so many ways.

      Comment

      • Bruce - PhosphorMedia
        Developer Partner











        • Mar 2006
        • 11256

        #4
        I agree, to a point. One, it can be made relatively "automatic" but the main issue was conserving time. The custom field would already be in the array. As for which of the above function you listed, I doubt there'd be much of difference between them. Most of the internal functions are tightly indexed.
        Bruce Golub
        Phosphor Media - "Your Success is our Business"

        Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
        phosphormedia.com

        Comment

        Working...
        X