Skip to content

Instantly share code, notes, and snippets.

Fisier includes/class-woo-smartbill-wrapper.php functia storneaza sub linia 204( $data = $this->get_invoice_data( $order_id, true ); )
$data = apply_filters( 'woo_smartbill_storneaza_data', $data, $order_id );
Fisierul includes/class-woo-smartbill-gestiune.php
1. Sub linia 20( add_filter( 'woo_smartbill_genereaza_data', array( $this, 'add_usestock' ), 20, 2 ); ) adaugam :
add_filter( 'woo_smartbill_storneaza_data', array( $this, 'add_usestock' ), 20, 2 );
2. In functia add_gestiune linia 254 comentam urmatorul cod :
if ( $stornare ) {
@giucu91
giucu91 / gist:6bd0e2bd25122a9c8b5c83ea43e83bae
Last active December 21, 2022 14:09
change-dlm-upload-folder.php
<?php
add_filter( 'upload_dir', 'change_upload_dir_for_dlm', 30 );
function change_upload_dir_for_dlm( $pathdata ){
if ( isset( $_POST['type'] ) && 'dlm_download' === $_POST['type'] ) {
if ( empty( $pathdata['subdir'] ) ) {
$pathdata['path'] = $pathdata['path'] . '/private';
$pathdata['url'] = $pathdata['url'] . '/private';
$pathdata['subdir'] = '/private';
<?php
public function add_query_args__current( $args, $atts ) {
/*
* The query does not change if the current post type or the specific post is excluded.
*/
if ( wpmtst_assignment_is_post_excluded( get_the_ID() ) ) {
return $args;
}
/*
add_filter( 'modula_shortcode_item_data', 'modula_ada_compliance', 99 );
function modula_ada_compliance( $item_data ){
$item_data['link_attributes']['aria-label'] = 'opens light box for ' . $item_data['img_attributes']['alt'];
return $item_data;
}
@giucu91
giucu91 / paypa-validations.js
Created November 16, 2020 08:25
Paypal validations
var options = {
buttons: ['edd-purchase-button'],
environment: 'production',
condition: function () {
var valid = true;
if ($('#edd-email').val() == '') {
valid = false;
}
$('#edd_purchase_form input.required').each(function() {
if($(this).val() == '') {
@giucu91
giucu91 / woocommerce-functions.php
Last active November 11, 2022 12:01
Integrare Woo Facturare si WooCommerce SmartBill
<?php
/**
* @copyright Intelligent IT SRL 2018
*/
// Add metabox in order page
function smartbill_order_details_meta_box() {
//afisare doar daca s-a publicat / salvat postarea
if (isset($_GET['post'])){
@giucu91
giucu91 / mobile-menu.html
Last active May 27, 2020 14:19
mobile-menu
<script>
(function($){
var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
@giucu91
giucu91 / woo-facturare-labels.php
Created May 13, 2020 15:02
Adaugarea unui label inainte fiecarui field.
add_filter( 'woocommerce_formatted_address_replacements', 'woo_facturare_extra_labels', 95, 2 );
function woo_facturare_extra_labels( $replacements, $args ){
$replacements['{first_name}'] = ( '' != $replacements['{first_name}'] ) ? 'Label: ' . $replacements['{first_name}'] : $replacements['{first_name}'];
$replacements['{last_name}'] = ( '' != $replacements['{last_name}'] ) ? 'Label: ' . $replacements['{last_name}'] : $replacements['{last_name}'];
$replacements['{name}'] = ( '' != $replacements['{name}'] ) ? 'Label: ' . $replacements['{name}'] : $replacements['{name}'];
$replacements['{company}'] = ( '' != $replacements['{company}'] ) ? 'Label: ' . $replacements['{company}'] : $replacements['{company}'];
$replacements['{address_1}'] = ( '' != $replacements['{address_1}'] ) ? 'Label: ' . $replacements['{address_1}'] : $replacements['{address_1}'];
$replacements['{address_2}'] = ( '' != $replacements['{address_2}'] ) ? 'Label: ' . $replacements['{address_2}'] : $replacements['{address_2}'];
@giucu91
giucu91 / item.php
Created February 10, 2020 12:24
Modula ADA Compliance
<div class="<?php echo esc_attr(implode( ' ', $data->item_classes )) ?>"<?php echo Modula_Helper::generate_attributes( $data->item_attributes ) ?> >
<?php do_action( 'modula_item_before_link', $data ); ?>
<?php if ( 'no-link' != $data->lightbox ): ?>
<a<?php echo Modula_Helper::generate_attributes( $data->link_attributes ) ?> class="<?php echo esc_attr(implode( ' ', $data->link_classes )) ?>">
<?php endif ?>
<?php do_action( 'modula_item_after_link', $data ); ?>
@giucu91
giucu91 / functions.php
Last active January 14, 2020 08:18
[Modula] - Remove captions from lightbox
<?php
add_filter( 'modula_shortcode_item_data', 'photoguy_link_title', 99, 3 );
function photoguy_link_title( $item_data, $item, $settings ){
if( isset( $item_data['link_attributes']['title'] ) ){
unset( $item_data['link_attributes']['title'] );
}
if( isset( $item_data['link_attributes']['data-sub-html'] ) ){
unset( $item_data['link_attributes']['data-sub-html'] );