Announcement

Collapse
No announcement yet.

OUI lookup: number of products in category

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

    OUI lookup: number of products in category



    ------=_NextPart_000_00A7_01C55BBF.F11D2F30
    Content-Type: text/plain;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable

    I just took a quick look at stylepup.com -

    First impressions:
    #1 - stylepup.com redirected to rapid-fire.us
    (This decreases your credibility - I wouldn't make a purchase for this =
    reason alone)
    #2 - the colors gave me a sick feeling. In addition, these colors =
    clashed with colors used on the T-shirts
    #3 - I looked at a couple of the T-shirts, and could not imagine how the =
    design would look on a T-shirt or the dog. I think the customer would =
    want to see the whole T-shirt, or better yet, a dog modeling the =
    T-shirt.

    More photos of dogs throughout the site would be a great start. You =
    could even start a photo gallery of customer photos - They make a =
    purchase then send a picture of their dog in your products. People love =
    to show off their dogs, so that might just work.

    Good luck!

    Amanda=20
    ----- Original Message -----=20
    From: Anthony V=20
    To: [email protected]=20
    Sent: Wednesday, May 18, 2005 3:24 PM
    Subject: [mru] online sales dillema (suggestions welcome!)


    Hi All,

    I've been a lurker on this list since 2000 when I opened my first =
    Merchant=20
    store. The store, www.BoulderingGear.com sells rock climbing =
    equipment...=20
    not exactly a broad market by any measure. The store saw limited =
    success=20
    but soon began to suffer as competition arose. Today it pretty much =
    sits=20
    there gathering a paucity of orders. Back when the store was =
    successful, I=20
    was working as a climbing photographer and the site was more or less=20
    advertised by electronic word of mouth. Since then, my involvement in =
    the=20
    climbing community has waned and so have sales.

    I recently opened www.stylepup.com, a site which sells dog clothes and =

    accessories. The site has as broad appeal as any, with potential =
    customers=20
    everywhere. (Even if you don't own a dog, you probably know someone =
    who=20
    does.) Pricing is on par or lower than most other sites out there =
    (and=20
    there are many other sites out there), but sales are nil. Admittedly, =

    wholesale sales (non-web) of the exact same products are huge, with =
    spencer=20
    gifts carying many of these products. In addition, at a local =
    consumer pet=20
    show we attended, our booth was flooded with people buying multiple=20
    products.

    I really want this site to flourish rather than tank, and would =
    welcome any=20
    and all remarks, comments, suggestions or even harasment over the fact =
    that=20
    dogs would be made to wear such things ;)

    thanks in advance,

    Anthony V=20




    #2
    OUI lookup: number of products in category



    Here is the same code converted to a MivaScript function. Compile the
    function and upload it to your store.

    <MvFUNCTION NAME="ProductCount_Category" PARAMETERS="cust_id,cat_code"
    STANDARDOUTPUTLEVEL="compresswhitespace">
    <MvCOMMENT> Return the number of products in the category
    </MvCOMMENT>
    <MvASSIGN NAME="l.count" VALUE="{0}">
    <MvDO FILE="{g.Module_Library_DB}" NAME="l.found" VALUE="{
    Customer_Category_Find_Code(l.cust_id,l.cat_code) }">
    <MvIF EXPR="{l.found}">
    <MvDO FILE="{g.Module_Library_DB}" NAME="l.found" VALUE="{
    Customer_Product_FindFirst_Category(l.cust_id,Cate gories.d.id) }">
    <MvWHILE EXPR="{l.found}">
    <MvDO FILE="{g.Module_Feature_INV_RT}"
    NAME="l.stock_level" VALUE="{ INV_StockLevelCode(Products.d.id) }">
    <MvIF EXPR="{l.stock_level NE 'out'}">
    <MvASSIGN NAME="l.count" VALUE="{ l.count+1
    }">
    </MvIF>
    <MvDO FILE="{g.Module_Library_DB}" NAME="l.found"
    VALUE="{ Customer_Product_FindNext_Category(l.cust_id,0,Cat egories.d.id) }">
    </MvWHILE>
    </MvIF>
    <MvFUNCRETURN VALUE="{l.count}">
    </MvFUNCTION>

    To call the function with OpenUI

    %SET(g.Category_Code|Jazz)%

    %DOFUNC(g.ProductCount|g.path_to_the_file|ProductC ount_Category(BasketList.d
    .cust_id,g.Category_Code))%
    %VAR(g.Category_Code)%: %VAR(g.ProductCount)%





    Comment


      #3
      OUI lookup: number of products in category



      I had already written the token version, of the script so I was happy to
      share it.

      The MivaScript version I posted will not work in OpenDesigner because it's,
      well... MivaScript. OpenUI/OpenDesigner only interprets Token script.

      Open Designers "compile" button is really misnamed. It provides a "convert
      to MivaScript" feature that will allow you to then grab the output and
      compile it with the Miva compiler (assuming you've coughed up the $700 Miva
      for the compiler) then re-upload and import the compiled script into
      OpenDesigner. Be aware that the script it outputs contains some overhead so
      it will be somewhat slower than the short function I wrote. What I provided
      was the code for the function itself which you can compile, upload, and call
      with the %DOFUNC()% token from your OpenUI headers or from OpenDesigner
      screens. Compiled code works 10 to 20 times faster.

      It's like this. OpenTokens are interpreted and executed by OpenUI which is
      written in compiled MivaScript. Side by side, OpenTokens look so much like
      MivaScript because it is based on MivaScript. Merchant screens were
      originally written in MivaScript, but once Miva compiled them, there was no
      longer any way to make changes. Enter OpenDesigner which provides OpenToken,
      interpreted "versions" of the screens, and an interface for customizing
      them.

      Now we've come full circle and can output our Token script back into
      MivaScript, compile them and use the compiled version. If that's not the
      loooooooong way around the barn, I don't know what is. Why didn't Miva just
      keep the interpreter built into the Empressa engine so it could execute both
      compiled and un-compiled script? (Short answer $$$$$, they want to sell the
      compiler.)

      Enter Merchant 5 which implements what? Interpreted Tokens! Don't get me
      started... <Big sigh!>

      Ray

      -----Original Message-----
      From: [email protected]
      [mailto:[email protected]] On Behalf Of Marvin Sanders
      Sent: Wednesday, May 18, 2005 8:00 PM
      To: 'Ray Yates'; [email protected]
      Subject: RE: [mru] OUI lookup: number of products in category

      Hi Ray,

      Wow, you really are the king! This works perfectly, and you might be
      interested to know it only returns in-stock products (i.e., your second
      untested version isn't necessary):

      %OUI%
      %SET(g.ProductCount|0)%
      %DOFUNC(g.found|g.Module_Library_DB|Customer_Categ ory_Find_Code(BasketList.d
      .cust_id,g.Category_Code))%
      %IF(g.found)%

      %DOFUNC(g.found|g.Module_Library_DB|Customer_Produ ct_FindFirst_Category(Bask
      etList.d.cust_id,Categories.d.id))%
      %WHILE(g.found)%
      %ASSIGN(g.ProductCount|g.ProductCount + 1)%

      %DOFUNC(g.found|g.Module_Library_DB|Customer_Produ ct_FindNext_Category(Baske
      tList.d.cust_id,0,Categories.d.id))%
      %WHILEEND%
      %IFEND%
      %VAR(g.Category_Code)%: %VAR(g.ProductCount)%

      Quick question about the MivaScript version you sent. I don't work with
      OpenDesigner, but I seem to recall that it has a compiler built in -- or can
      I compile a function without OpenDesigner?

      Thanks again,

      Marv



      Comment

      Working...
      X