Has anyone successfully created any Promotion Feeds?
Announcement
Collapse
No announcement yet.
Has anyone successfully created any Promotion Feeds?
Collapse
X
-
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
-
Originally posted by kocourek View PostI 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.
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
-
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>
****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.
Comment
-
Originally posted by kocourek View PostAlthough 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>
****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.Thank you, Bill Davis
Comment
Comment