Fabrizio Cocchi

Da Webmobili Wiki.

Info

Account su Register. Abbiamo creato un sottodominio listanozze e puntato al nostro Apache su AWS.

Register

AFC288-EURO
Fabrizio2020!

Configurazione Gmail

Per poter usare il form contatti e spedire email dal sito, seguire guida https://wpmailsmtp.com/it/docs/how-to-set-up-the-gmail-mailer-in-wp-mail-smtp/

Personalizzazioni plugin lista notte

Plugin -> nm-gift-registry

griglia default -> Includes/lib/Setup + css personalizzato -> .nmgr-display-modes {display: none;}

non cliccabile il prodotto -> Includes/Table/iItemsTable.php riga 224

Traduzioni

Inserire i file delle traduzioni creati con PoEdit a mano qui: listanozze.fabriziococchi.com/wp-content/languages/plugins

I file sono nm-gift-registry-it_IT.po e nm-gift-registry-it_IT.mo

Aggiunta Cadauno al prezzo

Modificato file originale del plugin nm-gift-registry\includes\Tables\ItemsTable.php

public function get_item_cost() {
		ob_start();
		$item = $this->get_row_object();

		$cost_per_item_text = nmgr()->is_pro ?
			__( 'Cost per item', 'nm-gift-registry' ) :
			__( 'Cost per item', 'nm-gift-registry-lite' );
		?>
		
		<div class="nmgr-tip" title="<?php echo esc_attr( $cost_per_item_text ); ?>">
			<?php echo wp_kses_post( $item->get_cost( true )." (cad.)" ); ?>
		</div>
		<?php
		return ob_get_clean();
	}

Hook al file del plugin nm-gift-registry\includes\Lib\Single.php

nel tema figlio:

<?php
	// Pulsante Vai al Carrello, nel listing prodotti

add_action( 'nmgr_wishlist', 'vai_al_carrello', 51 ); // Sopra Griglia prodotti
add_action( 'nmgr_wishlist', 'vai_al_carrello', 91 ); // Sotto griglia prodotti

function vai_al_carrello ($wishlist){
		$items_count = WC()->cart->get_cart_contents_count();
		?>
		<div class="wm-carrello">
			<svg fill="#000" class="nmgr-icon align-with-text" xmlns="http://www.w3.org/2000/svg" width="1.5em" height="1.5em" viewBox="0 0 24 24"><path d="M24 3l-.743 2h-1.929l-3.474 12h-13.239l-4.615-11h16.812l-.564 2h-13.24l2.937 7h10.428l3.432-12h4.195zm-15.5 15c-.828 0-1.5.672-1.5 1.5 0 .829.672 1.5 1.5 1.5s1.5-.671 1.5-1.5c0-.828-.672-1.5-1.5-1.5zm6.9-7-1.9 7c-.828 0-1.5.671-1.5 1.5s.672 1.5 1.5 1.5 1.5-.671 1.5-1.5c0-.828-.672-1.5-1.5-1.5z"></path></svg>
			<a href="<?php echo wc_get_cart_url(); ?>">Vai al carrello<?php echo $items_count > 0 ? "(".$items_count.")" : "";?></a>
		</div>	
		<?php
	}

// Nascondere Link di condivisione della lista
add_action( 'after_setup_theme', 'remove_nmgr_wishlist_action_late', 100 );

function remove_nmgr_wishlist_action_late() {
	$class = \NMGR\Lib\Single::class;
    // Controllo che la classe sia caricata
    if ( class_exists( $class ) ) {
        remove_action( 'nmgr_wishlist', array( $class, 'show_copy_link' ), 90 );
    }
}

<?php
}

Tema figlio

Functions.php

// Disabilitare paginazione
add_filter( 'nmgr_items_per_page', '__return_null' );

// Ordinamento per Titolo Prodotto
add_filter( 'nmgr_table_default_props', function ( $page, $table ) {
    if ( 'items' === $table->get_id() ) {
        $page[ 'orderby' ] = 'title';
        $page[ 'order' ] = 'asc'; // optional
    }
    return $page;
}, 10, 2 );

// Pulsante Vai al Carrello, nel listing prodotti

add_action( 'nmgr_wishlist', 'vai_al_carrello', 51 ); // Sopra Griglia prodotti
add_action( 'nmgr_wishlist', 'vai_al_carrello', 91 ); // Sotto griglia prodotti

function vai_al_carrello ($wishlist){
		$items_count = WC()->cart->get_cart_contents_count();
		?>
		<div class="wm-carrello">
			<svg fill="#000" class="nmgr-icon align-with-text" xmlns="http://www.w3.org/2000/svg" width="1.5em" height="1.5em" viewBox="0 0 24 24"><path d="M24 3l-.743 2h-1.929l-3.474 12h-13.239l-4.615-11h16.812l-.564 2h-13.24l2.937 7h10.428l3.432-12h4.195zm-15.5 15c-.828 0-1.5.672-1.5 1.5 0 .829.672 1.5 1.5 1.5s1.5-.671 1.5-1.5c0-.828-.672-1.5-1.5-1.5zm6.9-7-1.9 7c-.828 0-1.5.671-1.5 1.5s.672 1.5 1.5 1.5 1.5-.671 1.5-1.5c0-.828-.672-1.5-1.5-1.5z"></path></svg>
			<a href="<?php echo wc_get_cart_url(); ?>">Vai al carrello<?php echo $items_count > 0 ? "(".$items_count.")" : "";?></a>
		</div>	
		<?php
	}

// Nascondere Link di condivisione della lista
add_action( 'after_setup_theme', 'remove_nmgr_wishlist_action_late', 100 );

function remove_nmgr_wishlist_action_late() {
	$class = \NMGR\Lib\Single::class;
    // Controllo che la classe sia caricata
    if ( class_exists( $class ) ) {
        remove_action( 'nmgr_wishlist', array( $class, 'show_copy_link' ), 90 );
    }
}

// N prodotti per pagina
//add_filter( 'nmgr_items_per_page', function ( $value, $section ) {
//	if ( 'items' === $section ) {
//		$value = 5;
//	}
//	return $value;
//}, 10, 2 );

Css personalizzato

/*Opzioni visualizzazione lista/griglia articoli*/
.nmgr-display-modes {display: none;}

/*Bottone Aggiungi al carrello*/
.nmgr_add_to_cart_button.button {
  display: inline-block;
  font-weight: 400;
  color: #fff;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  background-color: #000;
  border: 1px solid #000;
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
  line-height: 1;
  border-radius: 0.375rem;
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
  text-decoration: none;
}

.nmgr_add_to_cart_button.button:hover {
  background-color: #9e9e9e;
  border-color: #9e9e9e;
}

.nmgr_add_to_cart_button.button:active {
  background-color: #000;
  border-color: #000;
}
/*nascondere Footer Colibri*/
#copyright{
	display:none;
}
/*Elementi in Griglia con bottone Carrello al fondo della card*/
#nmgr_table_items.nmgr-items-view.grid > div{
	display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/*link Carrello*/
.wm-carrello{
	text-align:center;
	margin-bottom:1rem;
}

/*Larghezza griglia*/
.e-con{
    --container-max-width: 1145px;
}