woocommerce / pinterest-for-woocommerce

A native Pinterest integration for WooCommerce. Development is managed by Ventures.
https://woocommerce.com/products/pinterest-for-woocommerce/
GNU General Public License v3.0
22 stars 9 forks source link

Update pinit.js script import to match with Pinterest documentation #984

Closed ecgan closed 5 months ago

ecgan commented 6 months ago

Changes proposed in this Pull Request:

Closes https://github.com/woocommerce/pinterest-for-woocommerce/issues/983.

In this PR, we edited the pinit.js script import code so that it matches the code provide in Pinterest documentation: https://developers.pinterest.com/docs/add-ons/save-button/.

There should be no change in functionality. Shoppers should still be able to see the Pinterest Save button in product images, and clicking on the button should open a popup window to save the product image on Pinterest.

The script import code would become like this:

<script type="text/javascript" async defer src="//assets.pinterest.com/js/pinit.js?ver=1.4.0"></script>

The only thing that is different from Pinterest documentation is the ?ver=1.4.0 at the end of the src attribute. We are keeping it as a cache busting technique.

Note: this PR is using the develop branch as the base branch, with plugin version 1.4.0 which contains the Pinterest v5 API.

Detailed test instructions:

  1. Go to the shop page, or a product page.
  2. Go to "view source" for the page.
  3. Verify that the pinit.js script is included in the page like this:
<script type="text/javascript" async defer src="//assets.pinterest.com/js/pinit.js?ver=1.4.0"></script>
  1. Verify that the Pinterest Save button still works the same. Clicking on the button should open a popup window to save the product image on Pinterest.
ecgan commented 5 months ago

Putting this PR on-hold (don't merge it). This PR should be merged after we confirm that the version 1.4.0 with Pinterest v5 API changes are all stable.

Reference: p1712579162171969/1712578878.033089-slack-CK365S85V

ecgan commented 5 months ago

As per https://github.com/woocommerce/pinterest-for-woocommerce/pull/986#issuecomment-2051890156, I have removed the status: on hold label, and I'll proceed to merge this PR.