mnkhalid
Forum Replies Created
-
@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 );
? ? ? ? ? ? }
? ? ? ? }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.
@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 TABLE
wp_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 KEYoption_id
(option_id
),
KEYautoload
(autoload
)
) ENGINE=InnoDB AUTO_INCREMENT=17047358 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci`So I manually dropped the two indexes “UNIQUE” and “INDEX” using mysql workbench and run the cli command for enabled and it worked successfully.
Forum: Plugins
In reply to: [Ultimate Order Combination] Fatal Errorlink 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.
Forum: Plugins
In reply to: [WordPress Related Posts] How use this plugin with custom post type ?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]
Forum: Plugins
In reply to: [BulletProof Security] Conflict with Nextend Facebook LoginI 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
Forum: Plugins
In reply to: [Starbox - the Author Box for Humans] show custome post types in author postits not visible
i tried everything possiblei 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 .
Forum: Plugins
In reply to: [WPBook Lite] Facebook app does not display anythingHi
How to enable posting Custom Post types to my facebook page
Forum: Hacks
In reply to: custom content for usersHi
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 ??