Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
UpdatePrivacyPolicyPage.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Cms\Model\PageFactory;
12 
18 {
22  private $pageFactory;
23 
28  public function __construct(
29  PageFactory $pageFactory
30  ) {
31  $this->pageFactory = $pageFactory;
32  }
33 
38  public function apply()
39  {
40  $newPageContent = <<<EOD
41 <div class="privacy-policy cms-content">
42  <div class="message info">
43  <span>
44  Please replace this text with you Privacy Policy.
45  Please add any additional cookies your website uses below (e.g. Google Analytics).
46  </span>
47  </div>
48  <p>
49  This privacy policy sets out how this website (hereafter "the Store") uses and protects any information that
50  you give the Store while using this website. The Store is committed to ensuring that your privacy is protected.
51  Should we ask you to provide certain information by which you can be identified when using this website, then
52  you can be assured that it will only be used in accordance with this privacy statement. The Store may change
53  this policy from time to time by updating this page. You should check this page from time to time to ensure
54  that you are happy with any changes.
55  </p>
56  <h2>What we collect</h2>
57  <p>We may collect the following information:</p>
58  <ul>
59  <li>name</li>
60  <li>contact information including email address</li>
61  <li>demographic information such as postcode, preferences and interests</li>
62  <li>other information relevant to customer surveys and/or offers</li>
63  </ul>
64  <p>
65  For the exhaustive list of cookies we collect see the <a href="#list">List of cookies we collect</a> section.
66  </p>
67  <h2>What we do with the information we gather</h2>
68  <p>
69  We require this information to understand your needs and provide you with a better service,
70  and in particular for the following reasons:
71  </p>
72  <ul>
73  <li>Internal record keeping.</li>
74  <li>We may use the information to improve our products and services.</li>
75  <li>
76  We may periodically send promotional emails about new products, special offers or other information which we
77  think you may find interesting using the email address which you have provided.
78  </li>
79  <li>
80  From time to time, we may also use your information to contact you for market research purposes.
81  We may contact you by email, phone, fax or mail. We may use the information to customise the website
82  according to your interests.
83  </li>
84  </ul>
85  <h2>Security</h2>
86  <p>
87  We are committed to ensuring that your information is secure. In order to prevent unauthorised access or
88  disclosure, we have put in place suitable physical, electronic and managerial procedures to safeguard and
89  secure the information we collect online.
90  </p>
91  <h2>How we use cookies</h2>
92  <p>
93  A cookie is a small file which asks permission to be placed on your computer's hard drive.
94  Once you agree, the file is added and the cookie helps analyse web traffic or lets you know when you visit
95  a particular site. Cookies allow web applications to respond to you as an individual. The web application
96  can tailor its operations to your needs, likes and dislikes by gathering and remembering information about
97  your preferences.
98  </p>
99  <p>
100  We use traffic log cookies to identify which pages are being used. This helps us analyse data about web page
101  traffic and improve our website in order to tailor it to customer needs. We only use this information for
102  statistical analysis purposes and then the data is removed from the system.
103  </p>
104  <p>
105  Overall, cookies help us provide you with a better website, by enabling us to monitor which pages you find
106  useful and which you do not. A cookie in no way gives us access to your computer or any information about you,
107  other than the data you choose to share with us. You can choose to accept or decline cookies.
108  Most web browsers automatically accept cookies, but you can usually modify your browser setting
109  to decline cookies if you prefer. This may prevent you from taking full advantage of the website.
110  </p>
111  <h2>Links to other websites</h2>
112  <p>
113  Our website may contain links to other websites of interest. However, once you have used these links
114  to leave our site, you should note that we do not have any control over that other website.
115  Therefore, we cannot be responsible for the protection and privacy of any information which you provide whilst
116  visiting such sites and such sites are not governed by this privacy statement.
117  You should exercise caution and look at the privacy statement applicable to the website in question.
118  </p>
119  <h2>Controlling your personal information</h2>
120  <p>You may choose to restrict the collection or use of your personal information in the following ways:</p>
121  <ul>
122  <li>
123  whenever you are asked to fill in a form on the website, look for the box that you can click to indicate
124  that you do not want the information to be used by anybody for direct marketing purposes
125  </li>
126  <li>
127  if you have previously agreed to us using your personal information for direct marketing purposes,
128  you may change your mind at any time by letting us know using our Contact Us information
129  </li>
130  </ul>
131  <p>
132  We will not sell, distribute or lease your personal information to third parties unless we have your permission
133  or are required by law to do so. We may use your personal information to send you promotional information
134  about third parties which we think you may find interesting if you tell us that you wish this to happen.
135  </p>
136  <p>
137  You may request details of personal information which we hold about you under the Data Protection Act 1998.
138  A small fee will be payable. If you would like a copy of the information held on you please email us this
139  request using our Contact Us information.
140  </p>
141  <p>
142  If you believe that any information we are holding on you is incorrect or incomplete,
143  please write to or email us as soon as possible, at the above address.
144  We will promptly correct any information found to be incorrect.
145  </p>
146  <h2><a name="list"></a>List of cookies we collect</h2>
147  <p>The table below lists the cookies we collect and what information they store.</p>
148  <table class="data-table data-table-definition-list">
149  <thead>
150  <tr>
151  <th>Cookie Name</th>
152  <th>Cookie Description</th>
153  </tr>
154  </thead>
155  <tbody>
156  <tr>
157  <th>FORM_KEY</th>
158  <td>Stores randomly generated key used to prevent forged requests.</td>
159  </tr>
160  <tr>
161  <th>PHPSESSID</th>
162  <td>Your session ID on the server.</td>
163  </tr>
164  <tr>
165  <th>GUEST-VIEW</th>
166  <td>Allows guests to view and edit their orders.</td>
167  </tr>
168  <tr>
169  <th>PERSISTENT_SHOPPING_CART</th>
170  <td>A link to information about your cart and viewing history, if you have asked for this.</td>
171  </tr>
172  <tr>
173  <th>STF</th>
174  <td>Information on products you have emailed to friends.</td>
175  </tr>
176  <tr>
177  <th>STORE</th>
178  <td>The store view or language you have selected.</td>
179  </tr>
180  <tr>
181  <th>USER_ALLOWED_SAVE_COOKIE</th>
182  <td>Indicates whether a customer allowed to use cookies.</td>
183  </tr>
184  <tr>
185  <th>MAGE-CACHE-SESSID</th>
186  <td>Facilitates caching of content on the browser to make pages load faster.</td>
187  </tr>
188  <tr>
189  <th>MAGE-CACHE-STORAGE</th>
190  <td>Facilitates caching of content on the browser to make pages load faster.</td>
191  </tr>
192  <tr>
193  <th>MAGE-CACHE-STORAGE-SECTION-INVALIDATION</th>
194  <td>Facilitates caching of content on the browser to make pages load faster.</td>
195  </tr>
196  <tr>
197  <th>MAGE-CACHE-TIMEOUT</th>
198  <td>Facilitates caching of content on the browser to make pages load faster.</td>
199  </tr>
200  <tr>
201  <th>SECTION-DATA-IDS</th>
202  <td>Facilitates caching of content on the browser to make pages load faster.</td>
203  </tr>
204  <tr>
205  <th>PRIVATE_CONTENT_VERSION</th>
206  <td>Facilitates caching of content on the browser to make pages load faster.</td>
207  </tr>
208  <tr>
209  <th>X-MAGENTO-VARY</th>
210  <td>Facilitates caching of content on the server to make pages load faster.</td>
211  </tr>
212  <tr>
213  <th>MAGE-TRANSLATION-FILE-VERSION</th>
214  <td>Facilitates translation of content to other languages.</td>
215  </tr>
216  <tr>
217  <th>MAGE-TRANSLATION-STORAGE</th>
218  <td>Facilitates translation of content to other languages.</td>
219  </tr>
220  </tbody>
221  </table>
222 </div>
223 EOD;
224  $privacyAndCookiePolicyPage = $this->createPage()->load(
225  'privacy-policy-cookie-restriction-mode',
226  'identifier'
227  );
228  $privacyAndCookiePolicyPageId = $privacyAndCookiePolicyPage->getId();
229  if ($privacyAndCookiePolicyPageId) {
230  $privacyAndCookiePolicyPage->setContent($newPageContent);
231  $privacyAndCookiePolicyPage->save();
232  }
233  }
234 
238  public static function getDependencies()
239  {
240  return [
241  CreateDefaultPages::class,
242  ];
243  }
244 
248  public static function getVersion()
249  {
250  return '2.0.1';
251  }
252 
256  public function getAliases()
257  {
258  return [];
259  }
260 
266  private function createPage()
267  {
268  return $this->pageFactory->create();
269  }
270 }
taxRateField find('.mselect-list') .on( 'click.mselect-edit'
Definition: edit.phtml:162
EOD
Definition: website.php:20
taxRateField this edit on("click.mselect-delete", ".mselect-delete", function() { if(!confirm('<?=/*@escapeNotVerified */__( 'Do you really want to delete this tax rate?') ?>')) { return;} var that=$(this), select=that.closest('.mselect-list').prev(), rateValue=that.parent().find( 'input[type="checkbox"]').val();$( 'body').trigger( 'processStart');var ajaxOptions={ type:'POST', data:{ tax_calculation_rate_id:rateValue, form_key:$( 'input[name="form_key"]').val() }, dataType:'json', url:'<?=/*@escapeNotVerified */$block->getTaxRateDeleteUrl() ?>', success:function(result, status) { $( 'body').trigger( 'processStop');if(result.success) { that.parent().remove();select.find( 'option').each(function() { if(this.value===rateValue) { $(this).remove();} });select.trigger( 'change.hiddenSelect');} else { if(result.error_message) alert({ content:result.error_message });else alert({ content:'<?=/*@escapeNotVerified */__( 'An error occurred') ?>' });} }, error:function() { $( 'body').trigger( 'processStop');alert({ content:'<?=/*@escapeNotVerified */__( 'An error occurred') ?>' });} };$.ajax(ajaxOptions);}) .on( 'click.mselectAdd'
Definition: edit.phtml:164