This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* skip the processing status for selling digital products on WooCommerce. Put this code into your theme functions.php or a plugin. | |
*/ | |
//SalesNudge.io | |
add_filter( 'woocommerce_payment_complete_order_status', 'salesnudge_skip_processing', 10, 1 ); | |
function salesnudge_skip_processing( $stt = '' ){ | |
return 'completed'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Display lowest price of variant on product archives WooCommerce | |
// Format "Starting at %s per unit" - Exp: Starting at $4.5 per unit | |
// Put this file to folder /woocommerce/loop/ of your theme | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly | |
} | |
global $product; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Snippet by https://SalesGen.io | |
//display sizechart above add to cart button | |
// #1 put this code in to functions.php of your themes/child theme | |
// #2 create UX block with ID : sizechart. | |
// #3 Check your product page | |
//Notice: Change the width of popup on desktop by change the 800px with your expect value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
Put this file to folder of your theme to overide default option | |
woocommerce/single-product/add-to-cart/variable.php | |
* | |
* Check "IMPORTANT HERE" part to set default variant with attribute. Else code will set first variant to default. | |
* | |
* | |
* By Anthony Pham from SalesGen.io | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 1) Go to WooCommerce > Status > Tools | |
-- 2) Find section "Term counts" and press Recount Terms | |
-- 3) Run this one with phpMyAdmin or tool similar | |
-- If you want to remove tags, change 'product_cat' to 'product_tag' | |
-- Anthony from SalesGen.io | |
DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE count = 0 and taxonomy = 'product_cat') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Anthony from SalesGen.io | |
-- Bạn cần phải biết số tiền hiện tại đang là bao nhiêu để điều chỉnh về giá mới. | |
-- Ví dụ muốn đổi hết sản phẩm đang có giá là 74 về 64 thì set _price và _regular_price về cùng giá mới 64 | |
update `wp_postmeta` SET `meta_value` = 64 WHERE meta_key = '_price' AND meta_value = 74; | |
update `wp_postmeta` SET `meta_value` = 64 WHERE meta_key = '_regular_price' AND meta_value = 74; | |
-- Nếu có sale price, giá cũ sale là 74, giá cũ gốc _regular_price là 94 thì set như sau (giá mới là 84, giá sale mới là 64, nếu muốn bỏ giá sales thì cho giá sale = giá _regular_price): | |
update `wp_postmeta` SET `meta_value` = 64 WHERE meta_key = '_price' AND meta_value = 74; | |
update `wp_postmeta` SET `meta_value` = 84 WHERE meta_key = '_regular_price' AND meta_value = 94; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- This SQLs remove orders, orders notes, customers, coupons on your store | |
-- SalesGen.io | |
-- NOTICE: Replace wp_ by your prefix table | |
DELETE FROM wp_woocommerce_order_itemmeta; | |
DELETE FROM wp_woocommerce_order_items; | |
DELETE FROM wp_wc_order_stats; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- This SQLs remove products and their meta data on your store | |
-- SalesGen.io | |
-- delete product info | |
DELETE FROM wp_posts WHERE post_type = 'product_variation'; | |
DELETE FROM wp_posts WHERE post_type = 'product'; | |
-- After remove products from posts table, must clear data in postmeta to reduce database size. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //Do not copy this line to your functions.php of theme | |
//copy from here then paste into functions.php of theme | |
add_filter( 'woocommerce_product_related_posts_relate_by_category', 'salesgen_product_related_posts_relate_by_category' ); | |
function salesgen_product_related_posts_relate_by_category(){ | |
return array(); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER TABLE wp_postmeta ADD key(post_id, meta_key(100), meta_value(191)); | |
ALTER TABLE wp_postmeta ADD key(meta_key(100), meta_value(191)); | |
-- change wp_postmeta to your table with prefix |
OlderNewer