Announcement

Collapse
No announcement yet.

Has anyone successfully created any Promotion Feeds?

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

    Has anyone successfully created any Promotion Feeds?

    Has anyone successfully created any Promotion Feeds?
    Thank you, Bill Davis

    #2
    We have a few promotional feeds. What is your specific issue?

    Comment


      #3
      None yet, I'm just getting started and wanted to know if one needs to create a promotion feed each time a promotion is running or is it similar to product feeds wherein you set it and forget it?
      Thank you, Bill Davis

      Comment


        #4
        I suppose that depends on the use case for each promotion feed. Most of our promotion feeds are dynamic. I just have to change the marketplace promotion settings before running the feed. If you don't want to edit the actual feed code for each promotion, you can set up the feed to be accessible via URL and then pull the promotion information from a URL parameter. Then simply accessing a URL will generate the feed specific to that promotion.

        However, I am always looking for better ways to do things in MIVA, so I hope some of the others on the forum chime in as well.

        Comment


          #5
          Ideally, I would like for Promotion Feeds to be dynamically created and/or updated when a "Price Group > Discounted Product > By Category" and "Price Group > Discounted Product > By Product" is active (meaning within Price Group > Start/End Period).
          Thank you, Bill Davis

          Comment


            #6
            Originally posted by kocourek View Post
            I suppose that depends on the use case for each promotion feed. Most of our promotion feeds are dynamic. I just have to change the marketplace promotion settings before running the feed. If you don't want to edit the actual feed code for each promotion, you can set up the feed to be accessible via URL and then pull the promotion information from a URL parameter. Then simply accessing a URL will generate the feed specific to that promotion.

            However, I am always looking for better ways to do things in MIVA, so I hope some of the others on the forum chime in as well.
            Ideally, I would like for Promotion Feeds to be dynamically created and/or updated when a "Price Group > Discounted Product > By Category" and "Price Group > Discounted Product > By Product" is active (meaning within Price Group > Start/End Period).

            Is this possible?

            How are you doing it kocourek?
            Last edited by William Davis; 01-28-22, 09:56 AM.
            Thank you, Bill Davis

            Comment


              #7
              Although my promotion feed templates are dynamic, the trigger for them is manual. I have not put much time into triggering the feed generation based on when a price group is active. We do not run enough promotions for me to justify that. As a store operator, I do not believe there is a way to easily do this.

              But I have been thinking about this since your last post, so I rubbed my two brain cells together to give them some exercise.

              The first step would be to set up a generic promotion feed that takes in the price group name from the URL parameters as a global variable. The price group name can then be used within the feed header template to alter the products processed.

              If you don't need a file stored on your server, and a real-time generated feed is adequate, provide the marketplace the URL to your feed with the URL parameters included. EG "https://www.store.com/my_feed?Feed_AccessKey=test&promotion=myPriceFroup Name" This step would require scheduling the promotion at each marketplace.

              If you need a promotion feed file, you could set up a daily(?) scheduled task and in that scheduled task loop through your price groups, identify the active ones, check if the feed file exists, then run the promotional feed. (don't actually use this code, it's literally brain vomit. I'm even not certain you can alter a feed output filename from within the feed)

              Code:
              <mvt:do file="g.Module_Feature_PGR_DB" name="l.success" value="PriceGroupList_Load_All(l.currentPriceGroups)" />
              <mvt:foreach array="l.currentPriceGroups" iterator="l.priceGroup">
                  <mvt:assign name="l.isValid" value="{
                      (l.priceGroup:dt_start ISNULL OR s.dyn_time_t GT l.priceGroup:dt_start)
                      AND (l.priceGroup:dt_end ISNULL OR s.dyn_time_t LT l.priceGroup:dt_end)}" />
                  <mvt:if expr="{NOT l.isValid}">
                      <mvt:foreachcontinue />
                  </mvt:if>
                  <mvt:if expr="NOT(fexists( '/path/to/your/feeds/' $ l.priceGroup.name $ '.csv' ) AND NOT(fexists( '/path/to/your/feeds/' $ l.priceGroup.name $ '.tsv' ))">
                      <mvt:assign name="l.feedUrl" value="'https://www.store.com/my_feed?Feed_AccessKey=test&promotion=' $ l.priceGroup.name"/>
                      <mvt:call action="l.feedUrl" METHOD="'GET'">
                          <mvt:eval expr = "s.callvalue " />
                      </mvt:call>
                  <mvt:if>
              </mvt:foreach>
              Again, don't use this code, this doesn't handle any file cleanup and will stack feed generation for all active price groups without a feed file. I'm only including it because it was fun to think it this far through. But hopefully, it helps point you in the right direction.

              ****TLDR*****
              There are currently three ways to generate a feed that I am aware of. 1)Scheduled Task 2)Manual execution from within the admin. 3) Execution via URL. There is not a native way to hook into the Price Group start and end times to generate a feed.
              Last edited by kocourek; 01-31-22, 02:34 PM. Reason: Formatting Issues

              Comment


                #8
                Originally posted by kocourek View Post
                Although my promotion feed templates are dynamic, the trigger for them is manual. I have not put much time into triggering the feed generation based on when a price group is active. We do not run enough promotions for me to justify that. As a store operator, I do not believe there is a way to easily do this.

                But I have been thinking about this since your last post, so I rubbed my two brain cells together to give them some exercise.

                The first step would be to set up a generic promotion feed that takes in the price group name from the URL parameters as a global variable. The price group name can then be used within the feed header template to alter the products processed.

                If you don't need a file stored on your server, and a real-time generated feed is adequate, provide the marketplace the URL to your feed with the URL parameters included. EG "https://www.store.com/my_feed?Feed_AccessKey=test&promotion=myPriceFroup Name" This step would require scheduling the promotion at each marketplace.

                If you need a promotion feed file, you could set up a daily(?) scheduled task and in that scheduled task loop through your price groups, identify the active ones, check if the feed file exists, then run the promotional feed. (don't actually use this code, it's literally brain vomit. I'm even not certain you can alter a feed output filename from within the feed)

                Code:
                <mvt:do file="g.Module_Feature_PGR_DB" name="l.success" value="PriceGroupList_Load_All(l.currentPriceGroups)" />
                <mvt:foreach array="l.currentPriceGroups" iterator="l.priceGroup">
                <mvt:assign name="l.isValid" value="{
                (l.priceGroup:dt_start ISNULL OR s.dyn_time_t GT l.priceGroup:dt_start)
                AND (l.priceGroup:dt_end ISNULL OR s.dyn_time_t LT l.priceGroup:dt_end)}" />
                <mvt:if expr="{NOT l.isValid}">
                <mvt:foreachcontinue />
                </mvt:if>
                <mvt:if expr="NOT(fexists( '/path/to/your/feeds/' $ l.priceGroup.name $ '.csv' ) AND NOT(fexists( '/path/to/your/feeds/' $ l.priceGroup.name $ '.tsv' ))">
                <mvt:assign name="l.feedUrl" value="'https://www.store.com/my_feed?Feed_AccessKey=test&promotion=' $ l.priceGroup.name"/>
                <mvt:call action="l.feedUrl" METHOD="'GET'">
                <mvt:eval expr = "s.callvalue " />
                </mvt:call>
                <mvt:if>
                </mvt:foreach>
                Again, don't use this code, this doesn't handle any file cleanup and will stack feed generation for all active price groups without a feed file. I'm only including it because it was fun to think it this far through. But hopefully, it helps point you in the right direction.

                ****TLDR*****
                There are currently three ways to generate a feed that I am aware of. 1)Scheduled Task 2)Manual execution from within the admin. 3) Execution via URL. There is not a native way to hook into the Price Group start and end times to generate a feed.
                Thanks!
                Thank you, Bill Davis

                Comment

                Working...
                X