Skip to content

Open-Pix/woocommerce-openpix

Repository files navigation

OpenPix for WooCommerce

Installment Plugin

How to enable installment plugin

private function includes()
{
    include_once dirname(__FILE__) . '/includes/class-wc-openpix-pix.php';
    include_once dirname(__FILE__) .
        '/includes/class-wc-openpix-installment.php';
}

public function add_gateway($methods)
{
    $methods[] = 'WC_OpenPix_Pix_Gateway';
    $methods[] = 'WC_OpenPix_Installment_Gateway';

    return $methods;
}

LocalWP

You can run your Wordpress in many ways Run directly in your machine Run inside a docker compose setup

or

Using LocalWP that will handle most of the complexity for you

How to develop and install this plugin

Clone this repo inside wp-content/plugins

cd wp-content/plugins
git clone https://github.com/Open-Pix/woo-openpix-plugin

How it works?

It has a woo-openpix-plugin.php file that will render a basic html template and also inject css and javascript from our React app

How to run

Start webpack and enjoy hot reload with fast refresh

yarn start

How to generate a new .zip version?

./pack.sh

How to Release

svn co https://plugins.svn.wordpress.org/openpix-for-woocommerce
cp Open-Pix/woocommerce-openpix content to svn woocommerce-openpix/trunk
unzip woocommerce-openpix.zip -d w1.1.0
cp w1.1.0/* woocommerce-openpix/thunk/.
M - means modified
// add files
svn add * 
svn ci -m "version 1.1.0"
svn cp trunk tags/1.1.0

Tests

  • change sibelius to your password
./bin/install-wp-tests.sh wordpress_test root sibelius localhost $WP_VERSION

Read these blogposts

https://sanjeebaryal.com.np/fixing-issues-while-setting-up-php-unit-tests-for-wordpress-plugins/

https://github.com/w3guy/wp-meta-verify

https://www.smashingmagazine.com/2017/12/automated-testing-wordpress-plugins-phpunit/