Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

Woocommerce Deposit plugin customization

raymundpogi

Symbianize Shaman
Advanced Member
Messages
1,529
Reaction score
2
Points
28
Hi guys. Tanong lang baka merong marunong sainyo neto

Sa Woocommerce Deposit file na woocommerce-deposits/includes/class-wc-deposits-product-manager.php

Mayroong code na ganto ang structure

Code:
class WC_Deposits_Product_Manager {
    public static function get_formatted_deposit_amount( $product_id ) {
         // some code here
    }
}

Balak ko kasi parang i-override yang class method na 'get_formatted_deposit_amount()'. Pano ko kaya to gagawin? Wala akong makita na hook para diyan :(

- - - Updated - - -

Anyway, already found a workaround.

Bale yung part kasi na "per item" ang gusto kong tanggalin
View attachment 350499

Tapos yung line na yun nandito "woocommerce-deposits/includes/class-wc-deposits-product-manager.php"

Mapapansin niyo na under to ng "includes" directory so di magwowork ang copy-paste file sa child theme

Luckily, yung tumawag kay get_formatted_deposit_amount() ay nandito "woocommerce-deposits/template/deposit-form.php". So pwede na nating ioverride sa child theme yung file.

From the previous code
Code:
<?php echo WC_Deposits_Product_Manager::get_formatted_deposit_amount( $post->ID ); ?>

Changed to
Code:
<?php echo preg_replace('/per.*/', '', WC_Deposits_Product_Manager::get_formatted_deposit_amount( $post->ID )); ?>

So meron na ako ngayong changes na di maapektuhan kapag nag update yung Woocommerce Deposits plugin :thumbsup:
 

Attachments

  • per item.png
    per item.png
    11.1 KB · Views: 1
Last edited:
Back
Top Bottom