Announcement

Collapse
No announcement yet.

Timed Images

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

    Timed Images

    It would be nice to be able to assign a date range to product images. I have a store that has holiday versions of its product images. It could work like the settings in the Marketing Price Groups. This would enable a store owner to preload years worth of seasonal images that could automatically change out.
    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

    #2
    Originally posted by lesliekirk View Post
    It would be nice to be able to assign a date range to product images. I have a store that has holiday versions of its product images. It could work like the settings in the Marketing Price Groups. This would enable a store owner to preload years worth of seasonal images that could automatically change out.
    Three years later, I still need this. Is this going to be part of PageBuilder? Unfortunately, I need it right now for custom fields and have it tie into a timed Marketing Price Group.
    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

    Comment


      #3
      We use this. It's no good for product images, but we use it for banners...

      Code:
      <mvt:if expr="(s.tm_year EQ '2022' AND s.tm_mon EQ '10' AND s.tm_mday GT '6') AND (s.tm_year EQ '2022' AND s.tm_mon EQ '10' AND s.tm_mday LT '15')">
      <!-- your timed image -->
      </mvt:if>
      We have the same issue with holiday product images. Nothing like setting up promotional product images in the middle of the night.
      Ron Frigon
      Jedi Webmaster Obi-Ron Kenobi

      Comment


        #4
        This might help for now.

        Some simple conditionals based off the month:

        Code:
        <mvt:comment> Conditionals for Each Individual Month </mvt:comment>
        <mvt:if expr="s.dyn_tm_mon EQ 1">
            code to show January image
        <mvt:elseif expr="s.dyn_tm_mon EQ 2">
            code to show February image
        <mvt:elseif expr="s.dyn_tm_mon EQ 3">
            code to show March image
        <mvt:elseif expr="s.dyn_tm_mon EQ 4">
            code to show April image
        <mvt:elseif expr="s.dyn_tm_mon EQ 5">
            code to show May image
        <mvt:elseif expr="s.dyn_tm_mon EQ 6">
            code to show June image
        <mvt:elseif expr="s.dyn_tm_mon EQ 7">
            code to show July image
        <mvt:elseif expr="s.dyn_tm_mon EQ 8">
            code to show August image
        <mvt:elseif expr="s.dyn_tm_mon EQ 9">
            code to show September image
        <mvt:elseif expr="s.dyn_tm_mon EQ 10">
            code to show October image
        <mvt:elseif expr="s.dyn_tm_mon EQ 11">
            code to show November image
        <mvt:elseif expr="s.dyn_tm_mon EQ 12">
            code to show December image
        <mvt:elseif expr="NOT ISNULL l.settings:product:imagetypes:main"><mvt:comment> <! -- For CTGY, SRCH, PLST, etc. Product List Layout --> </mvt:comment>
            &mvte:product:imagetypes:main;
        <mvt:elseif expr="NOT ISNULL l.settings:product:customfield_values:productimage customfields:main"><mvt:comment> <! -- For PROD Display Layout --> </mvt:comment>
            &mvt:product:customfield_values:productimag ecustomfields:main;
        <mvt:else><mvt:comment> <! -- NO IMAGE AVAILABLE --> </mvt:comment>
            &mvte:global:theme_path;/images/img_no_thumb.gif
        </mvt:if>
        More granular conditionals based off date ranges:

        Code:
        <mvt:if expr="( s.dyn_tm_mon EQ 1 AND s.dyn_tm_mday GE 14 ) OR ( s.dyn_tm_mon EQ 2 AND s.dyn_tm_mday LE 14 )">
            code to show Valentine's Day image 1 month before
        <mvt:elseif expr="( s.dyn_tm_mon EQ 4 AND s.dyn_tm_mday GE 8 ) OR ( s.dyn_tm_mon EQ 5 AND s.dyn_tm_mday LE 14 )"><mvt:comment> <! -- mother's day falls between may 8 and may 14 --> </mvt:comment>
            code to show Mother's Day image roughly 1 month before
        <mvt:elseif expr="( s.dyn_tm_mon EQ 5 AND s.dyn_tm_mday GE 15 ) OR ( s.dyn_tm_mon EQ 6 AND s.dyn_tm_mday LE 21 )"><mvt:comment> <! -- father's day falls between june 15 and june 21 --> </mvt:comment>
            code to show Father's Day image roughly 1 month before
        <mvt:elseif expr="( s.dyn_tm_mon EQ 11 AND s.dyn_tm_mday GE 16 ) OR s.dyn_tm_mon EQ 12"><mvt:comment> <! -- black friday falls between november 23 and november 29 so set date to start 1 week before november 23--> </mvt:comment>
            code to show Black Friday/Holiday image
        <mvt:elseif expr="NOT ISNULL l.settings:product:imagetypes:main"><mvt:comment> <! -- For CTGY, SRCH, PLST, etc. Product List Layout --> </mvt:comment>
            &mvte:product:imagetypes:main;
        <mvt:elseif expr="NOT ISNULL l.settings:product:customfield_values:productimage customfields:main"><mvt:comment> <! -- For PROD Display Layout --> </mvt:comment>
            &mvt:product:customfield_values:productimag ecustomfields:main;
        <mvt:else><mvt:comment> <! -- NO IMAGE AVAILABLE --> </mvt:comment>
            &mvte:global:theme_path;/images/img_no_thumb.gif
        </mvt:if>
        I added examples for any product list layout and the PROD display but these can be adapted for Theme Component Product Listings, Related Product Listings, etc..

        Hope this helps.

        Cheers,

        Nick

        Nick Harkins
        www.loveisarose.com

        Comment


          #5
          Ron Frigon you beat me to it haha. Cheers.
          Nick Harkins
          www.loveisarose.com

          Comment


            #6
            Along with these fine examples of SMT coding, you could also use Scot's Scripts SMS (Schedule Messaging System) module. Instead of using it to DISPLAY a message, you just use the presence of the message to call in the image, or use it as the image name itself, so the code would be simplier

            IF g.MyScheduledMessage
            <img src="&mvt:global:MyScheduledMessage;">
            ELSE
            miva's default image
            END
            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


              #7
              you could also use Scot's Scripts SMS (Schedule Messaging System) module
              We have that module on one of our sites. It's pretty awesome...
              Ron Frigon
              Jedi Webmaster Obi-Ron Kenobi

              Comment


                #8
                What about custom fields? The product flags? Need to be able to time the "sale" flag to the Marketing Price Group sale dates. I'm thinking there are going to be a number of images that need to be changed out on various pages to coincide with a series of sales.
                Leslie Kirk
                Miva Certified Developer
                Miva Merchant Specialist since 1997
                Previously of Webs Your Way
                (aka Leslie Nord leslienord)

                Email me: [email protected]
                www.lesliekirk.com

                Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                Comment


                  #9
                  Originally posted by lesliekirk View Post
                  What about custom fields? The product flags? Need to be able to time the "sale" flag to the Marketing Price Group sale dates. I'm thinking there are going to be a number of images that need to be changed out on various pages to coincide with a series of sales.
                  hmm, not sure exactly what you mean, but it seems like this justifies the SMS module even more. So, lets say you have four sales events planned.

                  IF g.SMS_summer_sale
                  <img src="g.SMS_summer_sale">
                  &mvt:SMS_summer_sale_message;
                  ELSEIF g.SMS_fall_sale
                  <img src="g.SMS_Fall_sale">
                  &mvt:SMS_fall_sale_message;

                  etc.

                  AND

                  IF g.SMS_summer_sale_flag
                  <img src="g.SMS_summer_sale_flag">

                  ELSEIF g.SMS_fall_sale
                  <img src="g.SMS_Fall_sale_flag">
                  etc.

                  so instead of using custom fields to contain content, you just put it in the SMS system.
                  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


                    #10
                    lesliekirk it may be a lot of repeat code but the flag code along with the image could go within those time based conditionals.

                    You could then change the flag and image within each conditional to match the seasonal sales.

                    Btw I figured out a better more precise way of synchronizing the conditionals with the price group start and end dates.

                    It Loads the Price Group by ID and assigns it to a global variable making a bunch of the settings accessible via global variables as well.

                    Code:
                    <mvt:do file="g.Module_Feature_PGR_DB" name="l.success" value="PriceGroup_Load_ID( insert_ID_of_Price_Group, g.Vday_price_group )" />
                    <mvt:do file="g.Module_Feature_PGR_DB" name="l.success" value="PriceGroup_Load_ID( insert_ID_of_Price_Group, g.Mday_price_group )" />
                    <mvt:do file="g.Module_Feature_PGR_DB" name="l.success" value="PriceGroup_Load_ID( insert_ID_of_Price_Group, g.Fday_price_group )" />
                    <mvt:do file="g.Module_Feature_PGR_DB" name="l.success" value="PriceGroup_Load_ID( insert_ID_of_Price_Group, g.BF_holiday_price_group )" />
                    
                    <mvt:if expr="s.time_t GE g.Vday_price_group:dt_start AND s.time_t LE g.Vday_price_group:dt_end">
                        price group flag and image code
                    <mvt:elseif expr="s.time_t GE g.Mday_price_group:dt_start AND s.time_t LE g.Mday_price_group:dt_end">
                        price group flag and image code
                    <mvt:elseif expr="s.time_t GE g.Fday_price_group:dt_start AND s.time_t LE g.Fday_price_group:dt_end">
                        price group flag and image code
                    <mvt:elseif expr="s.time_t GE g.BF_holiday_price_group:dt_start AND s.time_t LE g.BF_holiday_price_group:dt_end">
                        price group flag and image code
                    <mvt:else>
                        non seasonal flag and image code
                    </mvt:if>
                    Hope this helps.


                    I think another dream feature that would be nice for Price Groups would be adding a way to pin holidays that change every year to a calendar.

                    Ex:
                    • Pin Thanksgiving/Black Friday to the fourth Thursday/Friday of November.
                    • Start date could be a toggle to start on the date pinned or set a number of days before the pinned date.
                    • End date could be a toggle to end on the date pinned or set a number of days after the pinned date.
                    Then you could set up yearly seasonal Price Groups without having to adjust the dates every year.

                    That feature coupled with smt code like the example above could be a great way to schedule seasonal changes to the website in a practically set it and forget it manner.

                    Could even couple it with theme component images/banners so non techy store owners can just upload the different seasonal images and text for banners and whatnot.

                    Nick Harkins
                    www.loveisarose.com

                    Comment


                      #11
                      Originally posted by SidFeyDesigns View Post
                      lesliekirk it may be a lot of repeat code but the flag code along with the image could go within those time based conditionals.

                      You could then change the flag and image within each conditional to match the seasonal sales.

                      Btw I figured out a better more precise way of synchronizing the conditionals with the price group start and end dates.

                      It Loads the Price Group by ID and assigns it to a global variable making a bunch of the settings accessible via global variables as well.

                      Code:
                      <mvt:do file="g.Module_Feature_PGR_DB" name="l.success" value="PriceGroup_Load_ID( insert_ID_of_Price_Group, g.Vday_price_group )" />
                      <mvt:do file="g.Module_Feature_PGR_DB" name="l.success" value="PriceGroup_Load_ID( insert_ID_of_Price_Group, g.Mday_price_group )" />
                      <mvt:do file="g.Module_Feature_PGR_DB" name="l.success" value="PriceGroup_Load_ID( insert_ID_of_Price_Group, g.Fday_price_group )" />
                      <mvt:do file="g.Module_Feature_PGR_DB" name="l.success" value="PriceGroup_Load_ID( insert_ID_of_Price_Group, g.BF_holiday_price_group )" />
                      
                      <mvt:if expr="s.time_t GE g.Vday_price_group:dt_start AND s.time_t LE g.Vday_price_group:dt_end">
                      price group flag and image code
                      <mvt:elseif expr="s.time_t GE g.Mday_price_group:dt_start AND s.time_t LE g.Mday_price_group:dt_end">
                      price group flag and image code
                      <mvt:elseif expr="s.time_t GE g.Fday_price_group:dt_start AND s.time_t LE g.Fday_price_group:dt_end">
                      price group flag and image code
                      <mvt:elseif expr="s.time_t GE g.BF_holiday_price_group:dt_start AND s.time_t LE g.BF_holiday_price_group:dt_end">
                      price group flag and image code
                      <mvt:else>
                      non seasonal flag and image code
                      </mvt:if>
                      Hope this helps.


                      I think another dream feature that would be nice for Price Groups would be adding a way to pin holidays that change every year to a calendar.

                      Ex:
                      • Pin Thanksgiving/Black Friday to the fourth Thursday/Friday of November.
                      • Start date could be a toggle to start on the date pinned or set a number of days before the pinned date.
                      • End date could be a toggle to end on the date pinned or set a number of days after the pinned date.
                      Then you could set up yearly seasonal Price Groups without having to adjust the dates every year.

                      That feature coupled with smt code like the example above could be a great way to schedule seasonal changes to the website in a practically set it and forget it manner.

                      Could even couple it with theme component images/banners so non techy store owners can just upload the different seasonal images and text for banners and whatnot.
                      Thanks again. Yeah I'm hoping that something like this has been included in PageBuilder - it would be icing on the Marketing Department's cake!

                      I'll play with your code, it should be interesting since it a custom field and CSS.
                      Leslie Kirk
                      Miva Certified Developer
                      Miva Merchant Specialist since 1997
                      Previously of Webs Your Way
                      (aka Leslie Nord leslienord)

                      Email me: [email protected]
                      www.lesliekirk.com

                      Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                      Comment


                        #12
                        lesliekirk you're welcome. That would definitely be nice.
                        Nick Harkins
                        www.loveisarose.com

                        Comment

                        Working...
                        X