-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WooCommerce support #1923
WooCommerce support #1923
Conversation
e832699
to
a071331
Compare
Maybe a composer option? |
I keep running into This is the content of that file. <?php $__env->startSection('content'); ?>
<?php while(have_posts()): ?> <?php (the_post()); ?>
<?php echo $__env->make('partials.page-header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php echo $__env->make('partials.content-page', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php endwhile; ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?> I've created |
Did you @arthurkirkosa find any solutions for this? I'm getting the same error. |
// resources/views/woocommerce.blade.php
@extends ('layouts.app')
@section ('content')
@php (woocommerce_content())
@stop // resources/views/woocommerce/archive-product.php
<?php echo App\Template('woocommerce'); In a partial I have <div class="row mb-5">
@while ($products->have_posts()) @php ($products->the_post())
<div class="col-sm-4">
<div class="product product-border">
<a class="woocommerce-loop-product__link" href="{{ get_permalink() }}">
{!! woocommerce_get_product_thumbnail() !!}
<div class="woocommerce-loop-product__title">{{ the_title() }}</div>
</a>
{!! woocommerce_template_loop_price() !!}
</div>
</div>
@endwhile
</div> <?php
namespace App\Traits;
use WP_Query;
trait Products
{
public function products()
{
return new WP_Query([
'post_type' => 'product',
'posts_per_page' => 3,
'tax_query' => [
[
'taxonomy' => 'product_visibility',
'field' => 'name',
'terms' => 'featured',
],
],
]);
}
} Not exactly what I wanted... but it's the best I got so far... would have liked to be able to override the actual HTML structure, but... ¯_(ツ)_/¯ Maybe someone can help us with that part. I was able in Sage 8 to do it... but not sure how to in Sage 9 (and I'm a Laravel developer :D) |
@QWp6t The pr you posted was really helpful. Is it possible to use blade templates instead of php templates though? |
I'm personally against adding this to Sage out of the box. I think it would be better to put it on our docs, and that's probably what will wind up happening, but I figured I would go ahead and submit a PR anyway for now if for no other reason than to serve as an interim example for using Blade with third-party plugins.