EvelynWaugh
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce Cart Abandonment Recovery] Wrong schedule datesThanks, now it is all good, it was some problem with wp cron.
Forum: Plugins
In reply to: [Pizza builder for WooCommerce] How to change the word ” Ingredients “Thanks, you’re welcome
Forum: Plugins
In reply to: [Pizza builder for WooCommerce] How to change the word ” Ingredients “add_filter('ev_pizza_extras_text', 'leche_ev_pizza_extras_text');
function leche_ev_pizza_extras_text() {
return 'Supplements';
}Paste it to functions.php, or as a code snippet.
- This reply was modified 2 months ago by EvelynWaugh.
- This reply was modified 2 months ago by EvelynWaugh.
@dannwagner thanks, I’m happy you’re pleased.
Forum: Plugins
In reply to: [Pizza builder for WooCommerce] Empty fields on mobilHi, yes try .pizza-components-tabs {max-width: 84vw}
Well, this works, already pasted to your snippets:
add_filter( 'wcdn_order_item_fields', 'custom_wcdn_order_item_fields', 10, 4 );
function custom_wcdn_order_item_fields( $fields, $product, $order, $item ) {
if($product->is_type('variation')) {
$pizza_product = get_post_meta( $product->get_parent_id(), '_ev_pizza', true ) === 'yes' ? true : false;
}
else {
$pizza_product = get_post_meta( $product->get_id(), '_ev_pizza', true ) === 'yes' ? true : false;
}
if ( ! $pizza_product ) {
return $fields;
}
$item_data = $item->get_meta_data();
$index = 0;
foreach ( $item_data as $meta ) {
if ( $meta->key !== '_ev_pizza_config' ) continue;
if ( ! isset( $meta->value['consists_of']['to_add'] ) ) continue;
foreach ( $meta->value['consists_of']['to_add'] as $component ) {
$index++;
$fields['ev_component' . $index ] = array(
'label' => $component['name'],
'value' => strip_tags(wc_price($component['price'])),
);
}
}
return $fields;
}@dannwagner Hi, sorry, currently I am not available for deep testing, but will try to include this in next release.
Try this:
add_filter( 'wcdn_order_item_fields', 'example_wcdn_order_item_fields', 10, 4 );
function example_wcdn_order_item_fields( $fields, $product, $order, $item ) {
$pizza_product = get_post_meta( $product->get_id(), '_ev_pizza', true ) === 'yes' ? true : false;
if ( ! $pizza_product ) {
return $fields;
}
$item_data = $item->get_meta_data();
$index = 0;
foreach ( $item_data as $meta ) {
if ( $meta->key !== '_ev_pizza_config' ) continue;
if ( ! isset( $meta->value['extra']['components'] ) ) continue;
$index++ ;
$fields['ev_component' .$index ] = array(
'label' => $meta->key,
'value' => $meta->value,
);
}
return $fields;
}- This reply was modified 2 months, 4 weeks ago by EvelynWaugh.
Try this:
add_filter( 'wcdn_order_info_fields', 'example_custom_order_fields', 10, 2 );
function example_custom_order_fields( $fields, $order ) {
$new_fields = array();
$order_items = $order->get_items(array('line_item'));
foreach($order_items as $item_id => $item) {
$pizza_product = get_post_meta( $item->get_data()['product_id'], '_ev_pizza', true ) === 'yes' ? true : false;
if ( ! $pizza_product ) continue;
$item_data = $item->get_meta_data();
$index = 0;
foreach ( $item_data as $meta ) {
if ( $meta->key !== '_ev_pizza_config' ) {
continue;
}
if ( ! isset( $meta->value['extra']['components'] ) ) {
continue;
}
$index++ ;
$new_fields['ev_component' .$index ] = array(
'label' => $meta->key,
'value' => $meta->value,
);
}
}
return array_merge( $fields, $new_fields );
}Ok try then display_meta_thankyou_extra($item_id, $item, $order) from includes/pizza-checkout.php
Hi, I dont know if that works for you, but you can try display_meta_thankyou_main($item_id, $item, $order) from includes/pizza-checkout.php
Next release will try to make it compatible with that plugin.
Hi @dannwagner, sorry I dont quite understand. Do you use any extra plugins for printing invoice? Share it please.
Forum: Plugins
In reply to: [Pizza builder for WooCommerce] TranslateHi, for Choose side you can you
ev_pizza_add_side_button
hook, for Choose Layer –ev_pizza_add_layer_button
.For example:
add_filter('ev_pizza_add_side_button', function() { return 'Your Button Name'; });
Forum: Fixing WordPress
In reply to: Block themes with wp.template = errorI found, it is about ‘&&’. Why in <# if(1 && 1) { #> error occurs