Skip to content

Instantly share code, notes, and snippets.

View bdmason's full-sized avatar

Ben Mason bdmason

  • Watt Mason Ltd
  • Melbourne, UK
View GitHub Profile
@bdmason
bdmason / using-sage-9-blade-templates-for-woocommerce.md
Last active October 26, 2022 10:48
Using Sage 9 blade templates for WooCommerce

Using Sage 9 blade templates for WooCommerce

Declare WooCommerce theme support

Open app/setup.php, find the after_setup_theme action and put add_theme_support('woocommerce'); inside the function.

Override the plugin templates

Add the templates you want to override in resources/woocommerce:

theme    
│
@bdmason
bdmason / removing-w3c-validation-errors-caused-by-using-lozadjs-in-sage-9.md
Created July 26, 2018 17:02
Removing W3C validation errors caused by using lozadjs in sage 9

Removing W3C validation errors caused by using lozadjs in sage 9

important The advice in this gist will increase the size of the documents you send to the browser (ever so slightly), so technically it's bad for performance. However, if for any reason you want to achieve zero W3C validation errors when using lozad.js in Roots/sage you can follow the instructions below.

Create a reusable (transparent and very small) base 64 encoded image

Open app/controllers/app.php and add the following to the class:

public static function fakeImg()
{
  return 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
}