Site logo

[Resolved] How to edit a Single Product Page?

Home Forums Support [Resolved] How to edit a Single Product Page?

Home Forums Support How to edit a Single Product Page?

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #2188430
    Moretasks

    Hello team,

    Could you please explain to me how to edit the single product page?
    I would like to get a table containing product details beside the product image instead of quantity and add-to-cart buttons.

    Thank you!

    #2188434
    David
    Staff
    Customer Support

    Hi there,

    Woocommerce only provides 2 x areas for editing , the Short Description which is the area to the right of the image.
    And then theres the Description field which by default appears in the Tabs.
    Both of those accept HTML so you can add a HTML Table if you wish.

    Other then that you’re fairly limited without adding plugins or code.

    How is this Table to be generated ? Is it static data or is it comprised of product attributes ?

    #2188442
    Moretasks

    That is not a static data table. It contains product attributes. For example, Manufacturer name, Ingredients, etc.

    #2188455
    David
    Staff
    Customer Support

    OK – so that should show in one of that tabs.
    And if you want it displayed after the summary you can add this PHP Snippet to your site:

    add_action ( 'woocommerce_single_product_summary', function(){
      global $product;
      wc_display_product_attributes( $product );
    }, 20 );
    

    How to add PHP: https://docs.generatepress.com/article/adding-php/

    #2188459
    Moretasks

    I want to achieve this design. A table beside the product image.

    Please find the link I have shared here for your reference.

    https://www.powpills.com/product/cenforce/

    #2188480
    David
    Staff
    Customer Support

    That code i provided above will insert your attributes table in that position.
    In the code you will see at the end: }, 20 ); the 20 is its priority, that positions it after the short description, if you change it to 15 it will place it before the description. You can see the Hook and its callbacks here for reference:

    https://www.businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/

    If you can add that code to your site, and if it works share a link to a product where i can see them and ill assist with any CSS to improve its style.

    #2188497
    Moretasks

    Yes, it worked. I will manage the CSS.

    Thank you.

    Could you please tell me how to achieve the table structure of the product?

    https://www.powpills.com/product/cenforce/

    I want to get the data according to the pack size and unit price. I have created two attributes for both of them. But the unit price is repeating for all the pack sizes. For example, I want the data in this structure.
    30 pack size -> $1
    60 pack size -> $0.5

    Instead, my output is as follows.
    30 pack size -> $1, $0.5
    60 pack size -> $1, $0.5

    #2188509
    David
    Staff
    Customer Support

    Thats not something i can help with, it would require custom development.

    #2188512
    Moretasks

    Okay. Thanks for your help buddy!

    #2188531
    David
    Staff
    Customer Support

    You’re welcome

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.