Comments (11)
Hi @ILYESBouhari,
We had to do it through a class.
We added the below code in themes/wprig/inc/woocommerce
(we added this folder ourselves).
public function initialize() {
add_action( 'after_setup_theme', array( $this, 'dgs_add_woocommerce_support' ) );
}
/**
* Declare WooCommerce Theme Support
*/
public function dgs_add_woocommerce_support() {
add_theme_support( 'woocommerce' );
}
}
This wiki article talks a bit more about the PHP architecture of the theme in-depth. https://github.com/wprig/docs/blob/master/documentation/php.md - Unfortunately, this theme isn't really actively maintained, which is too bad. It had such a promising start.
from wprig.
Has anyone made progress on Woo support? I am planning to dive into it this weekend, but want to make sure someone hasn't started any work on it yet.
from wprig.
Go for it! Make sure you work with the v2.0
branch and follow the PHP patterns already set up. WooCommerce and other support should be stand-alone and activated through a single reference.
from wprig.
Here's a snippet for the whole file, if it helps: https://gist.github.com/digisavvy/0ee0c0c4cd64b60c241268c37dfd0838
The items specific to your question are on lines 38 and 54.
from wprig.
I am also having a problem with woocommerce. Not about to get it to work
from wprig.
I personally have no plans to add a WooCommerce component, but anyone else is free to add one. Create a PR (or encourage someone else to do it) and add the functionality in the ./dev/pluggable/
folder for modular inclusion.
from wprig.
Closing due to inactivity. Feel free to open again.
from wprig.
I'd like to revisit this issue. Trying to provide styling for WooCommerce and I'm having difficulty. I need guidance on providing this support for Woo.
I added this to styles/component.php
'wp-rig-woocommerce' => [
'file' => 'woocommerce.min.css',
'preload_callback' => function() {
global $template;
return is_woocommerce() || is_checkout() || is_cart();
},
],
Doing the above does load the specified file! Woot! The problem is that the styles I'm writing do not actually appear to be printed/applied anywhere onscreen.
I created a custom full width template and got as far. I then added this wp_rig()->print_styles( 'wp-rig-full-width' );
and then styles appeared to take hold. I tried this with an woocommerce override but I still have issues with my styles in woocommerce.min.css not showing up.
Any thoughts?
from wprig.
I was able to resolve this by including both the namespace and wp_rig()->print_styles( 'wp-rig-woocommerce' );
inside of the WooCommerce template file I used to override. Seems like there might be a better way?
from wprig.
@digisavvy could you share how did you add Woocommerce support ? please
from wprig.
@digisavvy thanks
from wprig.
Related Issues (20)
- theme.json HOT 1
- Can't extend any core classes HOT 2
- Integrate Theme.Json into WP-Rig HOT 2
- Bug blank page editor with 5.9 .. HOT 4
- Styles task hangs and never seems to complete HOT 1
- Inline SVG undefined properties HOT 1
- Change out colors to use block theme colors HOT 4
- Mobile menu obscures content when toggled off HOT 2
- Running production version changes part of string to 'undefined' HOT 3
- Update Deprecated Node Modules HOT 5
- Help instalation HOT 25
- PHP Fatal error on fresh install (`WP_Rig\WP_Rig\JavaScript\Component`) HOT 1
- Why is it so hard (read impossible) to change the color of the mobile menu toggle? HOT 1
- Upgrade Babel and eslint
- I installed but it stays in scripts HOT 3
- watch process freezes after "Finished 'editorStyles'.... " HOT 2
- mobile menu clickable under text when hamburger menu is folded up HOT 4
- Seemingly incomplete collapsible sub menu items feature in mobile nav
- Use intersection observer to swap the submenu direction so items do not go offscreen
- Version not updating when running production bundle due to mismatch in constants.js
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wprig.