Change the product_preview to woocommerceBlock

This commit is contained in:
Narek Zakarian 2024-03-12 19:03:17 +04:00
parent 680de182a9
commit 55b2e6d8d4
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7
3 changed files with 11 additions and 8 deletions

View file

@ -40,7 +40,7 @@ class PayLaterBlockModule implements ModuleInterface {
* @return bool true if the block is enabled, otherwise false.
*/
public static function is_block_enabled( SettingsStatus $settings_status ): bool {
return self::is_module_loading_required() && $settings_status->is_pay_later_messaging_enabled_for_location( 'product_preview' );
return self::is_module_loading_required() && $settings_status->is_pay_later_messaging_enabled_for_location( 'woocommerceBlock' );
}
/**

View file

@ -30,7 +30,10 @@ document.addEventListener( 'DOMContentLoaded', () => {
partnerClientId: PcpPayLaterConfigurator.partnerClientId,
partnerName: 'WooCommerce',
bnCode: 'Woo_PPCP',
placements: ['cart', 'checkout', 'product', 'shop', 'home', 'product_preview'],
placements: ['cart', 'checkout', 'product', 'shop', 'home'],
custom_placement:[{
message_reference: 'woocommerceBlock',
}],
styleOverrides: {
button: publishButtonClassName,
header: PcpPayLaterConfigurator.headerClassName,

View file

@ -27,7 +27,7 @@ class ConfigFactory {
'product' => $this->for_location( $settings, 'product' ),
'shop' => $this->for_location( $settings, 'shop' ),
'home' => $this->for_location( $settings, 'home' ),
'product_preview' => $this->for_location( $settings, 'product_preview' ),
'woocommerceBlock' => $this->for_location( $settings, 'woocommerceBlock' ),
);
}