[ic] Newbie questions

frank frank at goldissue.com
Tue Jan 6 21:56:27 EST 2004


Christopher J. Andre' wrote:

>Hello all,
>
>I am trying to learn how to turn states 'off and on' with regard to who can
>purchase from the interchange store.  We are creating a winery website
>(using the foundation store), and since interstate shipping laws are so
>screwed up...we need to exclude certain states.  Ideally the 'bad' states
>would be taken out of the dropdown menu on the order form.  If anyone can
>walk me through it or point me to some documentation (an old thread?), I
>would greatly appreciate it.
>
>C-
>
>
>
>_______________________________________________
>interchange-users mailing list
>interchange-users at icdevgroup.org
>http://www.icdevgroup.org/mailman/listinfo/interchange-users
>
>  
>
Christopher,

I have been planting if statements into the checkout page to the extent 
that I would have trouble explaining what is going on. The positive side 
is that it always works, and as I copy the code for the next job, and 
add to it it continues to work. This snippet allows for the fact that I 
have written my own http postal rates lookup, and that their server 
might be down. That prevents a bag of cement being shipped  from Perth, 
Austalia to Rome for free. It works by displaying an error message in 
place the submit button. I have done this for the Camtech Credit Card 
Payment Gateway too; for 99 codes - for suspected fraud etc.


       [if session ship_message]                              
            [if items]
Our server could not connect to shipping calculations. <br>Please try 
again later, or <a href="mailto:m10 at xxxxxx.net.au">contact us</a> to 
make alternative shipping arrangements.<br> We apologize for any 
inconvenience.
            [/if]
        [else]
            [if items]
[if value zip]

                <td>

                [button

                name="mv_click"

                src="__THEME__/__CATALOG__placeorder.gif"

                text="Place Order"

                hidetext=1

                form=checkout

            ]

                mv_todo=submit

                [/button]

                </td>

                <td>

                    [button

            name="mv_click"

            src="__THEME_IMG_DIR____CATALOG__recalculate_button.gif"

            text="Recalculate"

            hidetext=1

            form=checkout

        ]

            mv_todo=refresh

            [/button]

                </td>
[/if]


Further up the page we exclude Indonesia from realtime credit card 
processing:


      [if !value payment_method]

      [or value payment_method eq credit]

      [or value payment_method eq credit_manual]

      [then]


          [if value country ne "ID"]

          [if variable CREDIT_CARDS_ACCEPTED]

          <option [selected payment_method credit_manual] 
value="credit_manual">Credit Card

          [/if]

              [/if]

          [if variable CHECK_ACCEPTED]

          <option [selected payment_method check] value="check">Online Check

          [/if]

          [if variable PO_ACCEPTED]

          <option [selected payment_method po] value="po">Company P.O.

          [/if]

          [if variable POSTAL_ACCEPTED]

          <option [selected payment_method postal] value="postal">Postal 
Billing

          [/if]

          [if variable COD_ACCEPTED]

          <option [selected payment_method postal] value="cod">C.O.D.

          [/if]

          [if variable DIRECT_DEPOSIT]

          <option [selected payment_method directdeposit] 
value="directdeposit">Direct Deposit

          [/if]

          </SELECT>

            </td>

        <td colspan="2" class="contentbar1">

          (will update display)

        </td>

          </tr>

          <tr>

            <td class="contentbar1" colspan="4">&nbsp;</td>

          </tr>

          </table>



        </td>

      </tr>

      </table>
[/if]

Maybe you need to change    [if value country ne "ID"] to  [if value 
state ne "xx"]

If you are not sure how to do OR or any other logic learn from 
interchange, look into the code above:


      [if !value payment_method]

      [or value payment_method eq credit]

      [or value payment_method eq credit_manual]

      [then]

I hope that was useful,

Frank Reitzenstein.




More information about the interchange-users mailing list