Skip to content

Commit

Permalink
Merged PR 57079: Add default configs where values are passed to DateI…
Browse files Browse the repository at this point in the history
…nterval

## What's being changed

We've added default values in config.xml relating to send_after settings for abandoned carts.

## Why it's being changed

These should have been added anyway, but this PR resolves a particular error: `Unknown or bad format (PTM)` in abandoned cart sync. The error appeared in the cron report if AC was configured at website or store level, but the 'Enrol abandoned cart after' setting was set to 'Use default' (and default was null).

## How to review / test this change

- Reset all configs in abandoned_carts (delete from core_config_data and flush config cache)
- Map AC program at website level leaving 'Enrol abandoned cart after' ('Use Default' will be checked)
- Run abandoned cart sync
- See no error in CLI
- Configure AC email series as well, in the same way (not at default level, leaving 'send after' settings as 'Use Default')
- Drop a cart and allow cron to run and pick up your cart for both program and email series

Related work items: #267092
  • Loading branch information
sta1r committed Sep 23, 2024
1 parent 7c324ad commit 661691b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Model/AbandonedCart/Interval.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public function getAbandonedCartSeriesGuestWindow($storeId, $num): array
* @param int $num
*
* @return DateInterval
* @throws \Exception
*/
public function getIntervalForCustomerEmailSeries($storeId, $num): DateInterval
{
Expand All @@ -123,6 +124,7 @@ public function getIntervalForCustomerEmailSeries($storeId, $num): DateInterval
* @param int $num
*
* @return DateInterval
* @throws \Exception
*/
public function getIntervalForGuestEmailSeries($storeId, $num): DateInterval
{
Expand Down Expand Up @@ -164,6 +166,7 @@ private function getUpdatedAtWindow(DateInterval $interval): array
* @param int $storeId
*
* @return DateInterval
* @throws \Exception
*/
private function getIntervalForProgramEnrolment($storeId): DateInterval
{
Expand Down
18 changes: 11 additions & 7 deletions etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,30 @@
</dynamic_addressbook>
</sync_settings>
<abandoned_carts>
<program>
<id></id>
<send_after>15</send_after>
</program>
<customers>
<enabled_1>0</enabled_1>
<send_after_1></send_after_1>
<send_after_1>15</send_after_1>
<campaign_1></campaign_1>
<enabled_2>0</enabled_2>
<send_after_2></send_after_2>
<send_after_2>1</send_after_2>
<campaign_2></campaign_2>
<enabled_3>0</enabled_3>
<send_after_3></send_after_3>
<send_after_3>1</send_after_3>
<campaign_3></campaign_3>
</customers>
<guests>
<enabled_1>0</enabled_1>
<send_after_1></send_after_1>
<send_after_1>15</send_after_1>
<campaign_1></campaign_1>
<enabled_2>0</enabled_2>
<send_after_2></send_after_2>
<send_after_2>1</send_after_2>
<campaign_2></campaign_2>
<enabled_3>0</enabled_3>
<send_after_3></send_after_3>
<send_after_3>1</send_after_3>
<campaign_3></campaign_3>
</guests>
</abandoned_carts>
Expand Down Expand Up @@ -172,7 +176,7 @@
</transactional_data>
<abandoned_carts>
<email_capture>0</email_capture>
<limits></limits>
<cart_limit>0</cart_limit>
<email_capture_newsletter>0</email_capture_newsletter>
<link_enabled>0</link_enabled>
<link_text></link_text>
Expand Down

0 comments on commit 661691b

Please sign in to comment.