Skip to content

Instantly share code, notes, and snippets.

View mymizan's full-sized avatar
🎯
Focusing

M Yakub Mizan mymizan

🎯
Focusing
View GitHub Profile
@mymizan
mymizan / sime-build-script.sh
Created November 16, 2020 11:31
Build Script
#!/bin/bash
rm -rf woocommerce-multistore.zip
zip -r woocommerce-multistore.zip woocommerce-multistore -x '*.git*' -x '.DS_Store' -x '.travis.yml' -x 'bin' -x 'phpunit.xml.dist' -x 'tests'
<?php
/**
* change 3,4,5 with your own site IDs where you don't want to sync stock. Each ID
* should be seperated by a comma.
*/
$site_ids = array( 3, 4, 5);
/**
* Do not edit anything below.
**/
<?php
/**
* Plugin Name: WooMulti Demo Sync Product
* Plugin URI: https://woomultistore.com/
* Description: A demo plugin to demonstrate the synchronization of products via API.
* Author: Lykke Media AS
* Version: 1.0.0
* Author URI: https://woomultistore.com/
*/
define( 'WP_SHOW_CAT_IDS_NAME', 'WP Show Category ID' );
define( 'WP_SHOW_CAT_IDS_VERSION', '1.0.0' );
class WP_SHOW_CAT_IDS_MAIN {
/**
* All our action hooks and filters here
* so that they are regiestered when the
* plugin is initiated.
<?php
/**
* Plugin Name: WP Show Category ID
* Plugin URI: https://yakub.xyz
* Description: A simple plugin to show category IDs for post categories and WooCommerce product caegories
* Author: M Yakub Mizan
* Version: 1.0.0
* Author URI: https://yakub.xyz
**/
<?php
public function menu_markup()
{
if ( !current_user_can( 'manage_options' ) ) {
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
}
?>
<div class="wrap">
<h1>YM Options</h1>
<form method="post" action="options.php">
<?php
/*
Plugin Name: YM Options Page
Plugin URI: https://yakub.xyz/
Description: The plugin shows you how to build an options page
Author: M Yakub Mizan
Version: 1.0.0
Author URI: https://yakub.xyz
*/
<?php
/*
Plugin Name: YM Options Page
Plugin URI: https://yakub.xyz/
Description: The plugin shows you how to build an options page
Author: M Yakub Mizan
Version: 1.0.0
Author URI: https://yakub.xyz
*/
<?php
/**
**
** I like to prefix my functions, constants and variables in global scope
** with YMCODE_/ymcode_ to prevent collision. Feel free to change it.
**/
/**
** Set your custom message. Do not include html as it will be stripped off.
**/
@mymizan
mymizan / remove-shipping-row-method-1
Last active May 24, 2019 17:51
Remove shipping information from WooCommerce Email
/**
** Remove the shipping row from woocommerce_get_order_item_totals array
**/
function ymcode_remove_shipping_details_from_woocommerce_email($total_rows, $obj, $tax_display)
{
if ( isset($total_rows['shipping']) )
{
unset($total_rows['shipping']);
}