Carmelo Baglieri
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce Stripe Payment Gateway] payment_method not createdSorry, it was my theme, thank you for your support
Forum: Plugins
In reply to: [WooCommerce Stripe Payment Gateway] payment_method not createdThank you for the answer. The Vue app is just a checkout wrapper, infact I tried to load the checkout normally and the problem is the same.
The runned function is process_payment_with_payment_method and payment_informations not contains payment_method.
Forum: Plugins
In reply to: [WooCommerce Stripe Payment Gateway] payment_method not createdHi Moses, sorry for the delay. The problem is not the vue integration, the card is fully loaded and it works, the problem may be is the upe payment. It seems the plugin load ‘wc-stripe-payment-method-upe’ but it isn’t the correct post field needed from the plugin class to process the payment, it should be?
Forum: Plugins
In reply to: [WooCommerce] Negative fees should not make the order total go negativeprotected function get_fees_from_cart() {
$this->fees = array();
$this->cart->calculate_fees();
$enable_negative_fees = apply_filters( 'woocommerce_negative_fees_enabled', false );
$fee_running_total = 0;
foreach ( $this->cart->get_fees() as $fee_key => $fee_object ) {
$fee = $this->get_default_fee_props();
$fee->object = $fee_object;
$fee->tax_class = $fee->object->tax_class;
$fee->taxable = $fee->object->taxable;
$fee->total = wc_add_number_precision_deep( $fee->object->amount );
if( ! $enable_negative_fees ){
// Negative fees should not make the order total go negative.
if ( 0 > $fee->total ) {
$max_discount = NumberUtil::round( $this->get_total( 'items_total', true ) + $fee_running_total + $this->get_total( 'shipping_total', true ) ) * -1;
if ( $fee->total < $max_discount ) {
$fee->total = $max_discount;
}
}
$fee_running_total += $fee->total;
}
if ( $this->calculate_tax ) {
if ( ! $enable_negative_fees && 0 > $fee->total ) {
// Negative fees should have the taxes split between all items so it works as a true discount.
$tax_class_costs = $this->get_tax_class_costs();
$total_cost = array_sum( $tax_class_costs );
if ( $total_cost ) {
foreach ( $tax_class_costs as $tax_class => $tax_class_cost ) {
if ( 'non-taxable' === $tax_class ) {
continue;
}
$proportion = $tax_class_cost / $total_cost;
$cart_discount_proportion = $fee->total * $proportion;
$fee->taxes = wc_array_merge_recursive_numeric( $fee->taxes, WC_Tax::calc_tax( $fee->total * $proportion, WC_Tax::get_rates( $tax_class ) ) );
}
}
} elseif ( $fee->object->taxable ) {
$fee->taxes = WC_Tax::calc_tax( $fee->total, WC_Tax::get_rates( $fee->tax_class, $this->cart->get_customer() ), false );
}
}
$fee->taxes = apply_filters( 'woocommerce_cart_totals_get_fees_from_cart_taxes', $fee->taxes, $fee, $this );
$fee->total_tax = array_sum( array_map( array( $this, 'round_line_tax' ), $fee->taxes ) );
// Set totals within object.
$fee->object->total = wc_remove_number_precision_deep( $fee->total );
$fee->object->tax_data = wc_remove_number_precision_deep( $fee->taxes );
$fee->object->tax = wc_remove_number_precision_deep( $fee->total_tax );
$this->fees[ $fee_key ] = $fee;
}
}Forum: Plugins
In reply to: [Sublanguage] Access to “translate options” fileAwesome! Also for me it’s an important tool, otherwise I can’t translate all options of custom plugins. Thank you @maximeschoeni
Forum: Plugins
In reply to: [Google Analytics for WooCommerce] gTag event js errorSure, it’s just because with an html minification cause the set of the code as in same line, so when you call
$( ‘.product.post-“….
$ is not a function
It’s necessary to close instruction with (;)
Woocommerce status is ok
Forum: Plugins
In reply to: [Contact Form 7] Recaptcha v3It has my own theme with visual composer and woocommerce with my custom plugin to make a multivendor site, but it isn’t this the problem because I found this error in all my website. You can find the solution here
Forum: Plugins
In reply to: [Contact Form 7] Recaptcha v3mercatoitinerante.it
Forum: Plugins
In reply to: [Sublanguage] Content not translated on update cart woocommerce/*retrive with cookie*/
add_action(‘wp_head’,function(){
global $sublanguage;
?>
<script>
/*lang cookie*/
var d = new Date();
var expire = new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours()+2, d.getMinutes());
document.cookie = “lang=<?php echo $sublanguage->current_language->post_name; ?>; expires=”+expire+”; path=/”;
</script>
<?php
});