Skip to content

Instantly share code, notes, and snippets.

View yaovicoder's full-sized avatar

Yaovi #Jake36 yaovicoder

  • Crypto Trader & Investor
View GitHub Profile
<?php
/**
* Plugin Name: WooCommerce Variable Product Variation Descriptions
* Description: Replaces the product short description with the descriptions of all visible and priced variations.
* Version: 1.0
* Author: Yaovi Ametepe
* Released: July 4th, 2023
*/
/**
@yaovicoder
yaovicoder / woocommerce-shop-page-title.php
Created July 4, 2023 17:40
This wordpress plugin sets the WooCommerce Shop page title based on the connected user's role
<?php
/*
Plugin Name: WooCommerce Shop Page Title
Description: Sets the WooCommerce Shop page title based on the connected user's role.
Version: 1.0
Version: 1.0
Author: Yaovi Ametepe
Released: July 4th, 2023
*/
@yaovicoder
yaovicoder / readme.md
Last active July 4, 2023 14:31
This WordPress plugin replaces the main product description with the variation description if available for variable products.

Plugin Description:

  • Plugin Name: Variation Description Plugin
  • Description: Replaces main product description with variation description if available.

This plugin modifies the product description display behavior in WooCommerce for variable products. By default, WooCommerce displays the main product description on the product page. However, if a variable product has child variations with different descriptions, this plugin replaces the main product description with the description of the selected price variation.

Function Description:

  • Function Name: replace_product_description_with_variation
  • Function Description: Replaces the product description with the variation description if available for variable products.
  • Function Arguments:
E70JHCOV2H-eyJsaWNlbnNlSWQiOiJFNzBKSENPVjJIIiwibGljZW5zZWVOYW1lIjoi5bGx5Lic55CG5bel5aSn5a2mIiwiYXNzaWduZWVOYW1lIjoiIiwiYXNzaWduZWVFbWFpbCI6IiIsImxpY2Vuc2VSZXN0cmljdGlvbiI6IkZvciBlZHVjYXRpb25hbCB1c2Ugb25seSIsImNoZWNrQ29uY3VycmVudFVzZSI6ZmFsc2UsInByb2R1Y3RzIjpbeyJjb2RlIjoiSUkiLCJwYWlkVXBUbyI6IjIwMjEtMDItMTgifSx7ImNvZGUiOiJBQyIsInBhaWRVcFRvIjoiMjAyMS0wMi0xOCJ9LHsiY29kZSI6IkRQTiIsInBhaWRVcFRvIjoiMjAyMS0wMi0xOCJ9LHsiY29kZSI6IlBTIiwicGFpZFVwVG8iOiIyMDIxLTAyLTE4In0seyJjb2RlIjoiR08iLCJwYWlkVXBUbyI6IjIwMjEtMDItMTgifSx7ImNvZGUiOiJETSIsInBhaWRVcFRvIjoiMjAyMS0wMi0xOCJ9LHsiY29kZSI6IkNMIiwicGFpZFVwVG8iOiIyMDIxLTAyLTE4In0seyJjb2RlIjoiUlMwIiwicGFpZFVwVG8iOiIyMDIxLTAyLTE4In0seyJjb2RlIjoiUkMiLCJwYWlkVXBUbyI6IjIwMjEtMDItMTgifSx7ImNvZGUiOiJSRCIsInBhaWRVcFRvIjoiMjAyMS0wMi0xOCJ9LHsiY29kZSI6IlBDIiwicGFpZFVwVG8iOiIyMDIxLTAyLTE4In0seyJjb2RlIjoiUk0iLCJwYWlkVXBUbyI6IjIwMjEtMDItMTgifSx7ImNvZGUiOiJXUyIsInBhaWRVcFRvIjoiMjAyMS0wMi0xOCJ9LHsiY29kZSI6IkRCIiwicGFpZFVwVG8iOiIyMDIxLTAyLTE4In0seyJjb2RlIjoiREMiLCJwYWlkVXBUbyI6IjIwMjEtMDItMTgifSx7I

Keybase proof

I hereby claim:

  • I am yaovicoder on github.
  • I am yaoviametepe (https://keybase.io/yaoviametepe) on keybase.
  • I have a public key ASCR_0iNHrHgVdF6IeD66la-rLnNtIwPVXOax7zdXKVP-go

To claim this, I am signing this object: