Announcement

Collapse
No announcement yet.

Ever use tool kit to flag new products?

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

    Ever use tool kit to flag new products?

    I want to put a conditional on my product pages to display a "New Item" graphic if the item has been on the site less than say 30 days.

    I would like to do this based on length of time a product has been on the site rather than relying on putting new products in a special category for new products. i.e. want it to be maintenance free.

    Can this be done? If so, would anyone care to share the sample code to do it?

    TIA
    Bronson Design Studio, LLC
    Website: bronsondesign.com
    Facebook: facebook.com/bronsondesign

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

    There is a function (last) which shows the most recent products. You can list, e.g. the newest 10 products.
    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


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

      Originally posted by wcw View Post
      There is a function (last) which shows the most recent products. You can list, e.g. the newest 10 products.
      Thanks Bill, but that's not what I'm looking for. I want it to work based on length of time a product has been on the site.

      Anyone know of a module that can do this?
      Bronson Design Studio, LLC
      Website: bronsondesign.com
      Facebook: facebook.com/bronsondesign

      Comment


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

        That info does not exist in the database. The date a product is entered is not recorded in any field. The only indication of when they were entered is the ID field which is a sequential number as each product is added. It grows by 1 with each new add. Highest numbers are added last.
        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


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

          Originally posted by wcw View Post
          That info does not exist in the database. The date a product is entered is not recorded in any field. The only indication of when they were entered is the ID field which is a sequential number as each product is added. It grows by 1 with each new add. Highest numbers are added last.
          Oh....bummer. Can I use tool kit to determine if the product is a member of a specific category (e.g. new-introductions) in order to trigger the display of my "NEW" graphic? What would the code/conditional look like?
          Bronson Design Studio, LLC
          Website: bronsondesign.com
          Facebook: facebook.com/bronsondesign

          Comment


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

            Look in the module's admin and see if you have the productincategory function in your version. If you do it has some example code to display the categories it is in. You'd have to devise a conditional to check for the specific category. I don't have a specific example for that.
            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


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

              I have the productincategory function, but I'm afraid I dont know how to use it to accomplish what I want. The example code is to display the categories a product is in. I just want to have a conditional to check for a product's existence in a specific category. Seems like it should be fairly simple....anyone?

              maybe something like the following?

              Code:
               
              <mvt:if expr="l.settings:category:code EQ 'new-introductions'">
              do this
              <mvt:else>
              do that
              Last edited by papi34; 02-10-09, 05:04 PM.
              Bronson Design Studio, LLC
              Website: bronsondesign.com
              Facebook: facebook.com/bronsondesign

              Comment


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

                Just thinking out loud, but could you add a custom field that would be the put-in-catalog date? It wouldn't matter that your existing products don't have the date since you're looking to flag the new ones. Then write your date conditionals based on the contents of the custom date field.
                Last edited by JFancett; 02-10-09, 08:25 PM.
                Jason Fancett
                America's SPA-MART - "Where Spa Owners Shop SMART!"
                Check us out for all of your hot tub needs including spa covers, spa filters, spa chemicals and more.
                Miva Merchant forum users can use coupon code MIVAFORUM to receive $5 off your first order of $30 or more.

                Comment


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

                  Originally posted by JFancett View Post
                  Just thinking out loud, but could you add a custom field that would be the put-in-catalog date? It wouldn't matter that your existing products don't have the date since you're looking to flag the new ones. Then write your date conditionals based on the contents of the custom date field.
                  Thanks for the suggestion! I tought of a similiar solution last night. I was going to create a custom product field to enter the put-in-catalog date and create a conditional just to check if the field is NULL. i.e. I was going to empty the field when the products were no longer new. I reread your idea and was wondering...how would you create a conditional based on date? i.e. Sample code

                  I was trying to avoid creating another custom product field since I already have special categories to flag new products that I could potentially key off of, however it seems like it may be necessary to go this route.
                  Last edited by papi34; 02-11-09, 05:02 AM.
                  Bronson Design Studio, LLC
                  Website: bronsondesign.com
                  Facebook: facebook.com/bronsondesign

                  Comment


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

                    Maybe our ideas were the same afterall. Not sure if you meant to create a conditional to check if the put-in-catalog field was null or if it was to actually make a decision based on the value of its contents (i.e. date value). The later would be simple to do in excel, but I don't know about miva. Is there a =today() equivalent in miva code?
                    Bronson Design Studio, LLC
                    Website: bronsondesign.com
                    Facebook: facebook.com/bronsondesign

                    Comment


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

                      Originally posted by papi34 View Post
                      Is there a =today() equivalent in miva code?
                      You can use the toolkit to format a date string, e.g. 20090211. Then use the math functions to compare the custom field date string. If the difference is less than XX, then show it as new.
                      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


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

                        Originally posted by wcw View Post
                        You can use the toolkit to format a date string, e.g. 20090211. Then use the math functions to compare the custom field date string. If the difference is less than XX, then show it as new.
                        Great, so it can be done. I just need to piece together the toolkit code, which will be challenging (but fun) for me. I'll post back if I can get it to work. Thx Bill!
                        Bronson Design Studio, LLC
                        Website: bronsondesign.com
                        Facebook: facebook.com/bronsondesign

                        Comment


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

                          Try this to create a date variable in the format YYYYMMDD. This is not the shortest way to write it. But is the easiest code to read and just as fast as using the toolkit mvassign function.

                          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:global:sysdate;
                          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


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

                            Having trouble with the sysdate part of this function

                            Code:
                            <mvt:item name="toolkit" param="math_subtract|difference|l.all_settings:product:customfield_values:customfields:DATE|l.all_settings:global:sysdate" />
                            Bronson Design Studio, LLC
                            Website: bronsondesign.com
                            Facebook: facebook.com/bronsondesign

                            Comment


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

                              It is not l.all_settings:global:sysdate It is g.sysdate
                              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

                              Working...
                              X