Drupal 8 https://michalak.world/ en Drupal 9 Patch htaccess with Composer https://michalak.world/article/drupal-9-patch-htaccess-composer <span>Drupal 9 Patch htaccess with Composer</span> <span><span>useradmin</span></span> <span>Thu, 09/21/2023 - 12:28</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>In composer.json add to the scripts section. See below:</p> <pre> "scripts": { "pre-install-cmd": [],   ... "post-drupal-scaffold-cmd": [ "patch -p1 &lt; patches/my-htaccess.patch" ] }, </pre> </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=91&amp;2=comment&amp;3=comment" token="YwgHS-LCDb_Q9b7iBwPzs1DFMKlXOZP2gM97Z2nh3X8"></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/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/configuration"> <div class="field field--name-name field--type-string field--label-hidden field__item">Configuration</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-9"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal 9</div> </a></h2> </div> </li> </ul> </div> Thu, 21 Sep 2023 17:28:07 +0000 useradmin 91 at https://michalak.world Update UUID in a Drupal Configuration https://michalak.world/article/update-uuid-drupal-configuration <span>Update UUID in a Drupal Configuration</span> <span><span>useradmin</span></span> <span>Thu, 08/03/2023 - 08: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/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><strong>Update a UUID: </strong></p> <p><code>drush config-set "config.name" uuid "</code>a2afbb3b-d34f-42fd-bf0c-593a103aa6f4<code>"</code></p> <p><strong>Also how to generate an new UUID:</strong></p> <p><code>drush php-eval "echo \Drupal::service('uuid')-&gt;generate();"</code></p> <p><strong>Notes:</strong></p> <ul><li>Remember to back up your database first!</li> <li>Check your config:  <ul><li><code>drush config-get "config.name" uuid</code></li> </ul></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=85&amp;2=comment&amp;3=comment" token="ufXfbn79uHOSWXxHGxLsZ5_R_iaIuBW6NTVHF2mTWsc"></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-10"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal 10</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-9"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drupal 9</div> </a></h2> </div> </li> <li class="field--tags__item"><div> <h2><a href="/tag/drush"> <div class="field field--name-name field--type-string field--label-hidden field__item">Drush</div> </a></h2> </div> </li> </ul> </div> Thu, 03 Aug 2023 13:21:14 +0000 useradmin 85 at https://michalak.world 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 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 https://michalak.world/article/drupal-8-commerce-tax#comments 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 - Longer Titles - Entity Title Length/Node Title Length https://michalak.world/article/drupal-8-longer-titles-entity-title-lengthnode-title-length <span>Drupal 8 - Longer Titles - Entity Title Length/Node Title Length</span> <span><span>useradmin</span></span> <span>Thu, 07/11/2019 - 05:48</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/Title_0.jpg" width="4928" height="3264" alt="Titles" title="Titles" /> </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 created this post to have a quick overview of the two different Drupal 8 modules that extend the default node title length.  There are currently two modules: Node Title Length and Entity Title Length.  </p> <p>Both modules are easy to set up and both have a very minimal configuration.   I do recommend the Node Title Length module due to being in a stable and released state.</p> <h2><strong>Node Title Length [Recommended]</strong></h2> <ul><li> <p>Module: <a href="https://www.drupal.org/project/title_length">https://www.drupal.org/project/title_length</a></p> </li> <li> <p>Admin: No admin configuration, defaults to 8000 which can be updated before installing in the module code.</p> </li> <li> <p>Official Release: Yes</p> </li> </ul><p><strong>How to set up and configure: </strong></p> <ol><li> <p>Enable the module</p> </li> <li> <p>All set! Nothing else needed to do.</p> </li> </ol><h2><strong>Entity Title Length</strong></h2> <ul><li> <p>Module: <a href="https://www.drupal.org/project/entity_title_length">https://www.drupal.org/project/entity_title_length</a></p> </li> <li> <p>Admin Configuration: /admin/etl/config</p> </li> <li> <p>Official Release: No</p> </li> </ul><h3><strong>How to set up and configure:</strong></h3> <ol><li> <p>Enable the module</p> </li> <li> <p>Update the configuration in the admin section: /admin/etl/config</p> </li> <li> <p>Update the title on the form display configuration for that entity/node to the desired new length</p> </li> </ol></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=72&amp;2=comment&amp;3=comment" token="_qlVZpTyMz0d7hHUCADXnSk-Q1OExZ3ckFxk0CC5wU8"></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> </ul> </div> Thu, 11 Jul 2019 10:48:04 +0000 useradmin 72 at https://michalak.world https://michalak.world/article/drupal-8-longer-titles-entity-title-lengthnode-title-length#comments 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 https://michalak.world/article/drupal-8-commerce-setting-default-currency-product-variations#comments