Klasický WordPress modul Coding standards I18n Post types, taxonomies, meta, options Transients a WP cache Nepoužívajte "super" triedy/objekty

Similar documents
WooCommerce User Manual By Design N Buy

Integration Manual Valitor WooCommerce Module

WordPress WooCommerce plugin. Merchant Integration Manual

USER MANUAL. Portal Invoice Add-on TABLE OF CONTENTS. Version: 1.0

WooCommerce REST API Integration. October 27, 2018

SMS Plugin for WooCommerce Manual

MyanPay API Integration with WordPress & WooCommerce CMS

WooCommerce izettle Documentation

WC Auto-Ship for WooCommerce

SEGPAY WooCommerce Plugin SETUP

Demystifying Hooks, Actions & Filters. A quick run through by Damien Carbery

Quickbooks Document : Installation : 1) WordPress Plugin Uploader 2) FTP

Documentation of Reward Points for Woocommerce. Installation of Reward Points for Woocommerce

Product Sales Report Pro v2.1 User's Manual

ONE STEP CHECKOUT USER GUIDE

WOOCOMMERCE VISMA INTEGRATION Last Modified: 2017-Mar-28

CMSnipcart Documentation

AceShop Quick Guide. AceShop is the integration of two of the most popular open source projects in the world: OpenCart and Joomla!

SYLLABUS FOR BUILDING YOUR ecommerce STORE WITH WORDPRESS

How to configure Web Hosting plugin

WebShop. User Manual. protonic software GmbH

Webcart Documentation

PHPBasket 4 Administrator Documentation

Quick Online Shop Documentation

Orbit Store Documentation User

Theming WordPress. Beth Tucker Long

How to Add Product In Your Store

Magento Survey Extension User Guide

Webshop Plus! v Pablo Software Solutions DB Technosystems

Get in Touch Module 1 - Core PHP XHTML

WordPress plugin development (with pictures) Simon Wheatley

Toolbox: Utilizing the Shared Cart Feature

ebay Connector Features Module Configuration

Bitcoin for WooCommerce Documentation

Installation and Activation of Foody pro theme

Vantiv ecommerce for Magento 2

WORDPRESS PLUGIN DEVELOPMENT

Documentation of Color and Image Swatches for woocommerce. Installation of Color and Image Swatches for woocommerce

ORDERING FROM TEMPLATES Click on the My Accounts tab at the top of the screen, and then select Templates.

Vantiv ecommerce for Magento 1 User Guide. Version 1.0.7

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Magento

Navigating the WordPress Plugin Landscape

Page 1 of 32. Rewards Points

WEBSITE INSTRUCTIONS

MotoPress Restaurant Menu Plugin Documentation

Ultimate GDPR Compliance Toolkit for WordPress. Release 1.1

Project Covered During Training: Real Time project Training

Static Webpage Development

Fyndiq WooCommerce Plugin. User Guide Version 1.0.0

WEBSITE INSTRUCTIONS. Table of Contents

A Guide to Understand, Install and Use Pie Register WordPress Registration Plugin

Portal > Knowledgebase > I am a Supplier/Decorator > ESP Websites > Website Settings

Connecting VirtueMart To PayPal (Live)

QuickBooks Payments For WooCommerce : Introduction: Installation: Requirements:

DOCUMENTATION OLAM WORDPRESS THEME

Page 1 of 6. Plan Name. For more information please ref. to our pricing page or call us on Basic Advance Business Enterprise

Smart Bulk SMS & Voice SMS Marketing Script with 2-Way Messaging. Quick-Start Manual

Merchant e-solutions Payment Acceptance User Guide for Magento (M1)

Magento Enterprise Edition. User Guide. Part IV: Customers Sales & Orders Payments Shipping Taxes. Version

WooCommerce Webshop Brochure

SV WooCommerce Order Export Documentation This documentation will help you to unleash the full functionality of SV WooCommerce Order Export Plugin.

PIMCORE TRAINING GUIDE

