Skip to content

Send cartInsight on when cart totals is updated via ajax#25

Closed
KristoferN wants to merge 33 commits intodotmailer:developfrom
KristoferN:feature/send-insights-on-updated-cart
Closed

Send cartInsight on when cart totals is updated via ajax#25
KristoferN wants to merge 33 commits intodotmailer:developfrom
KristoferN:feature/send-insights-on-updated-cart

Conversation

@KristoferN
Copy link
Copy Markdown

Update cart insight when changing cart contents via ajax.

sta1r and others added 30 commits September 8, 2021 09:14
## What's being changed

This PR updates the plugin readme files.

## Why it's being changed

Inside WordPress, the readme.txt presents the text users see when browsing the plugin repository. I've updated that file, leaving some basic info in the original README.md.

## How to review / test this change

- Read the text

Related work items: #152608
## What's being changed

We've added extra logic to prevent the enqueuing of public scripts (and the running of related code) in the WordPress admin.

## Why it's being changed

WordPress's new block-based widget manager (introduced in 5.8) deliberately enqueues public styles and scripts in order to offer a preview of a widget before publishing. This led to a fatal error in our code when we check for an active Woo customer.

## How to review / test this change

- Use WP debug mode
- Add the dotdigital for WooCommerce signup form as a legacy widget
- Ensure no errors are visible on the page

Related work items: #154241
Update composer.json to match the latest version.

Related work items: #154614
## What's being changed

- Added stable tag field
- Updated contributors field

## Why it's being changed

WordPress recommends that readme.txt has a 'Stable tag' field: https://developer.wordpress.org/plugins/wordpress-org/how-to-use-subversion/#tagging-new-versions

Related work items: #154744
## What's being changed

The installation instructions in readme.txt.

## Why it's being changed

Once the plugin is available via the plugins directory, downloading from Github and unzipping etc. won't be necessary.

Related work items: #153915
## What's being changed

Our main admin and widget classes.

## Why it's being changed

WordPress had some feedback on our code at submission to the plugins directory. We needed to escape all variables and options when output, and our approach to this wasn't 100% thorough.

Use of the `extract()` method has been removed from the widget class, this is strongly discouraged in the coding standards report (which we were conveniently ignoring).

## How to review / test this change

- Review all the admin settings, check all the controls function as expected
- Review the widget controls in the admin (do all the inputs still work?)
- Review the widget output and function on the front end (does the form still display correctly and submit?)

Related work items: #155124
1.2.1 is a point release to keep master in step with what we're submitting to WordPress.

Related work items: #155236
## What's being changed

PLUGIN_DIR_PATH > DOTDIGITAL_FOR_WOOCOMMERCE_PLUGIN_DIR_PATH

## Why it's being changed

PLUGIN_DIR_PATH is too generic, our globals must be more tightly tied to our plugin. Request from WordPress for submission to plugin directory.

## How to review / test this change

- Confirm the autoloader works as expected

Related work items: #155734
## What's being changed

We've replaced `sanitize_text_field` with `sanitize_email` for handling an email input.

## Why it's being changed

Flagged in submission to plugins directory.

## How to review / test this change

- Register an email address via My Account
- Ensure the address is stored in wp_dd_subscribers

Related work items: #155833
Final readme updates for plugin directory submission.

Related work items: #156293
Release notes and version updates for 1.3.0.

Related work items: #157716
Bumps [shelljs](https://github.com/shelljs/shelljs) from 0.8.4 to 0.8.5.
- [Release notes](https://github.com/shelljs/shelljs/releases)
- [Changelog](https://github.com/shelljs/shelljs/blob/master/CHANGELOG.md)
- [Commits](shelljs/shelljs@v0.8.4...v0.8.5)

---
updated-dependencies:
- dependency-name: shelljs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
…n/shelljs-0.8.5

Bump shelljs from 0.8.4 to 0.8.5
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.6 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Commits](node-fetch/node-fetch@v2.6.6...v2.6.7)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
…n/node-fetch-2.6.7

Bump node-fetch from 2.6.6 to 2.6.7
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
…n/minimist-1.2.6

Bump minimist from 1.2.5 to 1.2.6
## What's being changed

We've updated our compatibility with newer versions of WordPress and WooCommerce. The `WC requires at least` and `WC tested up to` tags have been moved to the main plugin file, because Woo only respects these, and doesn't look in readme.txt.

## Why it's being changed

We've tested the plugin against WordPress v6.0 and WooCommerce 6.5.1.

## How to review / test this change

- Download a 3.3.x Woo from https://developer.woocommerce.com/releases/
- Install locally
- On the plugins page, you shouldn't see any warnings by the invitation to upgrade WooCommerce (e.g. 'Dotdigital for WooCommerce has not been tested against the newer version of WooCommerce')

Related work items: #175984
…items

## What's being changed

Cart insight data.

## Why it's being changed

Cart insight line items' `salePrice` property is supposed to be the price paid by the customer at checkout (i.e. it can reflect a discount). In Woo, if there is no discount or sale on an item, `$product->get_sale_price()` returns an empty string. This change uses the regular price for the sale price, in these cases.

## How to review / test this change

- Add a full price item to the basket
- Add a sale item to the basket
- Check the cart insight posted has the expected values for `salePrice` for both line items

Related work items: #177402
Release note and version updates.

Related work items: #177651
@sta1r sta1r changed the base branch from master to develop July 14, 2023 08:45
…mmerce into feature/send-insights-on-updated-cart
@sta1r
Copy link
Copy Markdown
Contributor

sta1r commented Jul 14, 2023

@KristoferN Apologies - we missed your PRs! I'm happy to approve this, but first is it possible to redo your PR into latest develop? We have some commits included here that we don't need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants