Announcement

Collapse
No announcement yet.

Run Fulfillment from Admin Only

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

    Run Fulfillment from Admin Only

    Is there any way to have a Fulfillment Module run ONLY if selected in the Manage Orders Fulfillment Modules function?
    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

    #2
    Re: Run Fulfillment from Admin Only

    My first thought, yes if there is a variable value generated to bounce off. Like, if g.admin_screen EQ "Manage Orders" then run-it. So, the module itself needs an If-Else condition.

    Otherwise, I think the checkbox list when clicking the Man Ord Fulfill tab is the only control.

    Side Note: I have found when running this tab, I don't have control over which Order Fulfillment Template Emails to run. IOW, unless I am not understanding something, if I check template emails, All the active email templates will run.

    Scott
    Need to offer Shipping Insurance?
    Interactive Design Solutions https://www.myids.net
    MivaMerchant Business Partner | Certified MivaMerchant Web Developer
    Competitive Rates, Custom Modules and Integrations, Store Integration
    AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
    My T-shirt Collection is mostly MivaCon T-shirts!!

    Comment


      #3
      Re: Run Fulfillment from Admin Only

      If one of my clients wanted this, I would write a small "phantom" fulfillment module that passes all function calls to the real module, but only when it's running in admin, not from the shopping pages. Then I'd deactivate the real module, so that it would never run on its own. That's off the top of my head, but I think it'll work.
      Last edited by Kent Multer; 08-02-12, 11:32 PM.
      Kent Multer
      Magic Metal Productions
      http://TheMagicM.com
      * Web developer/designer
      * E-commerce and Miva
      * Author, The Official Miva Web Scripting Book -- available on-line:
      http://www.amazon.com/exec/obidos/IS...icmetalproducA

      Comment


        #4
        Re: Run Fulfillment from Admin Only

        I do this in softgoods:

        Code:
        <MvASSIGN NAME="l.in_admin" VALUE="{ CheckFor_InAdmin() }">
        
            <MvIF EXPR="{l.in_admin}">
                <MvCOMMENT> ** ALWAYS RUN HERE ** </MvCOMMENT>
            <MvELSE>
                <MvCOMMENT> ** SOMETIMES RUN HERE ** </MvCOMMENT>
            </MvIF>
        
        ...
        
        <MvFUNCTION NAME="CheckFor_InAdmin" PARAMETERS="" STANDARDOUTPUTLEVEL="">
        <MvCOMMENT>
        ****
        file name in Wombat's Manage Orders is json.mvc, hence the check for that file
        ****
        </MvCOMMENT>
        
            <MvASSIGN NAME="l.string" VALUE="{tolower(s.documenturl)}">
            <MvASSIGN NAME="l.string" VALUE="{glosub(l.string,'http://','')}">
            <MvASSIGN NAME="l.string" VALUE="{glosub(l.string,'https://','')}">
            <MvASSIGN NAME="l.count" VALUE="1">
            <MvASSIGN NAME="l.this_portion" VALUE="{gettoken(l.string,'/',l.count)}">
            <MvWHILE EXPR="{l.this_portion}">
                <MvIF EXPR="{'.mvc' CIN l.this_portion}">
                    <MvIF EXPR="{(substring(l.this_portion,1,9) EQ 'admin.mvc') OR ((substring(l.this_portion,1,8) EQ 'json.mvc'))}">
                        <MvFUNCRETURN VALUE="1">
                    <MvELSE>
                        <MvFUNCRETURN VALUE="0">
                    </MvIF>
                </MvIF>
        
                <MvASSIGN NAME="l.count" VALUE="{l.count + 1}">
                <MvASSIGN NAME="l.this_portion" VALUE="{gettoken(l.string,'/',l.count)}">
            </MvWHILE>
            <MvFUNCRETURN VALUE="0">
        </MvFUNCTION>
        Probably could be better but seems to get the job done.

        James
        James Harrell
        current: Friend of Miva
        2007-2012 eMediaSales & Viking Coders
        2005-2007 Miva Merchant
        2001-2005 Copernicus

        Comment


          #5
          Re: Run Fulfillment from Admin Only

          Bruce, is this a fulfillment module that you're writing? Sorry, I assumed you were talking about controlling someone else's module, where you don't have access to the source code. If you can modify the source, I think you can just make it check for "admin.mvc" in the value of s.documenturl.
          Kent Multer
          Magic Metal Productions
          http://TheMagicM.com
          * Web developer/designer
          * E-commerce and Miva
          * Author, The Official Miva Web Scripting Book -- available on-line:
          http://www.amazon.com/exec/obidos/IS...icmetalproducA

          Comment

          Working...
          X