Skip to content

Updating some MBE params used by MiCE solution#2925

Merged
jczhuoMeta merged 1 commit intoMICE-4from
MICE-4-param-update
Mar 6, 2025
Merged

Updating some MBE params used by MiCE solution#2925
jczhuoMeta merged 1 commit intoMICE-4from
MICE-4-param-update

Conversation

@jczhuoMeta
Copy link
Copy Markdown
Contributor

@jczhuoMeta jczhuoMeta commented Mar 6, 2025

  1. Modifying some params used by MiCE solution.
    a. Default Business name -> something meaningful
    b. Timezone to non-fixed timezone
    c. Update the client token to actually Woo's token. It was using Magento's token
    d. Adding platform_store_id
  2. Also updated the API version: V18 -> V22

Testing:

./vendor/bin/phpunit tests/Unit/Handlers/MetaExtensionTest.php

Installing...
Running as single site... To run multisite, use -c tests/phpunit/multisite.xml
Installing WooCommerce...
Not running ajax tests. To execute these, use --group ajax.
Not running ms-files tests. To execute these, use --group ms-files.
Not running external-http tests. To execute these, use --group external-http.
PHPUnit 9.6.19 by Sebastian Bergmann and contributors.

.......                                                             7 / 7 (100%)

Time: 00:00.656, Memory: 95.00 MB

Manual test:
image
Resulting URL:

{
  "client_id": 474166926521348,
  "display": "popup",
  "extras": {
    "business_config": {
      "business": {
        "name": "WooMeta"
      }
    },
    "repeat": false,
    "setup": {
      "business_vertical": "ECOMMERCE",
      "channel": "COMMERCE",
      "currency": "USD",
      "domain": "http://localhost:10009/",
      "external_business_id": "woometa-67bd40a6d219d",
      "external_client_metadata": {
        "admin_url": "http://localhost:10009/wp-admin/",
        "client_version": "3.4.1",
        "commerce_partner_seller_platform_type": "SELF_SERVE_PLATFORM",
        "country_code": "US",
        "feature_set_eligibility": "SHOP_FIRST",
        "platform_store_id": "1",
        "shop_domain": "http://localhost:10009/shop/"
      },
      "timezone": " 00:00"
    }
  },
  "redirect_uri": "https://www.commercepartnerhub.com/commerce_extension/splash/oauth_redirect_handler/",
  "response_type": "token",
  "scope": "manage_business_extension,business_management,ads_management,pages_read_engagement,catalog_management",
  "state": "648eb712-3a11-4e67-9abc-ab4d3228981a"
}

@jczhuoMeta jczhuoMeta requested a review from sol-loup March 6, 2025 00:33
@jczhuoMeta jczhuoMeta marked this pull request as ready for review March 6, 2025 00:33
@jczhuoMeta jczhuoMeta merged commit d0aa0ce into MICE-4 Mar 6, 2025
4 checks passed
@jczhuoMeta jczhuoMeta deleted the MICE-4-param-update branch March 6, 2025 01:00
$connection_handler = facebook_for_woocommerce()->get_connection_handler();
$external_client_metadata = array(
'shop_domain' => wc_get_page_permalink( 'shop' ) ? wc_get_page_permalink( 'shop' ) : \home_url(),
'shop_domain' => wc_get_page_permalink( 'shop' ),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious -- do you think we can discard the fallback?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wc_get_page_permalink
https://hooks.wbcomdesigns.com/reference/functions/wc_get_page_permalink/

This one already contains the fallback. Remove to keep the code cleaner

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants