Announcement

Collapse
No announcement yet.

Ever use tool kit to flag new products?

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

    #16
    Re: Ever use tool kit to flag new products?

    I thought the following would work, but I was wrong:

    Code:
     
    <mvt:item name="toolkit" param="set_time_zone|our_time|-4" />
    <mvt:item name="toolkit" param="time_t_year|nyear|our_time" />
    <mvt:item name="toolkit" param="time_t_month|nmonth|our_time" />
    <mvt:item name="toolkit" param="time_t_dayofmonth|ndayofmonth|our_time" />
    <mvt:item name="toolkit" param="padl|cmonth|nmonth|2|0" />
    <mvt:item name="toolkit" param="padl|cday|ndayofmonth|2|0" />
    <mvt:item name="toolkit" param="sassign|sysdate|%year%%month%%day%" />
    <mvt:item name="toolkit" param="vglosub|sysdate,%day%,cday" />
    <mvt:item name="toolkit" param="vglosub|sysdate,%month%,cmonth" />
    <mvt:item name="toolkit" param="vglosub|sysdate,%year%,nyear" />
     
    <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields:DATE">
    <mvt:item name="toolkit" param="vassign|date_added|l.all_settings:product:customfield_values:customfields:DATE" />
    <mvt:item name="toolkit" param="math_subtract|difference|g.sysdate|g.date_added" />
    <mvt:if expr="g.difference LT '300'">
    &nbsp;&nbsp;<img src="graphics/en-US/mmui/new.gif" width="32" height="21" alt="" border=0>
    </mvt:if>
    </mvt:if>
    Am I supposed to use vassign like i did?
    Bronson Design Studio, LLC
    Website: bronsondesign.com
    Facebook: facebook.com/bronsondesign

    Comment


      #17
      Re: Ever use tool kit to flag new products?

      Debug your code. What do you get for these 3 variables? difference|g.sysdate|g.date_added
      For example &mvt:global:difference;
      Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
      Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
      Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
      Facebook http://www.facebook.com/EmporiumPlus
      Twitter http://twitter.com/emporiumplus

      Comment


        #18
        Re: Ever use tool kit to flag new products?

        Originally posted by wcw View Post
        Debug your code. What do you get for these 3 variables? difference|g.sysdate|g.date_added
        For example &mvt:global:difference;

        I get today's date: 20090211
        I guess that means the math function is not set up correctly.
        Note: The custom product field DATE was set to 20090101
        Perhaps the date_added variable is being treated as text and it needs to be conditioned to be an integer???
        Last edited by papi34; 02-11-09, 11:08 AM.
        Bronson Design Studio, LLC
        Website: bronsondesign.com
        Facebook: facebook.com/bronsondesign

        Comment


          #19
          Re: Ever use tool kit to flag new products?

          What did you get for ALL three variables?
          Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
          Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
          Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
          Facebook http://www.facebook.com/EmporiumPlus
          Twitter http://twitter.com/emporiumplus

          Comment


            #20
            Re: Ever use tool kit to flag new products?

            Thanks Bill...got it to work with your help! Here is the code for any lurkers:

            Code:
             
            <mvt:item name="toolkit" param="set_time_zone|our_time|-4" />
            <mvt:item name="toolkit" param="time_t_year|nyear|our_time" />
            <mvt:item name="toolkit" param="time_t_month|nmonth|our_time" />
            <mvt:item name="toolkit" param="time_t_dayofmonth|ndayofmonth|our_time" />
            <mvt:item name="toolkit" param="padl|cmonth|nmonth|2|0" />
            <mvt:item name="toolkit" param="padl|cday|ndayofmonth|2|0" />
            <mvt:item name="toolkit" param="sassign|sysdate|%year%%month%%day%" />
            <mvt:item name="toolkit" param="vglosub|sysdate,%day%,cday" />
            <mvt:item name="toolkit" param="vglosub|sysdate,%month%,cmonth" />
            <mvt:item name="toolkit" param="vglosub|sysdate,%year%,nyear" />
            <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields:DATE">
            <mvt:item name="toolkit" param="vassign|date_added|l.all_settings:product:customfield_values:customfields:DATE" />
            <mvt:item name="toolkit" param="math_subtract|difference|g.sysdate|g.date_added" />
             <mvt:if expr="g.difference LT '300'">
              &nbsp;<img src="graphics/en-US/mmui/new.gif" width="32" height="21" alt="" border=0>
             </mvt:if>
            </mvt:if>
            Another great use for The Tool Kit!

            Note: Bill suggested that the custom field should contain a date in the future that the product should no longer be considered new. Then just check to see if that date is greater than today's sysdate. This would prevent everything being reset to "old" when we start a new calender year.
            Bronson Design Studio, LLC
            Website: bronsondesign.com
            Facebook: facebook.com/bronsondesign

            Comment


              #21
              Re: Ever use tool kit to flag new products?

              I'm using mysql and just added a field to the products database.
              mysql can be setup so that whenever the product is added that the datestamp will update. this way you could use toolkit or toolbelt to get at that date and filter your display.

              of course if you modify your product it woudl refesh the date.
              but that might be desireable.

              Comment


                #22
                Re: Ever use tool kit to flag new products?

                However, modifying the Database schema outside of API functions could cause problems when Miva Merchant is updated. (That being said, even modifying the database WITH an API can cause problems when Merchant is updated...heck, even just Updating...oh, nevermind.)
                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


                  #23
                  Re: Ever use tool kit to flag new products?

                  :-) i'm always careful to use a field name that miva wouldn't use. Usually I name using a prefix like my initials. ke_modifiedDate would be what I'd use for a modified date field. From the database miva uses pretty straight forward naming conventions.
                  So far.. (your warnings are to be kept in mind) I have never had an issue - except when i used a name that they would use.

                  Also i always backup my db before doing a patch. Just in case they decide to wipe out something, or in case i need to roll back. Everyone should have a policy of doing a full back up before updating or patching. It's just common sense.
                  Last edited by kayakbabe; 06-04-09, 03:16 PM.

                  Comment


                    #24
                    Re: Ever use tool kit to flag new products?

                    Thanks for posting the code.

                    I had the same requirement and it works a treat.
                    Facewest- UK Adventure sports Equipment
                    www.facewest.co.uk

                    Comment

                    Working...
                    X