This file contains hidden or 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
Gracias a https://decodecms.com/personalizar-pagina-de-gracias-de-woocommerce/#Cambiar_el_texto_de_la_p%C3%A1gina_de_gracias | |
Cambiar el título de la página de gracias | |
WooCommerce tiene un Hook dinámico para las páginas principales de la tienda que crea el plugin, en este caso nos interesa la página de gracias, por lo tanto el hook a utilizar es woocommerce_endpoint_order-received_title. | |
En el siguiente ejemplo cambiamos el título de la página y además agregamos el nombre del usuario. | |
add_filter( 'woocommerce_endpoint_order-received_title', 'dcms_thank_you_title'); | |
function dcms_thank_you_title(){ | |
$current_user = wp_get_current_user(); | |
$first_name = esc_html( $current_user->user_firstname ); |
This file contains hidden or 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
function remove_personal_options(){ | |
echo '<script type="text/javascript">jQuery(document).ready(function($) { | |
$(\'form#your-profile > h2:first\').remove(); // remove the "Personal Options" title | |
$(\'form#your-profile tr.user-rich-editing-wrap\').remove(); // remove the "Visual Editor" field | |
$(\'form#your-profile tr.user-syntax-highlighting-wrap\').remove(); // remove the "resaltado de sintaxis al editar código" field | |
$(\'form#your-profile tr.user-admin-color-wrap\').remove(); // remove the "Admin Color Scheme" field |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Simple Backbone WordPress Example</title> | |
<link rel="stylesheet" href="base.css"> | |
</head> | |
<body> | |
<ul id="post-list"></ul> |
This file contains hidden or 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
// | |
// ViewController.swift | |
// Honk | |
// | |
// Created by Nick Gressle on 9/23/17. | |
// Copyright © 2017 nick gressle illustrations llc. All rights reserved. | |
// | |
import UIKit | |
import WebKit |
This file contains hidden or 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
/** | |
* Optimize WooCommerce Scripts | |
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages. | |
*/ | |
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); | |
function child_manage_woocommerce_styles() { | |
//remove generator meta tag | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |
This file contains hidden or 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
/* | |
* Add item to cart on visit | |
*/ | |
function add_product_to_cart() { | |
if ( ! is_admin() ) { | |
global $woocommerce; | |
$product_id = 64; | |
$found = false; | |
//check if product already in cart | |
if ( sizeof( $woocommerce->cart->get_cart() ) > 0 ) { |
This file contains hidden or 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 | |
/* | |
* wc_remove_related_products | |
* | |
* Clear the query arguments for related products so none show. | |
* Add this code to your theme functions.php file. | |
*/ | |
function wc_remove_related_products( $args ) { | |
return array(); | |
} |
This file contains hidden or 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 | |
class My_Custom_My_Account_Endpoint { | |
/** | |
* Custom endpoint name. | |
* | |
* @var string | |
*/ | |
public static $endpoint = 'my-custom-endpoint'; |
This file contains hidden or 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 | |
// Add the code below to your theme's functions.php file to add a confirm password field on the register form under My Accounts. | |
add_filter('woocommerce_registration_errors', 'registration_errors_validation', 10,3); | |
function registration_errors_validation($reg_errors, $sanitized_user_login, $user_email) { | |
global $woocommerce; | |
extract( $_POST ); | |
if ( strcmp( $password, $password2 ) !== 0 ) { | |
return new WP_Error( 'registration-error', __( 'Passwords do not match.', 'woocommerce' ) ); | |
} |
This file contains hidden or 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
/* | |
* goes in theme functions.php or a custom plugin | |
**/ | |
// add item to cart on visit | |
add_action( 'template_redirect', 'add_product_to_cart' ); | |
function add_product_to_cart() { | |
if ( ! is_admin() ) { | |
$product_id = 64; | |
$found = false; | |
//check if product already in cart |
NewerOlder