Skip to main content

Error with adding a default WC Single Product template inside a Brizy template

Comments

3 comments

  • KC George

    Hello Sam,

    Displaying the default WooCommerce Product listing inside a Brizy template is not necessary. The procedure to develop a single product template is slightly different. Kindly follow the tutorial Unlock the Brizy WooCommerce Builder to Create a Single Product Template! 

    0
  • Sam Cohen

    George,
    Thank you. But that doesnt work. I am a pro developer and I am having trouble with that way of which you posted. It doesn't bring in any other wc plugin that effect the button area. I've added a plugin to add in a PayPal button. Using the brz woocommerce templating suggested, does not show the PayPal button for me.

    Is there anyway to get the default wc single product to show inside a brz template is my question?

    This should be an obvious consideration, being that I can add the default of all other wc elements e.g products archive, cart, checkout, etc.. I just want to add in the default single product.. please see my screenshot above. 

    There is definitely an issue here. 

    _____________________________________________________________________

     

    Using the Brizy WC single product elements shows as:

    _____________________________________________________________________

     

    Using the default WC single product template, shows as:

     

    As you can see, the second one is the one that seems to work best for me.
    I just want to show the default WC single product template inside the Brizy template.

    0
  • Sam Cohen

    ✮✮✮✮✮ WORKAROUND SOLUTION ✮✮✮✮✮
    WARNING. YOU ARE ABOUT TO EDIT BRIZY PLUGIN FILES AND CODE. A NEW BRIZY PLUGIN UPDATE WILL OVERWRITE ANY CHANGES MADE. YOU WOULD HAVE TO REDO SOLUTION AFTER EACH UPDATE.

    OK I found a solution. I've edited a function in brizy files in:
    plugins\brizy\content\providers\free-provider.php
    inside a function starting at Line 141

    $this->registerPlaceholder( new Brizy_Content_Placeholders_Simple( __( 'Product Page', 'brizy' ), 'editor_product_page', function ( $context, $contentPlaceholder ) {

    I just replaced Line 148:
    if ( empty( $atts['itemId'] ) && current_user_can( 'manage_options' ) ) {
    return __( 'Please set a valid product', 'brizy' );
    }
     
     
    With this:
    if ( empty( $atts['itemId'] ) ) {

    $product = wc_get_product();
    $atts['itemId'] = $product->get_id();

    }
    if ( empty( $atts['itemId'] ) && current_user_can( 'manage_options' ) ) {
    return __( 'Please set a valid product', 'brizy' );
    }

    And now everything works!!!

    Question. Why doesn't this exist already? 
    It seems to me like it would be the fallback "default" for the Brizy Woocommerce Pages Element > Product, if a user does not want to enter a product ID or SKU, and just leave the field blank. Like in my screenshot example below:




    Now all I have to do is go into Customizer, and edit the product page elements and whalaa!!
    I am using the Blocksy theme as the based theme.

    0

Please sign in to leave a comment.