Skip to content

Commit 6969d54

Browse files
committed
Fixed upgrade file config name
1 parent 49c5e0c commit 6969d54

File tree

5 files changed

+192
-93
lines changed

5 files changed

+192
-93
lines changed

core/src/Settings/Configuration/DefaultConfiguration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ class DefaultConfiguration
4747
'PS_CHECKOUT_DISPLAY_LOGO_CART' => '1',
4848
'PS_CHECKOUT_HOSTED_FIELDS_CONTINGENCIES' => 'SCA_WHEN_REQUIRED',
4949
'PS_CHECKOUT_PAYPAL_BUTTON' => '{"shape":"pill","label":"pay","color":"gold"}',
50-
'PS_CHECKOUT_PAY_LATER_CONFIG' => '{"cart":{"status":"enabled"},"category":{"status":"disabled"},"checkout":{"status":"enabled"},"homepage":{"status":"disabled"},"product":{"status":"enabled"}}',
50+
'PS_CHECKOUT_PAY_LATER_CONFIG' => '{"cart":{"placement":"cart","status":"enabled","layout":"text","logo-type":"inline","text-color":"black","text-size":"12"},"category":{"placement":"category","status":"disabled","color":"white","layout":"flex","ratio":"8x1"},"checkout":{"placement":"checkout","status":"enabled","layout":"text","logo-type":"inline","text-color":"black","text-size":"12"},"homepage":{"placement":"homepage","status":"disabled","color":"white","layout":"flex","ratio":"8x1"},"product":{"placement":"product","status":"enabled","layout":"text","logo-type":"inline","text-color":"black","text-size":"12"}}',
5151
];
5252
}

core/src/Settings/Configuration/PayPalPayLaterConfiguration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function getPayLaterMessagingConfigurationDefault(): array
8585
'product' => ['status' => 'disabled'],
8686
'homepage' => ['status' => 'disabled'],
8787
'category' => ['status' => 'disabled'],
88-
'payment' => ['status' => 'disabled'],
88+
'checkout' => ['status' => 'disabled'],
8989
'cart' => ['status' => 'disabled'],
9090
];
9191
}
@@ -106,7 +106,7 @@ private function getPayLaterMessagingConfigurationLegacy(): array
106106
'product' => ['status' => $this->configuration->getBoolean(self::PS_CHECKOUT_PAY_LATER_PRODUCT_PAGE) ? 'enabled': 'disabled'],
107107
'homepage' => ['status' => $this->configuration->getBoolean(self::PS_CHECKOUT_PAY_LATER_HOME_PAGE_BANNER) ? 'enabled': 'disabled'],
108108
'category' => ['status' => $this->configuration->getBoolean(self::PS_CHECKOUT_PAY_LATER_CATEGORY_PAGE_BANNER) ? 'enabled': 'disabled'],
109-
'payment' => ['status' => $this->configuration->getBoolean(self::PS_CHECKOUT_PAY_LATER_ORDER_PAGE) ? 'enabled': 'disabled'],
109+
'checkout' => ['status' => $this->configuration->getBoolean(self::PS_CHECKOUT_PAY_LATER_ORDER_PAGE) ? 'enabled': 'disabled'],
110110
'cart' => ['status' => $this->configuration->getBoolean(self::PS_CHECKOUT_PAY_LATER_ORDER_PAGE) ? 'enabled': 'disabled'],
111111
];
112112
}

ps17/upgrade/upgrade-7.5.1.0.php

Lines changed: 63 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -39,36 +39,69 @@ function upgrade_module_7_5_1_0(Ps_checkout $module)
3939

