Join the Soledad Facebook Users Group here
for Share, assistance, discussion, and Updates related to Soledad WordPress Theme.

If you can't create a new ticket - you can send us an email via our contact form and we will get back to you.

Okay
  Public Ticket #1622156
Problem with $product->get_content()
Closed

Comments

  • grupoitnet started the conversation

    We have a problem, when in the content-single_product get the "product description" always print the content with html related with tabs.

    And the css is automatically applied to the woocomerce-tabs element. Then, the description is hidden.

    How can I remove the html from the tab of this get_content ()? I want we can show the content.


    add_action('woocommerce_single_product_summary', function() {
    global $product;
    echo $product->get_description();
    }, 25);

    <div class="woocommerce-tabs wc-tabs-wrapper">
    <div id="tab-description" class="panel entry-content wc-tab" style="display: none;">

    Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut loret fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt loret. Neque porro lorem quisquam est, qui dolorem ipsum quia dolor sit amet. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut loret fugit, sed quia ipsu consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro lorem quisquam est, qui dolorem ipsum quia dolor sit amet.

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget.

    </div>
    </div>


    We only want

    <p>Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut loret fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt loret. Neque porro lorem quisquam est, qui dolorem ipsum quia dolor sit amet. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut loret fugit, sed quia ipsu consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro lorem quisquam est, qui dolorem ipsum quia dolor sit amet.</p>

    <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat ma</p>


  •  2,699
    PenciDesign replied

    Hi,

    I'm not clearly with your question, can you tell me more about this? When I access to the link I see the print_r code: http://prntscr.com/jzmesl

    Can you tell me what do you want there?


    Best Regards,

    PenciDesign

  • grupoitnet replied

    Sorry, i have edited the content...

    i want to print product description using php code.

    Actually, when use this code:


    add_action('woocommerce_single_product_summary', function() {
    global $product;
    echo $product->get_description();
    }, 25);

    or

    //get description from hook
    function woocommerce_template_product_description() {
      woocommerce_get_template( 'single-product/tabs/description.php' );
    }
    // show full description from hook inside the product summary
    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_product_description', 10 );


    The product description is printed with the tab classes. 

    <div class="woocommerce-tabs wc-tabs-wrapper">
    <div id="tab-description" class="panel entry-content wc-tab" style="display: none;">

    I want to start the description without tab classes, only like the <p>

    Thank you

  •  2,699
    PenciDesign replied

    Hi,

    Unfortunately, that is custom work and it doesn't include in support policy for all items on Envato.

    I just can recommend you remove the tab "additional information" & "review" by use the code from Woocommrce:

    https://docs.woocommerce.com/document/editing-product-data-tabs/


    Best Regards,

    PenciDesign