• Resolved zerojjc

    (@zerojjc)


    I am attempting to integrate some HTML code from BazaarVoice into the product page that is displayed by the BigCommerce for WordPress plugin. I see that the two template pages that should be edited are archive-bigcommerce_product.php and single-bigcommerce_product.php (https://developer.bigcommerce.com/bigcommerce-for-wordpress/extending-the-plugin/customization-guide). However I am not familiar enough with this php code to know how to add some html code into the body of that page. Can anyone assist? Essentially I need to add 4 or so Divs into the body of the Product/s page.

    Here is the single-bigcommerce_product.php code:

    <?php
    /**
     * Default Product Single Template
     * Override this template in your own theme by creating a file at
     * [your-theme]/bigcommerce/single-bigcommerce_product.php
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	die( '-1' );
    }
    
    get_header();
    echo apply_filters( 'bigcommerce/template/product/single', '', get_the_ID() );
    get_footer();
Viewing 6 replies - 1 through 6 (of 6 total)
  • Topher

    (@topher1kenobe)

    Hey there, you want to look first at page-wrapper.php, which includes either product-single.php or product-archive.php. You probably want to edit one of these last two, but it’s worth looking inside wrapper to see what your content will be wrapped in.

    The later are found in /templates/public/components/products in the main plugin.

    Thread Starter zerojjc

    (@zerojjc)

    Hi Topher. Thank you for your assistance. I spent some time playing around trying to figure things out and I managed to get the code added to the product-single.php page. Another question I have and hope you might know the answer is: How do I display a price range on the product-single.php page, rather than the single price? For instance, on the all products page it shows a price range for a product, & on the single product it shows the exact price depending on which item is selected. I assume I would have to replace the
    <?php echo $price; ?>
    with one for the price range, however I can not located where the all products page code is to find the price range code that is being used.

    Topher

    (@topher1kenobe)

    I don’t know right off, but I’ll find out and post here.

    Thread Starter zerojjc

    (@zerojjc)

    Any luck?

    Topher

    (@topher1kenobe)

    Here’s what I got back from the dev team:

    We do show the price range on the product single. And then when you select a variant, it adjusts (with JS) to show the price of the selected variant. A variant does not have a price range.

    Technically, you could remove the attribute data-js="bc-product-data-wrapper" from the product-single.php template (it’s on the wrapper <section> element). That would break the JS that changes the price.

    Let me know what you find with that.

    Thread Starter zerojjc

    (@zerojjc)

    Thank you Topher, you’re a good man!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Integrating BazaarVoice to the BigCommerce for WordPress Plugin’ is closed to new replies.