Hi there,
As my colleague mentioned that can be done only via Custom Development. The way you set stuff in the shop page for The Grid will not work, the reason behind it is that the single shop page template PHP file does not have the proper code to receive the result of The Grid as Woocommerce and The Grid are not interconnected in that way.
But you can achieve this by changing the PHP files which is responsible for the generation of the Woocommerce single product pages. This is considered as customization and outside of our support scope, we will not be able to implement or maintain the suggested codes, but we will do our best to show you how to do the customization.
You will need to install the Child Theme and copy the file below from Parent theme:
wp-content/themes/x/woocommerce/single-product/related.php
To the Child Theme:
wp-content/themes/x-child/woocommerce/single-product/related.php
You will need to create the necessary folders on your Child Theme
Then change the newly copied file content to:
<?php
// =============================================================================
// WOOCOMMERCE/SINGLE-PRODUCT/RELATED.PHP
// -----------------------------------------------------------------------------
// @version 3.0.0
// =============================================================================
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
echo '<div class="the-grid" style="clear: both; width: 100%;">' . do_shortcode('[the_grid name="Test"]') . '</div>';
if ( $related_products && x_get_option( 'x_woocommerce_product_related_enable' ) == '1' ) : ?>
<section class="related products cols-<?php echo x_get_option( 'x_woocommerce_product_related_columns' ); ?>">
<h2><?php esc_html_e( 'Related products', '__x__' ); ?></h2>
<?php woocommerce_product_loop_start(); ?>
<?php foreach ( $related_products as $related_product ) : ?>
<?php
$post_object = get_post( $related_product->get_id() );
setup_postdata( $GLOBALS['post'] =& $post_object );
wc_get_template_part( 'content', 'product' ); ?>
<?php endforeach; ?>
<?php woocommerce_product_loop_end(); ?>
</section>
<?php endif;
wp_reset_postdata();
We used the do_shortcode function of the WordPress to add The Grid. You need to change [the_grid name="Test"]
section with the shortcode of your Grid which you can find in the listing of the Grids:
We also wrapped the code to a div
tag with the-grid
class. So you can add custom CSS code like this to style it as you wish:
.single-product .the-grid {
/* Your Code Here */
}
Thank you.