4040
foreach ($shopsList as $shopId) {
4141
$configuration = json_encode([
42-
'product' => ['status' => (bool) \Configuration::get(
43-
'PS_CHECKOUT_PAY_LATER_PRODUCT_PAGE',
44-
null,
45-
null,
46-
$shopId
47-
) ? 'enabled' : 'disabled'],
48-
'homepage' => ['status' => (bool) \Configuration::get(
49-
'PS_CHECKOUT_PAY_LATER_HOME_PAGE_BANNER',
50-
null,
51-
null,
52-
$shopId
53-
) ? 'enabled' : 'disabled'],
54-
'cart' => ['status' => (bool) \Configuration::get(
55-
'PS_CHECKOUT_PAY_LATER_ORDER_PAGE_BANNER',
56-
null,
57-
null,
58-
$shopId
59-
) ? 'enabled' : 'disabled'],
60-
'payment' => ['status' => (bool) \Configuration::get(
61-
'PS_CHECKOUT_PAY_LATER_ORDER_PAGE_BANNER',
62-
null,
63-
null,
64-
$shopId
65-
) ? 'enabled' : 'disabled'],
66-
'category' => ['status' => (bool) \Configuration::get(
67-
'PS_CHECKOUT_PAY_LATER_CATEGORY_PAGE_BANNER',
68-
null,
69-
null,
70-
$shopId
71-
) ? 'enabled' : 'disabled'],
42+
'cart' => [
43+
'placement' => 'cart',
44+
'status' => (bool) \Configuration::get(
45+
'PS_CHECKOUT_PAY_LATER_ORDER_PAGE_BANNER',
46+
null,
47+
null,
48+
$shopId
49+
) ? 'enabled' : 'disabled',
50+
'layout' => 'text',
51+
'logo-type' => 'inline',
52+
'text-color' => 'black',
53+
'text-size' => '12',
54+
],
55+
'category' => [
56+
'placement' => 'category',
57+
'status' => (bool) \Configuration::get(
58+
'PS_CHECKOUT_PAY_LATER_CATEGORY_PAGE_BANNER',
59+
null,
60+
null,
61+
$shopId
62+
) ? 'enabled' : 'disabled',
63+
'color' => 'white',
64+
'layout' => 'flex',
65+
'ratio' => '8x1',
66+
],
67+
'checkout' => [
68+
'placement' => 'checkout',
69+
'status' => (bool) \Configuration::get(
70+
'PS_CHECKOUT_PAY_LATER_ORDER_PAGE_BANNER',
71+
null,
72+
null,
73+
$shopId
74+
) ? 'enabled' : 'disabled',
75+
'layout' => 'text',
76+
'logo-type' => 'inline',
77+
'text-color' => 'black',
78+
'text-size' => '12',
79+
],
80+
'homepage' => [
81+
'placement' => 'homepage',
82+
'status' => (bool) \Configuration::get(
83+
'PS_CHECKOUT_PAY_LATER_HOME_PAGE_BANNER',
84+
null,
85+
null,
86+
$shopId
87+
) ? 'enabled' : 'disabled',
88+
'color' => 'white',
89+
'layout' => 'flex',
90+
'ratio' => '8x1',
91+
],
92+
'product' => [
93+
'placement' => 'product',
94+
'status' => (bool) \Configuration::get(
95+
'PS_CHECKOUT_PAY_LATER_PRODUCT_PAGE',
96+
null,
97+
null,
98+
$shopId
99+
) ? 'enabled' : 'disabled',
100+
'layout' => 'text',
101+
'logo-type' => 'inline',
102+
'text-color' => 'black',
103+
'text-size' => '12',
104+
],
72105
]);
73106

74107
Configuration::updateValue('PS_CHECKOUT_PAY_LATER_CONFIG', $configuration, false, null, (int) $shopId);

ps8/upgrade/upgrade-8.5.1.0.php

Lines changed: 63 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -39,36 +39,69 @@ function upgrade_module_8_5_1_0(Ps_checkout $module)
3939

4040
foreach ($shopsList as $shopId) {
4141
$configuration = json_encode([
42-
'product' => ['status' => (bool) \Configuration::get(
43-
'PS_CHECKOUT_PAY_LATER_PRODUCT_PAGE',
44-
null,
45-
null,
46-
$shopId
47-
) ? 'enabled' : 'disabled'],
48-
'homepage' => ['status' => (bool) \Configuration::get(
49-
'PS_CHECKOUT_PAY_LATER_HOME_PAGE_BANNER',
50-
null,
51-
null,
52-
$shopId
53-
) ? 'enabled' : 'disabled'],
54-
'cart' => ['status' => (bool) \Configuration::get(
55-
'PS_CHECKOUT_PAY_LATER_ORDER_PAGE_BANNER',
56-
null,
57-
null,
58-
$shopId
59-
) ? 'enabled' : 'disabled'],
60-
'payment' => ['status' => (bool) \Configuration::get(
61-
'PS_CHECKOUT_PAY_LATER_ORDER_PAGE_BANNER',
62-
null,
63-
null,
64-
$shopId
65-
) ? 'enabled' : 'disabled'],
66-
'category' => ['status' => (bool) \Configuration::get(
67-
'PS_CHECKOUT_PAY_LATER_CATEGORY_PAGE_BANNER',
68-
null,
69-
null,
70-
$shopId
71-
) ? 'enabled' : 'disabled'],
42+
'cart' => [
43+
'placement' => 'cart',
44+
'status' => (bool) \Configuration::get(
45+
'PS_CHECKOUT_PAY_LATER_ORDER_PAGE_BANNER',
46+
null,
47+
null,
48+
$shopId
49+
) ? 'enabled' : 'disabled',
50+
'layout' => 'text',
51+
'logo-type' => 'inline',
52+
'text-color' => 'black',
53+
'text-size' => '12',
54+
],
55+
'category' => [
56+
'placement' => 'category',
57+
'status' => (bool) \Configuration::get(
58+
'PS_CHECKOUT_PAY_LATER_CATEGORY_PAGE_BANNER',
59+
null,
60+
null,
61+
$shopId
62+
) ? 'enabled' : 'disabled',
63+
'color' => 'white',
64+
'layout' => 'flex',
65+
'ratio' => '8x1',
66+
],
67+
'checkout' => [
68+
'placement' => 'checkout',
69+
'status' => (bool) \Configuration::get(
70+
'PS_CHECKOUT_PAY_LATER_ORDER_PAGE_BANNER',
71+
null,
72+
null,
73+
$shopId
74+
) ? 'enabled' : 'disabled',
75+
'layout' => 'text',
76+
'logo-type' => 'inline',
77+
'text-color' => 'black',
78+
'text-size' => '12',
79+
],
80+
'homepage' => [
81+
'placement' => 'homepage',
82+
'status' => (bool) \Configuration::get(
83+
'PS_CHECKOUT_PAY_LATER_HOME_PAGE_BANNER',
84+
null,
85+
null,
86+
$shopId
87+
) ? 'enabled' : 'disabled',
88+
'color' => 'white',
89+
'layout' => 'flex',
90+
'ratio' => '8x1',
91+
],
92+
'product' => [
93+
'placement' => 'product',
94+
'status' => (bool) \Configuration::get(
95+
'PS_CHECKOUT_PAY_LATER_PRODUCT_PAGE',
96+
null,
97+
null,
98+
$shopId
99+
) ? 'enabled' : 'disabled',
100+
'layout' => 'text',
101+
'logo-type' => 'inline',
102+
'text-color' => 'black',
103+
'text-size' => '12',
104+
],
72105
]);
73106

74107
Configuration::updateValue('PS_CHECKOUT_PAY_LATER_CONFIG', $configuration, false, null, (int) $shopId);

ps9/upgrade/upgrade-9.5.1.0.php

Lines changed: 63 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -39,36 +39,69 @@ function upgrade_module_9_5_1_0(Ps_checkout $module)
3939

4040
foreach ($shopsList as $shopId) {
4141
$configuration = json_encode([
42-
'product' => ['status' => (bool) \Configuration::get(
43-
'PS_CHECKOUT_PAY_LATER_PRODUCT_PAGE',
44-
null,
45-
null,
46-
$shopId
47-
) ? 'enabled' : 'disabled'],
48-
'homepage' => ['status' => (bool) \Configuration::get(
49-
'PS_CHECKOUT_PAY_LATER_HOME_PAGE_BANNER',
50-
null,
51-
null,
52-
$shopId
53-
) ? 'enabled' : 'disabled'],
54-
'cart' => ['status' => (bool) \Configuration::get(
55-
'PS_CHECKOUT_PAY_LATER_ORDER_PAGE_BANNER',
56-
null,
57-
null,
58-
$shopId
59-
) ? 'enabled' : 'disabled'],
60-
'payment' => ['status' => (bool) \Configuration::get(
61-
'PS_CHECKOUT_PAY_LATER_ORDER_PAGE_BANNER',
62-
null,
63-
null,
64-
$shopId
65-
) ? 'enabled' : 'disabled'],
66-
'category' => ['status' => (bool) \Configuration::get(
67-
'PS_CHECKOUT_PAY_LATER_CATEGORY_PAGE_BANNER',
68-
null,
69-
null,
70-
$shopId
71-
) ? 'enabled' : 'disabled'],
42+
'cart' => [
43+
'placement' => 'cart',
44+
'status' => (bool) \Configuration::get(
45+
'PS_CHECKOUT_PAY_LATER_ORDER_PAGE_BANNER',
46+
null,
47+
null,
48+
$shopId
49+
) ? 'enabled' : 'disabled',
50+
'layout' => 'text',
51+
'logo-type' => 'inline',
52+
'text-color' => 'black',
53+
'text-size' => '12',
54+
],
55+
'category' => [
56+
'placement' => 'category',
57+
'status' => (bool) \Configuration::get(
58+
'PS_CHECKOUT_PAY_LATER_CATEGORY_PAGE_BANNER',
59+
null,
60+
null,
61+
$shopId
62+
) ? 'enabled' : 'disabled',
63+
'color' => 'white',
64+
'layout' => 'flex',
65+
'ratio' => '8x1',
66+
],
67+
'checkout' => [
68+
'placement' => 'checkout',
69+
'status' => (bool) \Configuration::get(
70+
'PS_CHECKOUT_PAY_LATER_ORDER_PAGE_BANNER',
71+
null,
72+
null,
73+
$shopId
74+
) ? 'enabled' : 'disabled',
75+
'layout' => 'text',
76+
'logo-type' => 'inline',
77+
'text-color' => 'black',
78+
'text-size' => '12',
79+
],
80+
'homepage' => [
81+
'placement' => 'homepage',
82+
'status' => (bool) \Configuration::get(
83+
'PS_CHECKOUT_PAY_LATER_HOME_PAGE_BANNER',
84+
null,
85+
null,
86+
$shopId
87+
) ? 'enabled' : 'disabled',
88+
'color' => 'white',
89+
'layout' => 'flex',
90+
'ratio' => '8x1',
91+
],
92+
'product' => [
93+
'placement' => 'product',
94+
'status' => (bool) \Configuration::get(
95+
'PS_CHECKOUT_PAY_LATER_PRODUCT_PAGE',
96+
null,
97+
null,
98+
$shopId
99+
) ? 'enabled' : 'disabled',
100+
'layout' => 'text',
101+
'logo-type' => 'inline',
102+
'text-color' => 'black',
103+
'text-size' => '12',
104+
],
72105
]);
73106

74107
Configuration::updateValue('PS_CHECKOUT_PAY_LATER_CONFIG', $configuration, false, null, (int) $shopId);

0 commit comments

Comments
 (0)