ONEFUSION INSTRUCTION MANUAL HELPING YOU MANAGE YOUR OWN SITE

Migration Tool. User Guide. SHOPIFY to MAGENTO. Copyright 2014 LitExtension.com. All Rights Reserved.

Documentation of Check Pincode / Zipcode for Shipping and COD-Pro. Installation of Check Pincode / Zipcode for Shipping and COD-Pro

KonaKart Shopping Widgets. 3rd January DS Data Systems (UK) Ltd., 9 Little Meadow Loughton, Milton Keynes Bucks MK5 8EH UK

General Settings General Settings Settings

Top 10 WordPress Plugins.

edirectory Change log

Shopping Basket and Order Requirements

VolunteerMatters Wordpress Web Platform estore Admin Guide. Version 1.1

Getting Started Guide. Prepared by-fatbit Technologies

SMS Plugin for Magento Manual

Blue Form Builder extension for Magento 2

One Step Checkout for Magento 2

ONE STEP CHECKOUT. USER GUIDE for Magento 2.0. Version

Follow Up . Magento Extension User Guide. Official extension page: Follow Up . User Guide: Follow Up

USER MANUAL. SuitePort - SuiteCRM Customer Portal for WordPress TABLE OF CONTENTS. Version: 2.5.0

Fyndiq Prestashop Module

GeoIP - Magento 2 USER MANUAL MAGEDELIGHT.COM E:

WordPress and ecommerce. A match made in heaven?

Sliding PayPal Shopping Cart 2 DMXzone

Event Scheduling System 4.0 User Guide

WP Voting Plugin - Ohiowebtech Video Extension - Youtube Documentation

OSoftMediia IT Solutions & Services

Extra Fee for Magento 2

Cart Product Selector. Quick Start Guide

Read the Docs Template Documentation

InstantSearch+ Documentation for WooCommerce

Helpline No WhatsApp No.:

MMP350 Class Notes Week 8

Jquery Manually Set Checkbox Checked Or Not

DPD API Reference Documentation

Sendroid Ultimate. User Manual

Octolooks Scrapes Guide

More information >>> HERE <<<

PHP / MYSQL DURATION: 2 MONTHS

Geo Tax for J2Store. Plugin for Joomla! / J2Store. This manual documents version 3.1.x of the Joomla! / J2Store extension.

USER MANUAL. SalesPort Salesforce Customer Portal for WordPress (Lightning Mode) TABLE OF CONTENTS. Version: 3.1.0

Design Gallery User Guide

Transcription:

WooCommerce pre vývojárov Ján Bočínec

