Coder Social home page Coder Social logo

sage-woocommerce-support's Introduction

Sage Woocommerce Support

Add Woocommerce blade template and controllers support for Sage 9 based themes.

Installation

Run inside theme directory.

composer require kimhf/sage-woocommerce-support

Requirements

PHP 7.1 or above

Usage

Example: To override the template plugins/woocommerce/templates/single-product.php create themes/yoursagetheme/resources/views/single-product.blade.php or themes/yoursagetheme/resources/views/woocommerce/single-product.blade.php

Example: To override the partial plugins/woocommerce/templates/content-product.php create themes/yoursagetheme/resources/views/partials/content-product.blade.php or themes/yoursagetheme/resources/views/woocommerce/content-product.blade.php or themes/yoursagetheme/resources/views/content-product.blade.php

Details

The package will look for templates in the paths defined in the Sage config view.paths. It will search for both .php and .blade.php files.

Data from controllers and args from woocommerce will always be added to blade templates, even if you mix usage between php and blade templates.

With default Sage and WooCommerce config:

A template from the template hierarchy will loaded from resources/views/woocommerce or resources/views as entry template. (WC_Template_Loader will only load the empty resources/index.php in this case.)

wc_get_template() Will with default config look inside resources/views/woocommerce and resources/views. $args added by Woocommerce will take priority over controller data if there are any conflicts.

wc_get_template_part() Will with default config look inside resources/views/woocommerce, resources/views/partials and resources/views.

wc_get_template_html() Is not supported.

sage-woocommerce-support's People

Contributors

kimhf avatar

Watchers

Daniel Sturm avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.