I want to display some custom contents in accordion style on single product page below the short description. I used Advanced Custom Field Pro (ACF PRO) plugin’s repeater field for custom content. So user can easily add/edit these data from their product edit screen.
What is Repeater Field?
It is fully described here.
Lets start the procedure below:
1. Creating the ACF Repeater Field Group for Products
Assuming that you already bought the ACF pro plugin and installed it on your site. Now navigate to Custom Fields -> Add New page and create it as per attached screenshot.
Now go to Products -> All Products page and edit a product or click on Add New link.You’ll see that Product Extra Information custom metabox is appearing below the WP Editor like attached screenshot.
Click on the “Add Row” button and add the additional information about your product. You will follow same process and add more content.
2. PHP
Next we shall display this additional content below the product short description & implement the accordion effect. We shall not touch the core WooComerce template’s file for it. I added the following PHP snippets in my theme’s functions.php file. You can add this code into your own plugin’s file or any other places if you have this kind of option for your site.
The rest of the content is available for Pro members. Click on the PAY NOW button to enable access to this content.
$15.00Pay Now
* Payment is non-refundable.
Paid members will be able to login below to see the restricted content.
Reviews
There are no reviews yet.