Modul pre WooCommerce Klasický WordPress modul Coding standards I18n Post types, taxonomies, meta, options Transients a WP cache Nepoužívajte "super" triedy/objekty /** * Check if WooCommerce is active **/ if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { // Put your plugin code here

woocommerce_loaded WC() //WooCommerce WC()->session //WC_Session WC()->query //WC_Query WC()->countries //WC_Countries WC()->cart //WC_Cart WC()->customer //WC_Customer WC()->checkout() //WC_Checkout WC()->payment_gateways() //WC_Payment_Gateways WC()->shipping() //WC_Shipping WC()->mailer() //WC_Emails $customer_country = WC()->customer->get_country(); docs.woothemes.com/wc-apidocs

global $woocommerce; $woocommerce->cart->get_cart_subtotal();

Funkcie wc-admin-functions.php wc-attribute-functions.php wc-cart-functions.php wc-order-functions.php wc-conditional-functions.php wc-core-functions.php wc-coupon-functions.php wc-formatting-functions.php wc-meta-box-functions.php wc-notice-functions.php wc-order-functions.php wc-page-functions.php wc-product-functions.php wc-template-functions.php wc-term-functions.php wc-user-functions.php wc-webhook-functions.php wc-widget-functions.php

Platobná brána class WC_Custom_Gateway extends WC_Payment_Gateway { public function construct() { $this->id = 'custom_gateway'; $this->icon = 'url_to_image'; $this->has_fields = false; $this->method_title = ( 'Custom Gateway', 'wc-custom-gateway' ); $this->method_description = ( 'Gateway description.', 'wc-custom-gateway' ); function webikon_woocommerce_payment_gateways( $methods ) { $methods[] = 'WC_Custom_Gateway'; return $methods; add_filter( 'woocommerce_payment_gateways', 'webikon_woocommerce_payment_gateways' );

function process_payment( $order_id ) { $order = new WC_Order( $order_id ); // Mark order as on-hold $order->update_status('on-hold', ( 'Awaiting payment', 'wc-custom-gateway' )); // Add order note $order->add_order_note( ('Payment on-hold', 'wc-custom-gateway') ); $payment_complete = new Call_Custom_Payment_API( $order_id, $params ); if ( $payment_complete ) { // Reduce stock levels $order->reduce_order_stock(); // Remove cart WC()->cart->empty_cart(); // Change order status to completed $order->payment_complete(); return array( 'result' => 'success', 'redirect' => 'redirect_url' ); else { //Add error message on the checkout page wc_add_notice( ('Payment error:', 'wc-custom-gateway'). $error_message, 'error' ); return array( 'result' => 'fail', 'redirect' => '' );

Spôsob dopravy class WC_Custom_Shipping_Method extends WC_Shipping_Method { public function construct() { $this->id = 'custom_shipping'; $this->title = ( 'Your Shipping Method', 'wc-custom-shipping' ) $this->method_description = ( 'Shipping description', 'wc-custom-shipping' ) $this->init(); function webikon_woocommerce_shipping_methods( $methods ) { $methods[] = 'WC_Custom_Gateway'; return $methods; add_filter( 'woocommerce_shipping_methods', 'webikon_woocommerce_shipping_methods' );

public function calculate_shipping( $package ) { $rate = array( // ID for the rate 'id' => $this->id, // Label for the rate 'label' => $this->title, // Amount for shipping or an array of costs (for per item shipping) 'cost' => '10.99', // Pass an array of taxes, or pass nothing to have it calculated for you, // or pass 'false' to calculate no tax for this method 'taxes' => '', // Calc tax per_order or per_item. Per item needs an array of costs passed via 'cost' 'calc_tax' => 'per_item' ); // Register the rate $this->add_rate( $rate );

Settings API /** * Initialise Gateway Settings Form Fields */ function init_form_fields() { $this->form_fields = array( 'option_name' => array( 'title' => 'Title for your option shown on the settings page', 'description' => 'Description for your option shown on the settings page' 'type' => 'text password textarea checkbox select multiselect', 'default' => 'Default value for the option', 'class' => 'Class for the input', 'css' => 'CSS rules added line to the input', 'label' => 'Label', // checkbox only 'options' => array( 'key' => 'value' ) // array of options for select/multiselects only ) ); // End init_form_fields()

Stránky nastavení account general checkout products tax shipping email api add_filter( 'woocommerce_get_sections_'. SETTINGS_PAGE, function( $sections ) { return $sections; ); add_filter( 'woocommerce_get_settings_'. SETTINGS_PAGE, function( $settings, $current_section ) { return $settings, 10, 2 );

Vlastná stránka nastavení add_filter( 'woocommerce_get_settings_pages', function( $settings ) { $settings[] = new WC_Settings_Custom; //instance of WC_Settings_Page return $settings; ); Integrations WooCommerce -> Settings -> Integrations WC_Integration class

Vlastný typ produktu //Register the simple_custom product type class WC_Product_Simple_Custom extends WC_Product { public function construct( $product ) { $this->product_type = 'simple_custom'; parent:: construct( $product ); //Add a simple_custom product tab. add_filter( 'woocommerce_product_data_tabs', 'custom_product_tabs' ); //Contents of the simple_custom options product tab. add_action( 'woocommerce_product_data_panels', 'custom_options_tab_content' ); // Save the simple_custom fields. add_action( 'woocommerce_process_product_meta_simple_custom', 'save_rental_option_field' ); add_action( 'woocommerce_process_product_meta_variable_custom', 'save_rental_option_field' );

/** * Show pricing fields for simple_custom product. */ function simple_custom_js() { if ( 'product'!= get_post_type() ) return;?><script type='text/javascript'> jquery( document ).ready( function() { jquery( '.options_group.pricing' ).addclass( 'show_if_simple_custom' ).show(); ); </script><?php add_action( 'admin_footer', 'simple_custom_js' ); Používať wp_enqueue_script a wp_enqueue_style!

Téma podporuje WooCoommerce add_action( 'after_setup_theme', 'my_theme_woocommerce_support' ); function my_theme_woocommerce_support() { add_theme_support( 'woocommerce' );

WooCommerce podstránky wc_get_cart_url() wc_get_checkout_url() wc_get_page_permalink( $page ) wc_get_page_id( $page )

WooCommerce šablóny /woocommerce/templates/ /custom-theme/woocommerce/

WooCommerce REST API v3 curl https://example.com/wc-api/v3/orders/645 \ -u consumer_key:consumer_secret JSON { "order": { "id": 645, "order_number": 645, "created_at": "2015-01-26T20:00:21Z", "updated_at": "2015-01-26T20:00:21Z", "completed_at": "2015-01-26T20:00:21Z", "status": "processing", "currency": "USD", "total": "79.87", "subtotal": "63.97", "total_line_items_quantity": 3, "total_tax": "5.90", "total_shipping": "10.00", "cart_tax": "5.40", "shipping_tax": "0.50",... woothemes.github.io/woocommerce-rest-api-docs

WooCommerce iphone app

WooCommerce CLI $ wp wc usage: wp wc coupon <command> or: wp wc customer <command> or: wp wc order <command> or: wp wc product <command> or: wp wc report <command> or: wp wc tax <command> or: wp wc tool <command> See 'wp help wc <command>' for more information on a specific command. wp wc tool clear_transients github.com/woothemes/woocommerce/wiki/wp-cli-commands wp-cli.org

Cache a optimilizácia Obsah špecifický pre konkrétneho zákazníka /cart /checkout /my-account /* (bloky s informáciami) Vylúčiť tieto podstránky z cacheovania Pomôže AJAX Alternatíva je "sledovať " správanie: Je návštevník e-shopu už zákazníkom? Angular/React?

Chcete naozaj rýchlosť? WordPress Object Cache Redis/Memcached Aplikuje sa aj na Transients API PHP 7 ElasticSearch - Databáza spomaľuje ElasticPress WooCommerce SSD bez kompromisov RAM > veľkosť databázy Čím viac CPU tým lepšie :)

Ladenie a testovanie Váš e-shop žije! Nezabúdajte na zálohy. Všetko deaktivujte. Použite nejakú základnú tému (Storefront). Pokazte čo sa dá.

System Status Report JavaScript chyby? WP_DEBUG WC_Logger WC_LOG_DIR.../wp-content/uploads/wc-logs/ Google

System Status Report Základné informácie o WordPress Nastavenie servera a aktuálny stav databázy Základné nastavenia WooCommerce Verzia API Aktívne moduly Informácie o aktívnej téme Používané šablóny Export (markdown) docs.woothemes.com/document/understanding-the-woocommerce-system-status-report

Rozšírenia a nástroje Smart Manager Product CSV Import Suite WP All Import Store Toolkit WPML (+multi-currency) toret.cz platobnebrany.sk Query Monitor (slow queries log) MySQLTuner

WooCommerce 2.6 (Beta 1) Zipping Zebra Zóny pre dopravu Záložky na podstránky "môj účet" AJAX v košíku Payment Tokens API - štandardizovanie platieb Nové WooCommerce REST API /wc-api/v3/ => /wp-json/wc/v1/ Zmeny v niekoľkých šablonách woocommerce.wordpress.com/2016/04/22/woocommerce-2-6-beta-1-is-here

@JohnnyPea webikon.sk wpguru.sk wp.sk