Add Sale price and list price blocks to pricing tab with pricing section (#37513)

* Add pricing section to the pricing tab

* Add changelog file

* Fix php linter errors
This commit is contained in:
Maikel David Pérez Gómez 2023-03-31 14:47:31 -03:00 committed by GitHub
parent 85080f642b
commit 6df1cef307
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: add
Add pricing section to the pricing tab

View File

@ -0,0 +1,4 @@
Significance: minor
Type: add
Add pricing section to the pricing tab

View File

@ -460,6 +460,62 @@ class WC_Post_Types {
'id' => 'pricing',
'title' => __( 'Pricing', 'woocommerce' ),
),
array(
array(
'woocommerce/product-section',
array(
'title' => __( 'Pricing', 'woocommerce' ),
'description' => sprintf(
/* translators: %1$s: Images guide link opening tag. %2$s: Images guide link closing tag.*/
__( 'Set a competitive price, put the product on sale, and manage tax calculations. %1$sHow to price your product?%2$s', 'woocommerce' ),
'<a href="https://woocommerce.com/posts/how-to-price-products-strategies-expert-tips/" target="_blank" rel="noreferrer">',
'</a>'
),
'icon' => array(
'src' => '<svg xmlns="http://www.w3.org/2000/svg" view-box="0 0 24 24"><path fill-rule="evenodd" d="M16.83 6.342l.602.3.625-.25.443-.176v12.569l-.443-.178-.625-.25-.603.301-1.444.723-2.41-.804-.475-.158-.474.158-2.41.803-1.445-.722-.603-.3-.625.25-.443.177V6.215l.443.178.625.25.603-.301 1.444-.722 2.41.803.475.158.474-.158 2.41-.803 1.445.722zM20 4l-1.5.6-1 .4-2-1-3 1-3-1-2 1-1-.4L5 4v17l1.5-.6 1-.4 2 1 3-1 3 1 2-1 1 .4 1.5.6V4zm-3.5 6.25v-1.5h-8v1.5h8zm0 3v-1.5h-8v1.5h8zm-8 3v-1.5h8v1.5h-8z" clip-rule="evenodd" /></svg>',
),
),
array(
array(
'core/columns',
array(),
array(
array(
'core/column',
array(
'templateLock' => 'all',
),
array(
array(
'woocommerce/product-pricing',
array(
'name' => 'regular_price',
'label' => __( 'List price', 'woocommerce' ),
'showPricingSection' => true,
),
),
),
),
array(
'core/column',
array(
'templateLock' => 'all',
),
array(
array(
'woocommerce/product-pricing',
array(
'name' => 'sale_price',
'label' => __( 'Sale price', 'woocommerce' ),
),
),
),
),
),
),
),
),
),
),
array(
'woocommerce/product-tab',