Forum Replies Created

Viewing 15 replies - 1 through 15 (of 32 total)
  • Thread Starter mikethome

    (@mikethome)

    SELECT
    CONCAT('site_', sites.site_id) AS site_domain,
    o.ID AS order_number,
    DATE_FORMAT(o.post_date, '%m/%d/%Y') AS order_date,
    pm_sku.meta_value AS SKU,
    p.post_title AS product_name,
    oim_quantity.meta_value AS quantity,
    pm_cost.meta_value AS item_cost_of_goods,
    oim_price.meta_value AS item_price,
    oim_shipping.meta_value AS item_shipping,
    oim_tax.meta_value AS item_tax,
    o.post_type AS order_type,
    pm_vendorshipcost.meta_value AS lu_freight_cost
    FROM (
    SELECT 24 AS site_id UNION ALL
    SELECT 25 UNION ALL
    SELECT 35 UNION ALL
    SELECT 37 UNION ALL
    SELECT 39 UNION ALL
    SELECT 40 UNION ALL
    SELECT 41
    ) sites
    JOIN wp_posts AS o ON o.post_type = 'shop_order' AND o.post_status = 'wc-completed'
    LEFT JOIN CONCAT('wp_', sites.site_id, 'woocommerce_order_items') AS oi ON o.ID = oi.order_id LEFT JOIN CONCAT('wp', sites.site_id, 'woocommerce_order_itemmeta') AS oim_quantity ON oi.order_item_id = oim_quantity.order_item_id AND oim_quantity.meta_key = '_qty' LEFT JOIN CONCAT('wp', sites.site_id, 'woocommerce_order_itemmeta') AS oim_price ON oi.order_item_id = oim_price.order_item_id AND oim_price.meta_key = '_line_total' LEFT JOIN CONCAT('wp', sites.site_id, 'woocommerce_order_itemmeta') AS oim_shipping ON oi.order_item_id = oim_shipping.order_item_id AND oim_shipping.meta_key = '_line_shipping' LEFT JOIN CONCAT('wp', sites.site_id, 'woocommerce_order_itemmeta') AS oim_tax ON oi.order_item_id = oim_tax.order_item_id AND oim_tax.meta_key = '_line_tax' LEFT JOIN CONCAT('wp', sites.site_id, 'postmeta') AS pm_sku ON oi.order_item_id = pm_sku.post_id AND pm_sku.meta_key = '_sku' LEFT JOIN CONCAT('wp', sites.site_id, 'postmeta') AS pm_cost ON oi.order_item_id = pm_cost.post_id AND pm_cost.meta_key = '_cost_of_goods' LEFT JOIN CONCAT('wp', sites.site_id, '_postmeta') AS pm_vendorshipcost ON oi.order_item_id = pm_vendorshipcost.post_id AND pm_vendorshipcost.meta_key = 'vendorshipcost'
    Thread Starter mikethome

    (@mikethome)

    Couldn’t code be written to loop through each site? Typically the data tables have a ‘wp_XX’ prefix where the ‘XX’ represents the subdomain #. Run the query on one subdomain, concatenate the results, repeat.

    Thread Starter mikethome

    (@mikethome)

    Saif,

    Thanks for the reply. Literally found our fix 5 minutes before you posted.

    Inside woocommerce /wp-content/plugins/woocommerce/includes is the class-wc-checkout.php file. Line 433 we changed to:

    $order->set_currency( strtolower(get_woocommerce_currency()) == ‘points’ ? ‘USD’ : get_woocommerce_currency() );

    It appears to be working! If anyone sees an issue with making this modification (aside from having to modify every time there is an update), please let me know.

    a feature request that might be needed by some would be to have the ability to keep separate balances for each site. i.e. a user is a user on more than one site with different balances in each

    Thread Starter mikethome

    (@mikethome)

    already had the code below on our functions.php file.

    add_filter(‘wc_stripe_payment_intent_args’, function($args){ $args[‘currency’] = ‘USD’; return $args; }, 10);

    Still not working. Stripe is receiving the payment intent with ‘points’ as currency.

    • This reply was modified 2 years, 7 months ago by mikethome.
    Thread Starter mikethome

    (@mikethome)

    btw…we’ve updated TeraWallet to the latest version just this morning and continue to have an error. FYI this scenario appears to only occur when the order subtotal + shipping are below wallet balance and taxes push it over the top.

    Scenarios:

    1. When subtotal + shipping is greater than wallet balance, the calculations are all correct. The wallet is fully utilized and the user is prompted to use a credit card for the balance
    2. When subtotal + shipping + taxes is less than wallet balance, the calculations are correct and the wallet covers the transaction
    3. When subtotal + shipping is just less than wallet balance AND taxes pushes over wallet balance. The wallet is charged just the subtotal + shipping. Taxes are added after and the user is prompted to pay an incorrect amount while points still remain in the wallet.

    I’ve posted a similar issue on another thread but it might apply here also. Does Woo-Wallet calculate cart total including taxes? I’m finding that taxes are not included when comparing cart total to wallet balance. Therefore only product and shipping is being deducted from wallet balance even if taxes push the cart total over the wallet balance.

    Thread Starter mikethome

    (@mikethome)

    Have tested and retested and am convinced that this plugin does not include taxes when determining total to be deducted from wallet. I feel like this is an order of operations issue. The order total is only including subtotal + shipping if this evaluates as a positive number then the subtotal amount is multiplied by -1 and added to the cart as a negative item.

    Trying to work out the logic in my head since I don’t know when the plugin actually executes all of the calls in between woocommerce’s actions.

    #1 – subtotal + shipping + tax < point balance 

    total is added to cart as negative number and subtracted from point balance

    #2 – subtotal + shipping > point balance

    full point balance is depleted and subtracted from total (including taxes)

    taxes + remaining subtotal is multiplied by .03 and re-totaled

    re-total is sent to payment gateway and charged to CC

    #3 – subtotal + shipping + taxes > point balance

    only subtotal + shipping is added to cart as negative number

    only subtotal + shipping is subtracted from point balance

    taxes + cc fee are calculated and sent to payment gateway

    #3 is incorrect and we are desperately needing some help here. The entire wallet balance should be added as a negative number and depleted from the wallet.

    Thanks in advance!

    • This reply was modified 3 years, 2 months ago by mikethome.
    • This reply was modified 3 years, 2 months ago by mikethome.
    • This reply was modified 3 years, 2 months ago by mikethome.
    Thread Starter mikethome

    (@mikethome)

    Sorry about the bump, but am really in the need for some help here. Anyone else have similar issues?

    Thread Starter mikethome

    (@mikethome)

    I think we’ve found our own solution. It’s taking some custom code and we’ll probably have issues in the future when updates are released but we are very excited. Would be happy to share with you directly when we are done, if you are interested.

    Thread Starter mikethome

    (@mikethome)

    Thanks! Works great! Thank you for the speedy response!

    Any suggestions on connecting this plugin to a charting plugin or thoughts on creating those features?

    Thread Starter mikethome

    (@mikethome)

    Thread Starter mikethome

    (@mikethome)

    That appears to have worked. Thanks for your quick replies!

    Thread Starter mikethome

    (@mikethome)

    Before I can start really troubleshooting this, I noticed that I’m needing to update but unable to delete the bulk sync add-on. Any help on how to perform the delete before updating? Here is the message in the network plug-in admin page:

    There is a new version of WooMultistore available. View version 4.7.4 details. Automatic update is unavailable for this plugin.
    You need to delete the WooMultistore bulk sync addon if you are using it, bulk sync is integrated into the WooMultistore since version 4.5.0

    Thread Starter mikethome

    (@mikethome)

    Trying again manually syncing products across sites and it’s not working. Am I the only one with this issue?

Viewing 15 replies - 1 through 15 (of 32 total)