0

I'm new to WordPress development.

I started an internship where I was given an existing webpage and was asked to modularize it (so that a complex homepage can be simplified into only a few lines of code instead of a huge document,) such as turning this:

<html>
<div class="section1"> (this would contain a lot of content) </div>
<div class="section2"> (and this, etc) </div>
</html>

Into this

<?php
include('section1.php');
include('section2.php'); ?>

where the entire page could be just a few lines that pull other files in. I've been successful so far, but I'm trying to include a WooCommerce feature product in one of these (where the user would be able to see the product and select the variation and add it to the cart), and am having trouble because the WooCommerce pages and sections are completely separate from the other WordPress sections.

Can I have one of these sections be a WooCommerce product? Is there a way to input shortcode or a get_template_part() or include() where I can pull WooCommerce products and functionality into a WordPress page? Is it better to try to put all of my non-WooCommerce related sections onto the product page within the WooCommerce part of Wordpress?

I guess a simplified version of the question would be: are WordPress pages and WooCommerce pages actually as separate as I seem to think they are?

Sarah Stark
  • 119
  • 5
  • You can create one template for woocommerce products page. Reference here -->> https://stackoverflow.com/questions/21028830/woocommerce-get-products – Su Yatanar Jul 23 '18 at 10:56
  • Here also ->> https://businessbloomer.com/woocommerce-easily-get-product-info-title-sku-desc-product-object/ – Su Yatanar Jul 23 '18 at 10:57

0 Answers0