Drupal Development https://michalak.world/ en Drupal 8 - Sending Faxes with Twilio https://michalak.world/article/drupal-8-sending-faxes-twilio <span>Drupal 8 - Sending Faxes with Twilio</span> <span><span>useradmin</span></span> <span>Sun, 12/06/2020 - 08:53</span> <div class="primary-image field field--name-field-image field--type-image field--label-above"> <div class="field__label">Image</div> <div class="field__item"> <img loading="lazy" src="/sites/default/files/default_images/cover.png" width="2010" height="1343" alt="Default blog post image" title="Default blog post image" /> </div> </div> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div class="field__item"><p><br /> Yep, you read the title correctly and it says “fax.”  Faxes are still used more than I thought, and it is really cool that Twilio has an API to send and receive faxes that is quite easy to use.</p> <p>Today in this post I will be talking about sending faxes from your Drupal website.  Which is quite easy and doesn’t take much code to achieve.</p> <p>I have pulled together a code example from the Twilio API documents and as you can see below there isn’t much there.</p> <p><code>use Twilio\Rest\Client; </code></p> <p><code>$twilio = new Client($sid, $token);<br /> $to = “+1234567890”;<br /> $from = “+0987654321”;<br /> $document = “https://example.com/document.pdf”;<br /><br /> $response = twilio-&gt;fax-&gt;v1-&gt;faxes-&gt;create($to, $document,["from" =&gt; $from]); </code></p> <p>A couple of notes on the Twilio fax API:</p> <ul><li>There isn’t much of a response back which can make error handling or logging a little difficult.</li> <li>The document being faxed must be a PDF.</li> </ul><p><br /> Resources:</p> <ul><li>Twilio: <a href="https://www.twilio.com/fax">https://www.twilio.com/fax</a></li> </ul></div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comments</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=83&amp;2=comment&amp;3=comment" token="LI5W_Ja-CIpAVq29BYN0CHhRaUFC8TFuAew8fUEGPNY"></drupal-render-placeholder> </div> </div> </section> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--tags"> <h3 class="field__label field--tags__label">Tags</h3> <ul class="links field__items field--tags__items"> <li class="field--tags__item"><div> <h2><a href="/tag/api"> <div class="field field--name-name field--type-string field--label-hidden field__item">API</div> </a></h2> <div class="text-content clearfix field field--name-description field--type-text-long field--label-hidden field__item"><p>API</p></div> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-7"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal 7</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-8"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal 8</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-development"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal Development</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/integration"> <div class="field field--name-name field--type-string field--label-hidden field__item">Integration</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/rest-api"> <div class="field field--name-name field--type-string field--label-hidden field__item">REST API</div> </a></h2> </div> </li> </ul> </div> Sun, 06 Dec 2020 14:53:29 +0000 useradmin 83 at https://michalak.world iPhone Screen Sizes and Media Queries https://michalak.world/article/iphone-screen-sizes-and-media-queries <span>iPhone Screen Sizes and Media Queries </span> <span><span>useradmin</span></span> <span>Thu, 08/29/2019 - 07:08</span> <div class="primary-image field field--name-field-image field--type-image field--label-above"> <div class="field__label">Image</div> <div class="field__item"> <img loading="lazy" src="/sites/default/files/2019-08/iphone.jpg" width="5585" height="3729" alt="iphone" title="iPhone" /> </div> </div> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div class="field__item"><p>When styling mobile-friendly pages I have run into issues between the different iPhone X versions.  Also included: iPhone 7 and 8.</p> <h2><strong>iPhone XR</strong></h2> <pre> /* 1792x828px at 326ppi */ @media only screen and (device-width : 414px) and (device-height : 896px) and (-webkit-device-pixel-ratio : 2) { } </pre> <h2><strong>iPhone X</strong></h2> <pre> /* 2436x1125px at 458ppi */ @media only screen and (device-width : 375px) and (device-height : 812px) and (-webkit-device-pixel-ratio : 3) { }</pre> <h2><strong>iPhone Xs</strong></h2> <pre> /* 2688x1242px at 458ppi */ @media only screen and (device-width : 414px) and (device-height : 896px) and (-webkit-device-pixel-ratio : 3) { } </pre> <h2><strong>iPhone 7+/8+</strong></h2> <pre> /* iphone 6+, 6s+, 7+, 8+ */ @media only screen and (min-device-width: 414px) and (max-device-height: 736px) and (-webkit-device-pixel-ratio: 3) { } </pre> <h2><strong>iPhone 7/8</strong></h2> <pre> /* iphone 6, 6s, 7, 8 */ @media only screen and (min-device-width: 375px) and (max-device-height: 667px) and (-webkit-device-pixel-ratio: 2) { } </pre> <h2><strong>Resources:</strong></h2> <ul><li><a href="https://developer.apple.com/library/archive/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/Displays/Displays.html">Apple</a> - Developer Archive</li> <li><a href="https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/adaptivity-and-layout">Apple Developer iOS Interface Guidelines</a></li> <li><a href="https://stackoverflow.com/questions/52321212/iphone-xr-xs-xs-max-css-media-queries">Stack Overflow: iPhone XR / XS / XS Max CSS media queries</a></li> <li><a href="https://stackoverflow.com/questions/46313640/iphone-x-8-8-plus-css-media-queries#46313641">Stack Overflow: All iPhones</a></li> <li><a href="https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions">Ultimate Guide to iPhone Resolutions</a></li> </ul><p> </p> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comments</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=78&amp;2=comment&amp;3=comment" token="gqdxo0DEdyaM5ZCiBBKz75MOrJGBO3oR7mBgIKBWJtY"></drupal-render-placeholder> </div> </div> </section> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--tags"> <h3 class="field__label field--tags__label">Tags</h3> <ul class="links field__items field--tags__items"> <li class="field--tags__item"><div> <h2><a href="/tag/drupal"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-7"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal 7</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-8"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal 8</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-development"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal Development</div> </a></h2> </div> </li> </ul> </div> Thu, 29 Aug 2019 12:08:33 +0000 useradmin 78 at https://michalak.world PDF Generation in Drupal https://michalak.world/article/pdf-generation-drupal <span>PDF Generation in Drupal</span> <span><span>useradmin</span></span> <span>Wed, 08/21/2019 - 14:52</span> <div class="primary-image field field--name-field-image field--type-image field--label-above"> <div class="field__label">Image</div> <div class="field__item"> <img loading="lazy" src="/sites/default/files/2019-08/pdf-generate_0.jpg" width="3888" height="2592" alt="pdf generation" title="PDF Generate" /> </div> </div> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div class="field__item"><p>It is nice when a user can click a button and generate a PDF. Over the last few months, I have added PDF generation to many projects. Examples of PDF generation include order invoices, sell sheets, webform submission results, and general node to PDF generation. </p> <p>When tasked at generating PDFs, I have been applying the <a href="https://github.com/dompdf/dompdf">dompdf</a><a href="https://github.com/dompdf/dompdf"> library</a>. The dompdf library implements the most versatility by using HTML and CSS to generate PDFs.  Therefore, giving the most flexibility for custom theming.  </p> <h2><strong>Example 1</strong></h2> <p>The most recent PDF generation task I completed was for Drupal commerce order invoices.  I leveraged twig templates to provide as much flexibility as possible, which allowed me to incorporate a special entity view mode and for additional block regions.  The new entity view display allows website admins to add, remove or rearrange order fields, and the additional block regions allowed for adding additional blocks throughout the template.  The flexibility of the Drupal interface not only provides a way for website admins to generate order invoices but also allows them to modify the layouts of the PDF invoice.</p> <h2><strong>Example 2</strong></h2> <p>In a past Drupal 8 commerce project, I have also automated the process to generate picket tickets upon orders reaching a specific state in the commerce order workflow. </p> <p>The dompdf library has been enjoyable and straightforward to use and I intend to use this library for future PDF generation projects.</p></div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comments</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=77&amp;2=comment&amp;3=comment" token="Qzb37j7VqLlKUKgiGSHsGIdM5xh3GhwoL_4P668Docs"></drupal-render-placeholder> </div> </div> </section> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--tags"> <h3 class="field__label field--tags__label">Tags</h3> <ul class="links field__items field--tags__items"> <li class="field--tags__item"><div> <h2><a href="/tag/drupal"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-7"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal 7</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-8"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal 8</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-commerce"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal Commerce</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-development"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal Development</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-performance"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal Performance</div> </a></h2> </div> </li> </ul> </div> Wed, 21 Aug 2019 19:52:30 +0000 useradmin 77 at https://michalak.world Pantheon - Cloning a Project https://michalak.world/article/pantheon-cloning-project <span>Pantheon - Cloning a Project</span> <span><span>useradmin</span></span> <span>Wed, 08/07/2019 - 12:54</span> <div class="primary-image field field--name-field-image field--type-image field--label-above"> <div class="field__label">Image</div> <div class="field__item"> <img loading="lazy" src="/sites/default/files/default_images/cover.png" width="2010" height="1343" alt="Default blog post image" title="Default blog post image" /> </div> </div> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div class="field__item"><p>If you need to clone a project within the Pantheon ecosystem Terminus is a great tool to use.</p> <p>First, <a href="https://pantheon.io/docs/terminus/install">install Terminus</a> and then add the <a href="https://github.com/pantheon-systems/terminus-site-clone-plugin">site clone plugin</a>.</p> <p>After authenticating with terminus use the site:clone command</p> <pre> terminus site:clone &lt;source&gt;.&lt;env&gt; &lt;destination&gt;.&lt;env&gt;</pre> <p>&lt;source&gt; and &lt;destination&gt; are either the site names or the site UUIDs.  &lt;env&gt; is the environment, e.g. dev, test, prod or multi dev.</p> <p><strong>Resources</strong></p> <ul><li>I<a href="https://pantheon.io/docs/terminus/install">nstall Terminus</a></li> <li><a href="https://github.com/pantheon-systems/terminus-site-clone-plugin">Terminus's Site Clone Plugin</a></li> <li><a href="https://pantheon.io/docs/terminus">Terminus Documentation</a></li> <li><a href="https://pantheon.io/docs/migrate">Pantheon Migration Documentation</a></li> </ul><p> </p> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comments</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=76&amp;2=comment&amp;3=comment" token="sJ_UIyQ90zvYFCIevMbx_95Z7pdNofcckWbJLUB-ZJY"></drupal-render-placeholder> </div> </div> </section> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--tags"> <h3 class="field__label field--tags__label">Tags</h3> <ul class="links field__items field--tags__items"> <li class="field--tags__item"><div> <h2><a href="/tag/api"> <div class="field field--name-name field--type-string field--label-hidden field__item">API</div> </a></h2> <div class="text-content clearfix field field--name-description field--type-text-long field--label-hidden field__item"><p>API</p></div> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-7"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal 7</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-8"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal 8</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-commerce"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal Commerce</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-development"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal Development</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/update"> <div class="field field--name-name field--type-string field--label-hidden field__item">Update</div> </a></h2> </div> </li> </ul> </div> Wed, 07 Aug 2019 17:54:57 +0000 useradmin 76 at https://michalak.world Compromised Drupal 7 Website Recovery Review https://michalak.world/article/compromised-drupal-7-website-recovery-review <span>Compromised Drupal 7 Website Recovery Review</span> <span><span>useradmin</span></span> <span>Wed, 07/31/2019 - 06:06</span> <div class="primary-image field field--name-field-image field--type-image field--label-above"> <div class="field__label">Image</div> <div class="field__item"> <img loading="lazy" src="/sites/default/files/2019-07/hacked.jpg" width="8000" height="4500" alt="ghost" title="hacked" /> </div> </div> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div class="field__item"><p>I was brought on board to help recover a website that was possibly exploited by hackers, a Drupal 7 project.  What triggered the investigation?  My client was informed that their customers were receiving spam emails from the website.</p> <p>After a thorough review of the project's code base and database. I found multiple exploits and backdoors.  All of the issues/exploits were within the Drupal core.  None of the contrib. or custom modules were exploited.  </p> <p>What was the cause? The website was compromised due to an outdated Drupal 7 core.  With routine updates, this would have not happened.  That is why it is important to keep up with website maintenance and security updates.</p></div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comments</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=75&amp;2=comment&amp;3=comment" token="N348bnV5IYcEoBzW9Gg6NCKW95PWcocUuhX4iLVyV3g"></drupal-render-placeholder> </div> </div> </section> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--tags"> <h3 class="field__label field--tags__label">Tags</h3> <ul class="links field__items field--tags__items"> <li class="field--tags__item"><div> <h2><a href="/tag/drupal"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-7"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal 7</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-development"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal Development</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/security"> <div class="field field--name-name field--type-string field--label-hidden field__item">Security</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/update"> <div class="field field--name-name field--type-string field--label-hidden field__item">Update</div> </a></h2> </div> </li> </ul> </div> Wed, 31 Jul 2019 11:06:12 +0000 useradmin 75 at https://michalak.world Drupal 8 Commerce Tax Resolvers https://michalak.world/article/drupal-8-commerce-tax <span>Drupal 8 Commerce Tax Resolvers</span> <span><span>useradmin</span></span> <span>Wed, 07/31/2019 - 05:54</span> <div class="primary-image field field--name-field-image field--type-image field--label-above"> <div class="field__label">Image</div> <div class="field__item"> <img loading="lazy" src="/sites/default/files/2019-07/tax_0.jpg" width="5637" height="3758" alt="Tax" title="Tax" /> </div> </div> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div class="field__item"><p>In Drupal 7 it was easy to create new tax configurations using rules.  Now in Drupal 8, it is a little bit more complicated but even more flexible. At the moment there isn't a GUI to configure taxes past setting up a simple Sales or VAT per location.   That is where Drupal 8 commerce tax resolvers come in.</p> <p>Drupal Commerce's tax resolvers make it easy for setting up custom tax rules based upon your criteria. Recently I set up two new types of tax resolvers.  The new tax resolvers allow for a user to be tax-exempt and also taxed based upon the cost of each line item.</p> <h2><strong>Tax-Exempt</strong></h2> <p>The tax-exempt tax resolver I implemented basically allows an authenticated user bypass taxes.  This was done with a setting up a special type of role and allows the admin to grant tax exemptions to users.  Once the role is setup then the tax resolver takes over at checkout. </p> <h2><strong>Line Item Tax</strong></h2> <p>The line item tax resolver was needed to provide a tax on line items after a certain amount threshold was met for that line item.  E.g. if a user was purchasing $90 a line item they would not be taxed but if they spent $100 or more then tax would need to be applied to that line item.    </p> <p>Each custom tax resolver is currency independent and can be applied to either sales tax or VAT tax if needed.  Both of these are simple implementations and can be expanded upon in the future.  </p> <p>Thanks for reading!  Let me know if you have any questions.  Please leave a comment below!</p></div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comments</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=74&amp;2=comment&amp;3=comment" token="k2nAa9zPaZJ1YXSx-274dYF8rYf7l1SyAeJZIsk5bGc"></drupal-render-placeholder> </div> </div> </section> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--tags"> <h3 class="field__label field--tags__label">Tags</h3> <ul class="links field__items field--tags__items"> <li class="field--tags__item"><div> <h2><a href="/tag/commerce-tax"> <div class="field field--name-name field--type-string field--label-hidden field__item">Commerce Tax</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-8"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal 8</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-commerce"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal Commerce</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-development"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal Development</div> </a></h2> </div> </li> </ul> </div> Wed, 31 Jul 2019 10:54:45 +0000 useradmin 74 at https://michalak.world Drupal 8 Commerce Promotions - Buy X or more of the same product and get % off that order item https://michalak.world/article/drupal-8-commerce-promotions-buy-x-or-more-same-product-and-get-order-item <span>Drupal 8 Commerce Promotions - Buy X or more of the same product and get % off that order item</span> <span><span>useradmin</span></span> <span>Wed, 07/31/2019 - 05:21</span> <div class="primary-image field field--name-field-image field--type-image field--label-above"> <div class="field__label">Image</div> <div class="field__item"> <img loading="lazy" src="/sites/default/files/2019-07/promotions.jpg" width="4053" height="2697" alt="Drupal coupon Drupal promotions" title="Girl with phone and coupon" /> </div> </div> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div class="field__item"><p>Currently "Buy X and Get Y" discount is only related to the whole order and not at the order item level. </p> <p>I needed order item level discounts. e.g. buy 10 or more of the same product and get 10% off that order item. </p> <p>The new promotion will only discount at the order item level for order items with a quantity of 10 or more.</p> <p>Example - Buy 10 or more and get a 10% discount.<br /> Order Item 1 - Quantity of 5 - No Discount<br /> Order Item 2 - Quantity of 11 - 10% off discount<br /> Order item 3 - Quantity of 10 - 10% off discount<br /> Order Item 4 - Quantity of 1 - No Discount</p> <p>I have created a patch for this type of discount. The discount is labeled: "Buy X per order item get a percentage off." The new promotion only allows only for a percentage off discount and does not include a fixed amount discount. </p> <p>Drupal Commerce Issue Queue: https://www.drupal.org/project/commerce/issues/3066724</p></div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comments</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=73&amp;2=comment&amp;3=comment" token="7FycrUQswYBd0O_Ooie4CmmRDBiCYg9EsoCa7NQwC44"></drupal-render-placeholder> </div> </div> </section> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--tags"> <h3 class="field__label field--tags__label">Tags</h3> <ul class="links field__items field--tags__items"> <li class="field--tags__item"><div> <h2><a href="/tag/commerce-promo"> <div class="field field--name-name field--type-string field--label-hidden field__item">Commerce Promo</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-8"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal 8</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-commerce"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal Commerce</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-development"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal Development</div> </a></h2> </div> </li> </ul> </div> Wed, 31 Jul 2019 10:21:21 +0000 useradmin 73 at https://michalak.world Drupal 8 Commerce - Setting a Default Currency on Product Variations https://michalak.world/article/drupal-8-commerce-setting-default-currency-product-variations <span>Drupal 8 Commerce - Setting a Default Currency on Product Variations</span> <span><span>useradmin</span></span> <span>Wed, 05/08/2019 - 06:13</span> <div class="primary-image field field--name-field-image field--type-image field--label-above"> <div class="field__label">Image</div> <div class="field__item"> <img loading="lazy" src="/sites/default/files/default_images/cover.png" width="2010" height="1343" alt="Default blog post image" title="Default blog post image" /> </div> </div> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div class="field__item"><p>By default Drupal 8 commerce 2.x product variations do not have a default currency setting for multi-currency projects.  </p> <p>Currently, there is a patch in the works to solve this issue.  The patch can be found in the commerce issue queue: <a href="https://www.drupal.org/project/commerce/issues/3016777">https://www.drupal.org/project/commerce/issues/3016777</a></p> <p>Thank you a.dmitriiev for creating a patch to solve this issue!</p></div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comments</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=71&amp;2=comment&amp;3=comment" token="G5ShwSxymiQjhwboVPPPD3c_EjNM6JxcEGuGL63s568"></drupal-render-placeholder> </div> </div> </section> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--tags"> <h3 class="field__label field--tags__label">Tags</h3> <ul class="links field__items field--tags__items"> <li class="field--tags__item"><div> <h2><a href="/tag/drupal"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-8"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal 8</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-commerce"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal Commerce</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-development"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal Development</div> </a></h2> </div> </li> </ul> </div> Wed, 08 May 2019 11:13:50 +0000 useradmin 71 at https://michalak.world Drupal: Pantheon Cookies https://michalak.world/article/drupal-pantheon-cookies <span>Drupal: Pantheon Cookies</span> <span><span>useradmin</span></span> <span>Fri, 05/03/2019 - 08:11</span> <div class="primary-image field field--name-field-image field--type-image field--label-above"> <div class="field__label">Image</div> <div class="field__item"> <img loading="lazy" src="/sites/default/files/default_images/cover.png" width="2010" height="1343" alt="Default blog post image" title="Default blog post image" /> </div> </div> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div class="field__item"><p>I've been using the commerce_currency_resolver module and it has been fantastic to use.   One issue I ran into was with how the cookies are handled on Pantheon.</p> <p>When using custom cookies a special naming convention must be used.  The cookie's name must start with <em><code>STYXKEY.</code></em></p> <p>Per Pantheon: </p> <blockquote> <p>Respond to a request with cached content depending on the presence and value of a particular cookie. It's important to note that in order for the response to be cached by Pantheon's edge, the cookie name must match <code>STYXKEY[a-zA-Z0-9_-]+</code>.</p> </blockquote> <p>Pantheon Documentation: <a href="https://pantheon.io/docs/cookies/">https://pantheon.io/docs/cookies/</a></p></div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comments</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=70&amp;2=comment&amp;3=comment" token="lVr2me8sBkS-nqUIwncjF3mVjqLfFPdES9CWk_dZWLs"></drupal-render-placeholder> </div> </div> </section> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--tags"> <h3 class="field__label field--tags__label">Tags</h3> <ul class="links field__items field--tags__items"> <li class="field--tags__item"><div> <h2><a href="/tag/drupal"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-7"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal 7</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-8"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal 8</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-commerce"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal Commerce</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-development"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal Development</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-performance"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal Performance</div> </a></h2> </div> </li> </ul> </div> Fri, 03 May 2019 13:11:38 +0000 useradmin 70 at https://michalak.world Drupal 8 Configuration Synchronization https://michalak.world/article/drupal-8-configuration-synchronization <span>Drupal 8 Configuration Synchronization </span> <span><span>useradmin</span></span> <span>Mon, 04/29/2019 - 07:20</span> <div class="primary-image field field--name-field-image field--type-image field--label-above"> <div class="field__label">Image</div> <div class="field__item"> <img loading="lazy" src="/sites/default/files/default_images/cover.png" width="2010" height="1343" alt="Default blog post image" title="Default blog post image" /> </div> </div> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div class="field__item"><h2>Configuration Synchronization</h2> <p>Drupal 8 has a really great configuration synchronization system, and is great for syncing up different environments.  When creating new modules and adding new fuctionality I really enjoy working with Drupal 8's configuration synchronization tool.  Not only does this tool take the guesswork out of updates that need to be made on other environments.  The configuration synchronization also allows for all changes to be documented.  </p> <h2>New Modules and New Functionality</h2> <p>The Drupal 8 content synchronization tool paired with Drupal 8's update hooks are great ways to make all of the new changes portable and documented.  I have adopted this methodology when moving out changes from environment to environment.  Pairing this methodology with a deployment guide and taking out all of the guesswork of what needs to be updated.</p> <h2>Uses for Configuration Synchronization </h2> <p>Types of changes that Drupal 8's configuration synchronization tool are good for: </p> <ul><li>Block Configuration</li> <li>New Content Types</li> <li>Updating Content Types</li> <li>Adding New Fields to Entities</li> <li>Adding or Updating Views</li> <li>Etc.</li> </ul><h2>Conclusion</h2> <p>But I also have a love-hate relationship.  When an installation of a modules gets conflicted with the synchronization then there are headaches, but overall the configuration synchronization is really great.  Once they are worked through then all the headaches are eliminated, usually, just need to rework the install() and uninstall() hooks for the module.</p></div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comments</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=69&amp;2=comment&amp;3=comment" token="IQxni0p78o9ZSEWkihFEC7fFRbIcXcDos4BQLuUqJuM"></drupal-render-placeholder> </div> </div> </section> <div class="field field--name-field-tags field--type-entity-reference field--label-above field--tags"> <h3 class="field__label field--tags__label">Tags</h3> <ul class="links field__items field--tags__items"> <li class="field--tags__item"><div> <h2><a href="/tag/api"> <div class="field field--name-name field--type-string field--label-hidden field__item">API</div> </a></h2> <div class="text-content clearfix field field--name-description field--type-text-long field--label-hidden field__item"><p>API</p></div> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/composer"> <div class="field field--name-name field--type-string field--label-hidden field__item">Composer</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-8"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal 8</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-commerce"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal Commerce</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drupal-development"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal Development</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/update"> <div class="field field--name-name field--type-string field--label-hidden field__item">Update</div> </a></h2> </div> </li> </ul> </div> Mon, 29 Apr 2019 12:20:19 +0000 useradmin 69 at https://michalak.world