- This topic has 9 replies, 2 voices, and was last updated 4 years, 1 month ago by
David.
-
AuthorPosts
-
April 14, 2022 at 2:56 am #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!
April 14, 2022 at 3:03 am #2188434David
StaffCustomer SupportHi 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 ?
April 14, 2022 at 3:16 am #2188442Moretasks
That is not a static data table. It contains product attributes. For example, Manufacturer name, Ingredients, etc.
April 14, 2022 at 3:42 am #2188455David
StaffCustomer SupportOK – 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/
April 14, 2022 at 3:47 am #2188459Moretasks
I want to achieve this design. A table beside the product image.
Please find the link I have shared here for your reference.
April 14, 2022 at 4:03 am #2188480David
StaffCustomer SupportThat 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 to15it 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.
April 14, 2022 at 4:28 am #2188497Moretasks
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.5Instead, my output is as follows.
30 pack size -> $1, $0.5
60 pack size -> $1, $0.5April 14, 2022 at 4:43 am #2188509David
StaffCustomer SupportThats not something i can help with, it would require custom development.
April 14, 2022 at 4:49 am #2188512Moretasks
Okay. Thanks for your help buddy!
April 14, 2022 at 5:08 am #2188531David
StaffCustomer SupportYou’re welcome
-
AuthorPosts
- You must be logged in to reply to this topic.