SwapDesc for WooCommerce
SwapDesc for WooCommerce lets you add a rich, per-variation long description and automatically swaps the product description when a customer selects a variation.
by Ahmed Magdy · github.com/bassiouny2/swapdesc-for-woocommerce · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/bassiouny2/swapdesc-for-woocommerce/archive/refs/heads/main.zipSwapDesc for WooCommerce lets you add a rich, per-variation long description and automatically swaps the product description when a customer selects a variation.
Features
- Add a rich text description for each variation
- Swap the displayed description on variation selection
- Restore the original description when variations are reset
- Render dynamic description output only for variable products
- Compatible with standard WooCommerce templates and Elementor product widgets
Requirements
- WordPress 6.0+
- WooCommerce 8.0+
- PHP 7.4+
Installation
- Download or clone this repository into
wp-content/plugins/product-var-trea. - In WordPress admin, go to Plugins and activate SwapDesc for WooCommerce.
Usage
- Edit a variable product in WooCommerce.
- Open the Variations tab.
- For each variation, fill in Variation Long Description.
- Save and update the product.
On the frontend, selecting a variation replaces the product description with the variation description and restores the original description when the selection is reset.
Shortcode
Use this shortcode on single product templates:
[pvt_description]
Notes:
- The shortcode renders only on WooCommerce single variable product pages.
- It outputs the main description container that gets swapped when a variation is selected.
- For simple/external/grouped products, shortcode output is empty on the frontend.
- Global styling for this shortcode can be configured from WooCommerce → Variation Descriptions.
Elementor
If you use Elementor for product pages:
- Edit your Single Product template in Elementor.
- Search for the widget SwapDesc Description.
- Drag it into the area where you want the changing description to appear.
- Publish/update the template.
Notes:
- Widget name:
SwapDesc Description - Widget internal name:
swapdesc_description - The widget outputs only for variable products on frontend product pages.
- You can style typography, colors, spacing, and border directly from the widget Style controls.
Development Notes
- Plugin entry file:
product-var-trea.php - Namespace:
PVT - Variation meta key:
_pvt_variation_description - Frontend container:
#pvt-description-root
License
GPL-2.0-or-later. See LICENSE.