Skip to content

Instantly share code, notes, and snippets.

View tongdaitructuyen's full-sized avatar

Martino Hugo tongdaitructuyen

View GitHub Profile
@tongdaitructuyen
tongdaitructuyen / functions.php
Created February 19, 2022 11:21
Cách thêm biểu tượng loại bỏ (xóa) sản phẩm trong trang thanh toán WooCommerce >>> https://www.mycomputer.vn/cach-them-bieu-tuong-loai-bo-xoa-san-pham-vao-trang-thanh-toan-woocommerce/
/**
* Add Remove button to WooCommerce checkout page - cart items
*/
add_filter('woocommerce_cart_item_name', 'mycomputer_filter_wc_cart_item_remove_link', 10, 3);
function mycomputer_filter_wc_cart_item_remove_link($product_name, $cart_item, $cart_item_key)
{
if (is_checkout()) {
@tongdaitructuyen
tongdaitructuyen / class-wc-gateway-paypal-ipn-handler.php
Created February 17, 2022 09:22
Xử lý lỗi đơn hàng không tự động hoàn tất - Hướng dẫn cách tạo thanh toán PayPal bằng VNĐ trên WooCommerce - https://www.mycomputer.vn/thanh-toan-paypal-bang-vnd-tren-woocommerce
//$this->validate_currency( $order, $posted['mc_currency'] );
//$this->validate_amount( $order, $posted['mc_gross'] );
@tongdaitructuyen
tongdaitructuyen / class-wc-gateway-paypal-ipn-handler.php
Last active February 17, 2022 09:21
Xử lý lỗi đơn hàng không tự động hoàn tất - Hướng dẫn cách tạo thanh toán PayPal bằng VNĐ trên WooCommerce - https://www.mycomputer.vn/thanh-toan-paypal-bang-vnd-tren-woocommerce
$this->validate_currency( $order, $posted['mc_currency'] );
$this->validate_amount( $order, $posted['mc_gross'] );
/*Step 1 Code to use VND currency to display Viet Nam Dong in WooCommerce:*/
add_filter( 'woocommerce_currencies', 'add_vnd_currency' );
function add_vnd_currency( $currencies ) {
$currencies['VND'] = __( 'Viet Nam Dong', 'woocommerce' );
return $currencies;
}
/*Step 2 Code to add VND currency symbol in WooCommerce:*/
add_filter('woocommerce_currency_symbol', 'add_vnd_currency_symbol', 10, 2);
function add_vnd_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
@tongdaitructuyen
tongdaitructuyen / funtion.php
Created February 17, 2022 08:37
Kích hoạt PayPal Standard trên WooCommerce - Xem chi tiết: https://www.mycomputer.vn/thanh-toan-paypal-bang-vnd-tren-woocommerce
add_filter( 'woocommerce_should_load_paypal_standard', '__return_true' );
System is compatible with the upgrade. The checks are:
* PHP version must be 7.2 or 7.3
* MySQL version needs to be >= 5.7.14 or MariaDB >= 10.1
* Is custom `api_rate_limiter_cache` set? TODO add docs
* Is Mautic's root directory writable?
* Are there items in the `spool/default` folder? This indicates that there are still emails in the queue
* Is the free disk space at least 2x the current Mautic 2 installation?
* Do you at least have Mautic 2.16.3 installed?
* Is PHP's `max_execution_time` either 0 (unlimited) or > 240? If not, we try to set it, if that doesn't work, we show an error
@tongdaitructuyen
tongdaitructuyen / Mautic V3 - Command Clear Cache
Created December 22, 2020 02:40
Clear Cache Mautic v3 - [WARNING] Some commands could not be registered - https://gafaba.com/?s=mautic
php -d memory_limit=512M bin/console cache:clear
php -d memory_limit=512M bin/console doctrine:migration:status
php -d memory_limit=512M bin/console doctrine:migration:migrate
php -d memory_limit=512M bin/console doctrine:schema:update --dump-sql
php -d memory_limit=512M bin/console cache:clear
php -d memory_limit=512M bin/console mautic:plugins:reload