Carl Brubaker
Forum Replies Created
-
I found a bad plugin and downgraded its version. Thanks.
Forum: Plugins
In reply to: [WooCommerce Square] Checkout form glitching, shows twice in consoleThere were no errors in the logs related to woocommerce square
Forum: Plugins
In reply to: [WooCommerce Square] Checkout form glitching, shows twice in consoleHere is the information you requested. I did not see any errors in the logs.
WordPress Environment WordPress address (URL): https://mindburndelivery.com
Site address (URL): https://mindburndelivery.com
WC Version: 7.4.0
REST API Version: ? 7.4.0
WC Blocks Version: ? 9.4.3
Action Scheduler Version: ? 3.5.4
Log Directory Writable: ?
WP Version: 6.1.1
WP Multisite: –
WP Memory Limit: 512 MB
WP Debug Mode: ?
WP Cron: ?
Language: en_US
External object cache: – Server Environment Server Info: Apache
PHP Version: 7.4.33
PHP Post Max Size: 256 MB
PHP Time Limit: 300
PHP Max Input Vars: 4000
cURL Version: 7.87.0
OpenSSL/1.1.1t SUHOSIN Installed: –
MySQL Version: 5.5.5-10.3.38-MariaDB
Max Upload Size: 256 MB
Default Timezone is UTC: ?
fsockopen/cURL: ?
SoapClient: ?
DOMDocument: ?
GZip: ?
Multibyte String: ?
Remote Post: ?
Remote Get: ? Database WC Database Version: 7.4.0
WC Database Prefix: xvaswHN5_
Total Database Size: 2.56MB
Database Data Size: 2.13MB
Database Index Size: 0.43MB
xvaswHN5_woocommerce_sessions: Data: 0.09MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_woocommerce_api_keys: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
xvaswHN5_woocommerce_attribute_taxonomies: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_woocommerce_downloadable_product_permissions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_woocommerce_order_items: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_woocommerce_order_itemmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_woocommerce_tax_rates: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_woocommerce_tax_rate_locations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_woocommerce_shipping_zones: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_woocommerce_shipping_zone_locations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_woocommerce_shipping_zone_methods: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_woocommerce_payment_tokens: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_woocommerce_payment_tokenmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_woocommerce_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_actionscheduler_actions: Data: 0.25MB + Index: 0.11MB + Engine MyISAM
xvaswHN5_actionscheduler_claims: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_actionscheduler_groups: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
xvaswHN5_actionscheduler_logs: Data: 0.18MB + Index: 0.15MB + Engine MyISAM
xvaswHN5_commentmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_comments: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
xvaswHN5_links: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_options: Data: 1.55MB + Index: 0.05MB + Engine MyISAM
xvaswHN5_postmeta: Data: 0.01MB + Index: 0.01MB + Engine MyISAM
xvaswHN5_posts: Data: 0.02MB + Index: 0.01MB + Engine MyISAM
xvaswHN5_termmeta: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
xvaswHN5_terms: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
xvaswHN5_term_relationships: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_term_taxonomy: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_usermeta: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
xvaswHN5_users: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
xvaswHN5_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_wc_admin_note_actions: Data: 0.01MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_wc_category_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_wc_customer_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_wc_download_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_wc_order_coupon_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_wc_order_product_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_wc_order_stats: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_wc_order_tax_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_wc_product_attributes_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_wc_product_download_directories: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
xvaswHN5_wc_product_meta_lookup: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
xvaswHN5_wc_rate_limits: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_wc_reserved_stock: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_wc_tax_rate_classes: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
xvaswHN5_wc_webhooks: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
xvaswHN5_woocommerce_square_customers: Data: 0.00MB + Index: 0.00MB + Engine MyISAM Post Type Counts attachment: 1
page: 8
post: 2
product: 1
revision: 6
wp_global_styles: 1 Security Secure connection (HTTPS): ?
Hide errors from visitors: ?Error messages should not be shown to visitors. Active Plugins (9) Disable XML-RPC: by Philip Erb – 1.0.1
Mindburn Delivery: by Mindburn Solutions – 1.0.0
Order Delivery Date for WooCommerce (Lite version): by Tyche Softwares – 3.19.0
Shipday Integration for WordPress (WooCommerce): by – 1.4.0
Checkout Field Editor for WooCommerce: by ThemeHigh – 1.8.1
WooCommerce Square: by WooCommerce – 3.5.0
WooCommerce: by Automattic – 7.4.0
WP Remote: by WP Remote – 4.87
WPS Hide Login: by WPServeur
NicolasKulka
wpformation – 1.9.8 Inactive Plugins (3) Check My Address for WooCommerce: by Arosoft.se – 1.4.4
Shipping Zones by Drawing Premium for WooCommerce: by Arosoft.se – 2.8.1.3
Shortcodes for Divi: by WP Zone – 1.2.2 Settings API Enabled: –
Force SSL: –
Currency: USD ($)
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 2
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5) Connected to WooCommerce.com: –
Enforce Approved Product Download Directories: ?
Order datastore: WC_Order_Data_Store_CPT WC Pages Shop base: #6 - /shop/
Cart: #7 - /cart/
Checkout: #8 - /checkout/
My account: #9 - /my-account/
Terms and conditions: ? Page not set Theme Name: Storefront
Version: 4.2.0
Author URL: https://woocommerce.com/
Child Theme: ? – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme
WooCommerce Support: ? Templates Overrides: – Square Environment: Production
Tokenization Enabled: –
Debug Mode: Off Admin Enabled Features: activity-panels
analytics
coupons
customer-effort-score-tracks
import-products-task
experimental-fashion-sample-products
shipping-smart-defaults
shipping-setting-tour
homescreen
marketing
multichannel-marketing
mobile-app-banner
navigation
new-product-management-experience
onboarding
onboarding-tasks
remote-inbox-notifications
remote-free-extensions
payment-gateway-suggestions
shipping-label-banner
subscriptions
store-alerts
transient-notices
woo-mobile-welcome
wc-pay-promotion
wc-pay-welcome-page Disabled Features: minified-js
product-variation-management
settings Daily Cron: ? Next scheduled: 2023-02-17 19:44:26 +00:00
Options: ?
Notes: 43
Onboarding: completed Action Scheduler Complete: 1,091
Oldest: 2023-01-30 21:41:28 +0000
Newest: 2023-02-17 12:57:04 +0000 Failed: 5
Oldest: 2023-02-15 14:30:28 +0000
Newest: 2023-02-17 12:20:38 +0000 Pending: 4
Oldest: 2023-02-17 13:57:04 +0000
Newest: 2023-02-21 19:15:32 +0000 Status report information Generated at: 2023-02-17 13:28:41 +00:00
`Forum: Plugins
In reply to: [WooCommerce Square] Checkout form glitching, shows twice in consoleHi @xue28
Apparently the issue has not been resolve. I just started working on this site again today and the issue reappeared with the Storefront theme. I disabled all the plugins except for WooCommerce and WooCommerce Square. The issue went away. I started activating plugins and found that it came back if two or three other plugins were activated. It didn’t matter which ones. It was even affected by plugins that have nothing to do with WooCommerce. I don’t know if you have any other ideas on how to resolve this. Maybe this is just par for the course with WordPress.
Forum: Plugins
In reply to: [WooCommerce Square] Checkout form glitching, shows twice in console@ihereira that did make a difference. I guess I should ask the theme maker about this issue?
Side Note: ?wc-ajax=square_digital_wallet_get_payment_request is still triggered twice
- This reply was modified 2 years ago by Carl Brubaker. Reason: added information
@lorro ok, so then how to I display different labels for Billing and Shipping Address?
Thanks, that indeed was the issue.
I have tried multiple appearances on the form and none of them displayed correctly.
Thanks,
CarlForum: Plugins
In reply to: [WooCommerce Square] Imported variation attributes saving oddly@3sonsdevelopment Sorry, I forgot to post back. It’s the way Square saves them. Here was my solution:
add_action( 'woocommerce_square_create_product_data', [$this, 'action_remove_redundant_attribute_name_prefix'] ); public function action_remove_redundant_attribute_name_prefix($data) { if (!array_key_exists('type', $data) || $data['type'] !== 'variable') { return $data; } $old_options = []; $new_options = []; foreach ($data['variations'] as $k => $v) { $old_name = $v['name']; $old_options[] = $old_name; $exploded = explode(' - ', $old_name); $new_name = (count($exploded) > 1) ? $exploded[1] : $old_name; $data['variations'][$k]['name'] = $new_name; foreach ($v['attributes'] as $ak => $av) { if ($av['option'] && $av['option'] === $old_name) { $data['variations'][$k]['attributes'][$ak]['option'] = $new_name; } } $new_options[] = $new_name; } foreach ($data['attributes'] as $dak => $dav) { if ($dav['options'] && $dav['options'] === $old_options) { $data['attributes'][$dak]['options'] = $new_options; } } return $data; }
In case someone else runs into this issue:
function removeExtraSquareInputOnCheckoutPage() { const squareWrapper = document.querySelector(<code>#payment</code>); const observer = new MutationObserver(async () => { let numberOfInputs = 0; let numberOfSelectorQueries = 0; do { await delay(1000); const squareInputs = document.querySelectorAll(<code>.sq-card-wrapper</code>); numberOfSelectorQueries++; numberOfInputs = squareInputs.length; if (numberOfInputs > 1) { let i = 0; squareInputs.forEach(input => { if (i > 0) { console.log(<code>Deleted duplicate Square Input</code>); input.remove(); } i++; }); } } while (numberOfInputs < 1 && numberOfSelectorQueries < 10); }); observer.observe(squareWrapper, {childList: true}); } async function delay(delayTime) { return new Promise(resolve => setTimeout(resolve, delayTime)); }
Forum: Plugins
In reply to: [WooCommerce Square] Credit card input is displaying twice at checkout.In case someone else runs into this issue, here is a script to remove it.
function removeExtraSquareInputOnCheckoutPage() { const squareWrapper = document.querySelector(<code>#payment</code>); const observer = new MutationObserver(async () => { let numberOfInputs = 0; let numberOfSelectorQueries = 0; do { await delay(1000); const squareInputs = document.querySelectorAll(<code>.sq-card-wrapper</code>); numberOfSelectorQueries++; numberOfInputs = squareInputs.length; if (numberOfInputs > 1) { let i = 0; squareInputs.forEach(input => { if (i > 0) { console.log(<code>Deleted duplicate Square Input</code>); input.remove(); } i++; }); } } while (numberOfInputs < 1 && numberOfSelectorQueries < 10); }); observer.observe(squareWrapper, {childList: true}); } async function delay(delayTime) { return new Promise(resolve => setTimeout(resolve, delayTime)); }
I figured out an issue with the WooCommerce Square plugin, but the above condition is
true
even whenoption_selected != "on"
and I am not on the cart page. Is this correct?Forum: Plugins
In reply to: [WooCommerce Square] Credit card input is displaying twice at checkout.I did some tracing. There Square form is created by a listener in
wc-square.min.js
. When the event is triggered twice in a short time it is able to create a second input. Because there is no existingthis.payment_form
it does not trigger the destroy. Here is the logging trace of events betweenwc-square.min.js
and the square resource.wc-square.min.js: handle_checkout_page wc-square.min.js: updated_checkout Listener wc-square.min.js: set_payment_fields wc-square.min.js: this.payment_form: undefined square.js: card wc-square.min.js: updated_checkout Listener wc-square.min.js: set_payment_fields wc-square.min.js: this.payment_form: undefined square.js: card square.js: attach square.js: buildElementOnIframe square.js: buildCardElement square.js: attach square.js: buildElementOnIframe square.js: buildCardElement
When the listener is called once the form is already loaded it only displays once.
wc-square.min.js: updated_checkout Listener wc-square.min.js: set_payment_fields wc-square.min.js: this.payment_form: [object Object] square.js: card square.js: attach square.js: buildElementOnIframe square.js: buildCardElement
wc-square.min.js listener:
handle_checkout_page() { console.log("wc-square.min.js: handle_checkout_page"); $(document.body).on("updated_checkout", e => { console.log("wc-square.min.js: updated_checkout Listener"); this.set_payment_fields(); }); $(document.body).on("updated_checkout", () => this.handle_saved_payment_methods()); this.form.on("checkout_place_order_".concat(this.id), () => this.validate_payment_data()); }
Forum: Plugins
In reply to: [WooCommerce Square] Credit card input is displaying twice at checkout.Hi @nawaz0705
That of course is the easy solution, however it is also possible that it is refreshing fast enough that one of your scripts is loading it twice. If the page loads slower it does not happen. For some reason there is a double iframe. I don’t know how the other plugin would do this. This is what the HTML looks like:
<div id="wc-square-credit-card-container"> <div id="single-card-wrapper-09ad3e1c-9ebc-211a-9340-3626eb7f71b9" class="sq-card-wrapper"> <div class="sq-card-iframe-container" style="height: 48px;"><iframe name="single-card-09ad3e1c-9ebc-211a-9340-3626eb7f71b9" scrolling="no" src="https://sandbox.web.squarecdn.com/1.32.0/single-card-element-iframe.html" class="sq-card-component" width="100%" height="48px" frameborder="0"></iframe></div><span class="sq-card-message"></span> </div> <div id="single-card-wrapper-887a1ad3-7174-fceb-2386-b8102856a7b8" class="sq-card-wrapper"> <div class="sq-card-iframe-container" style="height: 48px;"><iframe name="single-card-887a1ad3-7174-fceb-2386-b8102856a7b8" scrolling="no" src="https://sandbox.web.squarecdn.com/1.32.0/single-card-element-iframe.html" class="sq-card-component" width="100%" height="48px" frameborder="0"></iframe></div><span class="sq-card-message"></span> </div> </div>
- This reply was modified 2 years, 9 months ago by Carl Brubaker.
Forum: Plugins
In reply to: [WooCommerce Square] Credit card input is displaying twice at checkout.