Announcement

Collapse
No announcement yet.

shipping module question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    shipping module question



    --============_-1114678139==_ma============
    Content-Type: text/plain; charset="us-ascii" ; format="flowed"

    I'm developing a custom shipping module for our store. The module
    has options that can be set on a per product basis. But when I hit
    the Update button on the product screen, my database is not getting
    updated. In trying to track this down I have run the following two
    code snippets -

    Number 1:
    <MvFUNCTION NAME = "Module_Product_Update" PARAMETERS = "product_id"
    STANDARDOUTPUTLEVEL = "">
    <MvASSIGN NAME = "l.ok" VALUE = "{ PBFS_Open_Store( 5 ) }">
    <MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE
    = "{ Error( 'MATZ-refnum', l.ok ) }">

    <MvIF EXPR = "{ l.ok }">


    Number 2:
    <MvFUNCTION NAME = "Module_Product_Update" PARAMETERS = "product_id"
    STANDARDOUTPUTLEVEL = "">
    <MvASSIGN NAME = "l.ok" VALUE = "{ PBFS_Open_Store( 5 ) }">
    <MvIF EXPR = "{ l.ok }">
    <MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok"
    VALUE = "{ Error( 'MATZ-refnum', l.ok ) }">


    Notice that the only difference is the location of the MvDO, before
    the MvIF for number 1 and inside the MvIF for number 2. When run
    under number one and I click the Update button, as expected, I get a
    Miva fatal error with the following info:

    Error Code: MATZ-refnum
    Description: 1

    which shows that l.ok is equal to 1. But if I run with the code as
    in number 2, there is no error when I click the Update button. This
    means it never gets inside the MvIF.

    But if l.ok is 1, why doesn't it go inside the MvIF? I'd be tearing
    out my hair on this one if I had any to spare.

    Any ideas on what's going on or how better to troubleshoot this would
    be greatly appreciated.

    Thanks,

    --
    --------------------------------------------------------------
    Mark T. Johnson
    MATZ Software & Consulting
    Phone: 858-571-3125
    FAX: 858-452-2871
    --============_-1114678139==_ma============--

    #2
    shipping module question



    Jeff,

    I was able to find the problem using the MvEVAL suggestion. I had tried using:



    I am inside the IF</p>

    but that generated no output that I could see. That's when I decided
    to try the error function. I'm still unclear as to why the error
    didn't happen inside the if and why the paragraph tags produced no
    output. But with the MvEVAL I was able to track it down to a
    misspelled global variable name.

    Thanks for your help.

    Mark



    At 12:18 AM -0700 10/11/04, <[email protected]> wrote:
    >Mark,
    >
    >First off I would advise not using the error functions for
    >debugging. Just do something like this:
    >
    ><MvEVAL EXPR="{'<h1>DEBUG: The state of l.ok is ' $ l.ok $
    >'</h1>' }">
    >
    >And:
    >
    ><MvEVAL EXPR="{'<h1>DEBUG: I am inside the IF</h1>' }">
    >
    >So then do that and see what you get.
    >
    >If you still are having problems send a bit more code. It is
    >completely possible that you have a missing quote or angle
    >bracket someplace that is causing the code not to get parsed
    >properly and you aren't noticing it because some other code with
    >a typo is closing it up, but we can't tell if that is the case
    >unless we can see more.
    >
    >- Jeff Huber
    >President 4TheBest eCommerce Solutions
    >http://4TheBest.com
    >[email protected]
    >Office: 760-742-1469
    >Cell: 760-445-8454
    >
    >
    >
    >- Jeff Huber
    >President 4TheBest eCommerce Solutions
    >http://4TheBest.com
    >[email protected]
    >Office: 760-742-1469
    >Cell: 760-445-8454
    >
    >
    >-----Original Message-----
    >From: [email protected]
    >[mailto:[email protected]] On Behalf Of Mark T.
    >Johnson
    >Sent: Sunday, October 10, 2004 2:14 PM
    >To: [email protected]
    >Subject: [mrc] shipping module question
    >
    >
    >I'm developing a custom shipping module for our store. The
    >module
    >has options that can be set on a per product basis. But when I
    >hit
    >the Update button on the product screen, my database is not
    >getting
    >updated. In trying to track this down I have run the following
    >two
    >code snippets -
    >
    >Number 1:
    ><MvFUNCTION NAME = "Module_Product_Update" PARAMETERS =
    >"product_id"
    >STANDARDOUTPUTLEVEL = "">
    > <MvASSIGN NAME = "l.ok" VALUE = "{ PBFS_Open_Store( 5 ) }">
    > <MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok"
    >VALUE
    >= "{ Error( 'MATZ-refnum', l.ok ) }">
    >
    > <MvIF EXPR = "{ l.ok }">
    >
    >
    >Number 2:
    ><MvFUNCTION NAME = "Module_Product_Update" PARAMETERS =
    >"product_id"
    >STANDARDOUTPUTLEVEL = "">
    > <MvASSIGN NAME = "l.ok" VALUE = "{ PBFS_Open_Store( 5 ) }">
    > <MvIF EXPR = "{ l.ok }">
    > <MvDO FILE = "{ g.Module_Library_Utilities }" NAME =
    >"l.ok"
    >VALUE = "{ Error( 'MATZ-refnum', l.ok ) }">
    >
    >
    >Notice that the only difference is the location of the MvDO,
    >before
    >the MvIF for number 1 and inside the MvIF for number 2. When run
    >
    >under number one and I click the Update button, as expected, I
    >get a
    >Miva fatal error with the following info:
    >
    >Error Code: MATZ-refnum
    >Description: 1
    >
    >which shows that l.ok is equal to 1. But if I run with the code
    >as
    >in number 2, there is no error when I click the Update button.
    >This
    >means it never gets inside the MvIF.
    >
    >But if l.ok is 1, why doesn't it go inside the MvIF? I'd be
    >tearing
    >out my hair on this one if I had any to spare.
    >
    >Any ideas on what's going on or how better to troubleshoot this
    >would
    >be greatly appreciated.
    >
    >Thanks,
    >
    >--
    >--------------------------------------------------------------
    >Mark T. Johnson
    >MATZ Software & Consulting
    >Phone: 858-571-3125
    >FAX: 858-452-2871


    --
    --------------------------------------------------------------
    Mark T. Johnson
    MATZ Software & Consulting
    Phone: 858-571-3125
    FAX: 858-452-2871

    Comment

    Working...
    X