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

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

Loop though the Cart items

Looping through the Cart Items is straightforward and achievable through the code: When the cart include products from different shops ( within the MultiSite Network ), the same code can be used. Still, a...

View More

Update cart-shipping template, when using “Calculate Shipping costs for each Shops” option

As default, when using Single Shop Check-out type, WooCommerce calculates the shipping costs globally for all products in the cart, independently of the origin of the item, to what shop it belongs in the network. The used shipping rules and rates are the one's set up on the shop being used for the check-out process. This is enough for most shop administrators, if providing a single package with all customer items. The new functionality controlled through the Calculate Shipping...

View More

Redirect all Carts to a specific Shop Cart

Each of the Network Shops run their own cart page. This can be changed so the cart link redirects the user to a specific Shop Cart in the network, which is usually the Check-out Shop, when using Single Site Check-out type. The feature can be achieved through a custom code. The WOOGC_REQUIRED_CART_URL value should be updated with the required shop cart URL: <?php define('WOOGC_REQUIRED_CART_URL', ...

View More

Send email notification to Shop Owner, if a product was checked-out on a different site

When using Single Site Check-out type, the Global Cart is being processed at a specified shop in the network or one at the customer preference. All Products will be included in a single order created on the site where the check-out occurs. On shop Networks, where the owner chose to use Shop Managers to allow individual sites to be run by individual users, when a new Order is created on the Check-out Shop, a notification e-mail might be required to...

View More

woogc/network_orders/get_orders/mysql_query/WHERE

Name: woogc/network_orders/get_orders/mysql_query/WHERE Type: Filter Arguments: $mysql_query, $blog_id The filter can be used to modify the MySQL query used by the Network Orders interface to output the orders from all shops. The following code example shows only the orders for shop_manager roles, from shops where the user have access : add_filter ( 'woogc/network_orders/get_orders/mysql_query/WHERE', '_custom_network_orders_mysql_query_WHERE_2', 10, 2 ); function _custom_network_orders_mysql_query_WHERE_2 ( $mysql_query, $blog_id ) { ...

View More

woogc/show_network_orders

Name: woogc/show_network_orders Type: Filter Arguments: $status The filter can be used to show the Network Orders interface to other shops in the MultiSite environment. The following code example, show the interface for shops ID's 2 and 3: add_filter('woogc/show_network_orders', 'WooGC_show_network_orders'); function WooGC_show_network_orders( $status ) { global $blog_id; ...

View More

wogc/admin/manage_shop_order_column_data

Name: wogc/admin/manage_shop_order_column_data Type: Action Arguments: $post, $column_name The filter can be used to render data for a custom created column on SuperAdmin Orders interface. The following example render html for column called Products add_action('wogc/admin/manage_shop_order_column_data', 'custom_wogc_admin_manage_shop_order_column_data', 10, 2); function custom_wogc_admin_manage_shop_order_column_data( $post, $column_name ) { if ( $column_name != 'products') ...

View More