Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)
  • mnkhalid

    (@mnkhalid)

    @subratamal I think what the op wanted to communicate was this scenario, which I faced as well.

    for a 100% Cashback Coupon

    Sub Total : 299
    Cashback: -299
    Total: 299

    But when you go to the payment page, the total becomes 598.

    I was able to fix this by editing the ./includes/class-woo-wallet-frontend.php file in the following section of the code. By commenting out this line “$order->set_total( $order->get_total( ‘edit’ ) + $_coupon_cashback_amount );”

    For anyone else looking for this issue, “Tera Wallet / Woo Wallet Coupon Cashback adding cashback value to order total”

    to the plugin author, see if this fix can be updated to the plugin code in the next update.

    ? ?/**

    ? ? ? ? ?* Handel cashback calculation on order processed hook

    ? ? ? ? ?*

    ? ? ? ? ?* @param int ? ? @param WC_Order|int $order order.

    ? ? ? ? ?*/

    ? ? ? ? public function checkout_order_processed( $order ) {

    ? ? ? ? ? ? if ( ! $order instanceof WC_Order ) {

    ? ? ? ? ? ? ? ? $order = wc_get_order( $order );

    ? ? ? ? ? ? }

    ? ? ? ? ? ? $cashback_amount = woo_wallet()->cashback->calculate_cashback();

    ? ? ? ? ? ? if ( $cashback_amount && ! is_wallet_rechargeable_order( wc_get_order( $order->get_id() ) ) && is_user_logged_in() ) {

    ? ? ? ? ? ? ? ? WOO_Wallet_Helper::update_order_meta_data( $order->get_id(), '_wallet_cashback', $cashback_amount );

    ? ? ? ? ? ? }

    ? ? ? ? ? ? $_coupon_cashback_amount = 0;

    ? ? ? ? ? ? foreach ( WC()->cart->get_coupons() as $code => $coupon ) {

    ? ? ? ? ? ? ? ? $coupon_id ? ? ? ? ? = $coupon->get_id();

    ? ? ? ? ? ? ? ? $_is_coupon_cashback = get_post_meta( $coupon_id, '_is_coupon_cashback', true );

    ? ? ? ? ? ? ? ? if ( 'yes' === $_is_coupon_cashback && is_user_logged_in() ) {

    ? ? ? ? ? ? ? ? ? ? $_coupon_cashback_amount += WC()->cart->get_coupon_discount_amount( $code, WC()->cart->display_cart_ex_tax );

    ? ? ? ? ? ? ? ? }

    ? ? ? ? ? ? }

    ? ? ? ? ? ? if ( $_coupon_cashback_amount ) {

    ? ? ? ? ? ? ? ? $discount_total ?= $order->get_discount_total( 'edit' );

    ? ? ? ? ? ? ? ? $discount_total -= $_coupon_cashback_amount;

    ? ? ? ? ? ? ? ? $order->set_discount_total( $discount_total );

    ? ? ? ? ? ? ? ? // $order->set_total( $order->get_total( 'edit' ) + $_coupon_cashback_amount );

    ? ? ? ? ? ? ? ? WOO_Wallet_Helper::update_order_meta_data( $order, '_coupon_cashback_amount', $_coupon_cashback_amount );

    ? ? ? ? ? ? }

    ? ? ? ? }



    Thread Starter mnkhalid

    (@mnkhalid)

    thank you for the heads up on mysql. I am currently using a 2vCPU + 8GB Ram instance on Amazon Lightsail along with a 1 vCPU + 2GB Ram Lightsail Managed Database.

    I get about 1000 visitors per day with about 30-40 orders. I am considering moving to a local VPS provider offering 6 core 15 gb and the SELECT 1 query running on workbench gave me the following results.

    Lightsail managed database – 16 miliseconds

    VPS (6 core + 15 gb) with mysql running on localhost currently at almost no traffic. 15 miliseconds.

    i couldnt find anything on the internet on this. I’ll look for more.

    thanks again for the completely new information.

    Thread Starter mnkhalid

    (@mnkhalid)

    @olliejones uploaded the metadata with id – FKYvvgC6

    @rjasdfiii here is the output for

    wp_GD3z9A_drm_in_ is my custom table prefix (ofcourse not sharing the original, but formatted kind of like this, i have just changed the characters) in case that is relevant.

    CREATE TABLEwp_GD3z9A_drm_in_options` (
    option_id bigint unsigned NOT NULL AUTO_INCREMENT,
    option_name varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT ”,
    option_value longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL,
    autoload varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT ‘yes’,
    PRIMARY KEY (option_name),
    UNIQUE KEY option_id (option_id),
    KEY autoload (autoload)
    ) ENGINE=InnoDB AUTO_INCREMENT=17047358 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci`

    Thread Starter mnkhalid

    (@mnkhalid)

    So I manually dropped the two indexes “UNIQUE” and “INDEX” using mysql workbench and run the cli command for enabled and it worked successfully.

    Thread Starter mnkhalid

    (@mnkhalid)

    link to where it occured, and it seems to occuring quite frequently –

    https://forevermuslim.in/wp-admin/edit.php?s=&post_status=all&post_type=shop_order&_wpnonce=76019cc5fd&_wp_http_referer=%2Fwp-admin%2Fedit.php%3Fpost_status%3Dall%26post_type%3Dshop_order%26_customer_user%3D13178&action=wuoc_combine&m=0&_customer_user=13178&paged=1

    +1 to this, the reports completely unrealistic. I am using a manual payment method where in orders are put on hold and the customer makes a payment using a payment app and we push these orders as processing and all these order are getting marked as recovered.

    Hello Please email me the Custom Post type Supported version of the plugin on [email address moderated – these forums do not provide support via email]

    Thread Starter mnkhalid

    (@mnkhalid)

    I would really appreciate if you could provide me with custom code for Nextend Google and Twitter connect as well. As along with facebook am also using google and twiiter connect.

    More over the method i used for W3 TC is not a substantial one because each time i change the settings of the BPS i get the same error back that W3 TC is unable to automatically update the htaccess file please update it via FTP.

    Any bypass code for that as well?

    Regards

    Thread Starter mnkhalid

    (@mnkhalid)

    its not visible
    i tried everything possible

    i mean the star box is visble on custom post type page..

    but it doesnt display the latest posts of the author. when i click on latest post there is nothing .

    Hi

    How to enable posting Custom Post types to my facebook page

    Forum: Hacks
    In reply to: custom content for users
    Thread Starter mnkhalid

    (@mnkhalid)

    Hi
    Thanks for your reply ..i am just a beginner to wordpress and coding ..and it seems ill have to do some learning before i can implement your method. I can definitely do that as after searching all the web i could not find a plugin or a readymade solution for it. Thank you ??

Viewing 11 replies - 1 through 11 (of 11 total)