Search
Code Example Archives - WP Global Cart
326
archive,tax-documentation_tag,term-code-example,term-326,theme-awake,eltd-core-1.1,woocommerce-no-js,awake child-child-ver-1.0.0,awake-ver-1.0,eltd-smooth-scroll,eltd-smooth-page-transitions,eltd-mimic-ajax,eltd-grid-1200,eltd-blog-installed,eltd-default-style,eltd-fade-push-text-top,eltd-header-standard,eltd-sticky-header-on-scroll-down-up,eltd-default-mobile-header,eltd-sticky-up-mobile-header,eltd-menu-item-first-level-bg-color,eltd-dropdown-slide-from-top,eltd-,eltd-fullscreen-search eltd-search-fade,eltd-side-menu-slide-from-right,wpb-js-composer js-comp-ver-6.3.0,vc_responsive
 

Archive

woogc/global_cart/sites

Name: woogc/global_cart/sites Type: Filter Arguments: (array) $sites_ids The following code snippet demonstrates how to synchronize the current shop with only the designated checkout site. This selective synchronization is particularly useful when you want to minimize the number of shops involved in the network, ensuring that only the current site and the checkout site are synced. This approach optimizes performance and reduces unnecessary data transfer, focusing the synchronization process on the essential sites only. By utilizing the woogc/global_cart/sites filter, you can easily define which sites...

View More

Get the network Total Sales for a synchronized product

The WooCommerce Global Cart offers a powerful solution for businesses operating multiple online stores within a WordPress Multisite network. By synchronizing products across these shops, merchants can ensure consistency in product offerings while simplifying inventory management. However, one challenge that arises with this setup is the need to accurately track sales for synchronized products across the entire network. To address this challenge, developers can implement custom functions to retrieve essential data, such as the total number of network sales for...

View More

woogc/ps/interfaces/sync_to_shop

Name: woogc/ps/interfaces/sync_to_shop Type: Filter Arguments: $status, $remote_blog_id, $post The filter can be used to change the synchronization interface button status from active to inactive or vice versa. For example, when creating a new product, the buttons will show up active as default: add_filter ( 'woogc/ps/interfaces/sync_to_shop', 'woogc_ps_interfaces_option_status', 10, 3 ); add_filter ( 'woogc/ps/interfaces/maintain_child', 'woogc_ps_interfaces_option_status', 10, 3 ); add_filter ( 'woogc/ps/interfaces/maintain_categories', 'woogc_ps_interfaces_option_status',...

View More

woogc/ps/interfaces/synchronize_to_sites

Name: woogc/ps/interfaces/synchronize_to_sites Type: Filter Arguments: $sites The filter allows you to regulate the shops that are accessible within the Synchronization Interface, determining where the feature is available. The following example check if the edit page is for product ID 33 and 44. If match, it disable the synchronization option to the Shop ID 2: add_filter ( 'woogc/ps/interfaces/synchronize_to_sites', 'woogc_ps_interfaces_synchronize_to_sites' ); function woogc_ps_interfaces_synchronize_to_sites( $sites ) { ...

View More

Redirect to origin shop on Order Received, when using Single Checkout with Split

When utilizing the Single Checkout option, all products within the global cart undergo processing within a designated shop. Conversely, when opting for the Split function, individual orders are generated within each of the shops that contributed products to the cart. Upon the completion of the checkout process, a page titled 'Order Received' is presented to the customer. To seamlessly redirect the customer to the 'Order Received' page hosted on the shop where the origin product was located, you can make use...

View More

How to control the sent emails when using the Single Checkout with Split

The capability to Split Orders is a valuable resource when dealing with independent shop administrators and vendors. It enables the creation of orders divided by-products from different shops within the network. As a result, each shop that has contributed products to the cart will receive an order comprised solely of its own products. WooCommerce is designed to automatically send relevant email notifications for every order placed. However, in some situations, this automatic notification system may not be suitable, requiring greater...

View More

When Splitting the order, show only split transactions on the checkout shop

Splitting Orders, is a powerful tool when working with separate shop managers and merchants. That helps to create split orders with products that belong to different shops in the network. So each of the shops that had at least one product in the cart, will receive an order with its own products. A split can be ignored for the shop, where the check-out occurs. Or the main order can be hidden, on the checkout site and show the split...

View More

Implement network-wide WooCommerce Tax settings

WooCommerce Tax area provides the necessary tools to create the required taxation for on-sale products. Setting up Taxes in WooCommerce is straightforward, through WooCommerce > Settings > Tax interface: Different tax classes and appropriate Rates, per specific Country, State, Zip, City etc area configurable: On check-out, the current shop tax set-up applies to all products in the shopping cart. The check-out location is settable through the plugin options, or this can be free to choose by the customer. I such case,...

View More

woogc/get_cart_from_session/validate_hash

Name: woogc/get_cart_from_session/validate_hash Type: Filter Arguments: $force_validation, $values When reconstructing the cart from session data, WooCommerce checks each of the products for validation. That includes existence, quantity, purchaseability, data hash. It happens, if a plugin implements a custom product type, if not active/available for a specific shop, the WooCommerce removes it from the cart. This is caused by a data hash that does not match anymore. This filter can be used to force hash validity for specific products in the cart. For example, if using the...

View More

Run JavaScript code on Synchronization screen complete

On the Synchronization screen complete, custom JavaScript can run. To achieve this, the following code is required within a js file, that is loaded along the page: document.addEventListener( 'woogc/sync-done' , function (e) { alert ('Triggered Event sync-done'); //further JavaScript code ...

View More