By default, campaign products are displayed only on the campaign page. However, in some cases, you may want to print products belonging to a particular campaign elsewhere – for example on the front page of your online store.
To do it, use MyCashflow's Interface tags. Tags are primarily used for designing online stores, but you can also use them in text fields (such as product descriptions, for instance).
In the MyCashflow default theme, products are printed on the campaign page with the {CampaignProducts}
tag, which prints products only in the campaign scope. However, you can use the {Campaign}
tag to print products in any scope based on the campaign's ID number.
Printing campaign products by using the {Campaign} tag
The example below illustrates how to print a campaign name and all products that belong to the campaign whose ID number is 123 (2nd row). In the tag's helper
attribute, you can use any tags that print campaign details or campaign products.
{Campaign(
id: '123',
helper: '{{
{CampaignName}
{CampaignProducts}
}}'
)}
You can copy the code sample and paste it e.g. to the description of the front page product category. Make sure to replace the ID number with the desired campaign's ID. In this way, you can display the selected campaign's products and details on your online store's front page.
The easiest way of finding the campaign ID is to open the campaign for editing in the admin panel and check the id variable in the browser's address bar.