Saravana Kumar K
Forum Replies Created
-
Forum: Plugins
In reply to: [WC Fields Factory] Changing Prices – Nearly There!Hi seank123,
To add additional fee to the Cart Total, you could use
woocommerce_after_calculate_totalssomething like thisnote: you should remove
woocommerce_before_calculate_totalsfirstfunction calculate_cart_total( $cart_object ) { /* additional price that has to be added */ $additionalPrice = 20; foreach ( $cart_object->cart_contents as $key => $value ) { /* Check for the value ( or it could be any condition logic ) */ if( isset( $value['wccpf_new_logo_upload'] ) && $value['wccpf_new_logo_upload'] == "yes" ) { //Update the Cart Grand Total $cart_object->cart_contents_total += $additionalPrice; } } } add_action( 'woocommerce_after_calculate_totals', 'calculate_cart_total' );Forum: Plugins
In reply to: [WC Fields Factory] datepicker problemHi, the fix is ready, I am preparing for the next release. will be available soon.
Forum: Plugins
In reply to: [WC Fields Factory] Conditional FieldsHi, currently it’s not supported, but this feature is in my road map, I will make it available ASAP.
Regards
SarkHi are you seeing any error in Console Log ( Chrome Dev Tool ) while updating fields meta .?
Forum: Plugins
In reply to: [WC Fields Factory] Multiple File UploadHi, sure I will include this with my next release, probably within a week you can expect.
Regards
SarkHi, which version of WC Fields Factory are you using.? as far as I know themes doesn’t have anything to do with this. If you still thinks that this could be of theme problem, try to activate different theme and do your updates.
Forum: Plugins
In reply to: [WC Fields Factory] Validation Fails But Still Added to CartHi, This issue is related to Validation Hook priority.
WP_PLUGIN/wc-fields-factory/classes/product-form.php LN : 21
Change that validation hook priority value from 1 to 99. like this
add_filter( 'woocommerce_add_to_cart_validation', array( $this, 'validate_wccpf' ), 99, 2 );I will update this with my next release
Regards
SarkForum: Plugins
In reply to: [WC Fields Factory] Validate Input FieldsHi, this option is under progress, will be available with my next release.
Forum: Plugins
In reply to: [WC Fields Factory] Validate Input FieldsHi, you could do something like this
add_filter( 'woocommerce_add_to_cart_validation', 'validate_field', 10, 2 ); function validate_field( $passed, $pid = null ) { $res = true; if( isset( $pid ) ) { $all_fields = apply_filters( 'wccpf/load/all_fields', $pid ); foreach ( $all_fields as $fields ) { foreach ( $fields as $field ) { if( $field["name"] == "your_field_name" && isset( $_REQUEST[ $field["name"] ] ) ) { $val = $_REQUEST[ $field["name"] ]; if( $val != "M" || $val != "F" ) { $res = false; } } } if( !$res ) { wc_add_notice( 'Validation Failed', 'error' ); } } } return $res; }Forum: Plugins
In reply to: [WC Fields Factory] Validation failure clears form fieldsHi danomurray, thanks for raising this.
That would be great if all values remains even after a validation failed.
Yes it is possible. I will try to include on my next release.( I will try to give you quick update, if got time )
Regards
SarkForum: Plugins
In reply to: [WC Fields Factory] Few IssuesHi,
I switch Display on Cart & Checkout to No but upon save the value to Yes
Does it worked.?
Regarding that Date picker issue, are you using V1.2.4 .? because it’s been fixed on that version.
Regards
SarkForum: Plugins
In reply to: [WC Fields Factory] Grouped Product ClonerHi, thanks for reporting this.
I actually tested only for Simple & Variable products. I will test it for grouped as well and try to fix it. will add this to my check list and try to release with the next update.
Regards
SarkForum: Plugins
In reply to: [WC Fields Factory] Custom Price doesn't workHere is the updated snippet.
function calculate_cart_total( $cart_object ) { foreach ( $cart_object->cart_contents as $key => $value ) { $all_fields = apply_filters( 'wccpf/load/all_fields', $product_id ); foreach ( $all_fields as $fields ) { foreach ( $fields as $field ) { if( $field["name"] == "donation_amount" ) { $fvalue = $value['wccpf_unique_key'].$field["name"]; //change the price $value['data']->price = $fvalue; } } } } } add_action( 'woocommerce_before_calculate_totals', 'calculate_cart_total', 1, 1 );Forum: Plugins
In reply to: [WC Fields Factory] Displaying custom fields in the ordersHi, If I understand correctly, you wanted to display custom fields values to Order Archive Page itself right.?
You can do some thing like this
add_filter( 'manage_edit-shop_order_columns', 'my_custom_column_handler' ); function my_custom_column_handler( $columns ){ $new_columns = ( is_array( $columns ) ) ? $columns : array(); unset( $new_columns['order_actions'] ); $new_columns['custom_column'] = 'CUstom Column'; $new_columns['order_actions'] = $columns['order_actions']; return $new_columns; } add_action( 'manage_shop_order_posts_custom_column', 'my_custom_column_value_handler', 2 ); function my_custom_column_value_handler( $column ){ global $post; if( $column == "custom_column" ) { // Loop through your order line items & display whatever custom fields you want // using wc_get_order_item_meta( $item_id, $key ); } }Forum: Plugins
In reply to: [WC Fields Factory] Color text optionsHi sorry for the delayed response.
Here is the complete css class, which you can use to customize the flook & feels of the fields created by WC Fields Factory.
body.woocommerce table.wccpf_fields_table { } body.woocommerce table.wccpf_fields_table td { } body.woocommerce table.wccpf_fields_table td.wccpf_label { } body.woocommerce table.wccpf_fields_table td.wccpf_value { } body.woocommerce table.wccpf_fields_table td.wccpf_label label { } body.woocommerce table.wccpf_fields_table td.wccpf_value input[type=text], body.woocommerce table.wccpf_fields_table td.wccpf_value input[type=email], body.woocommerce table.wccpf_fields_table td.wccpf_value input[type=number], body.woocommerce table.wccpf_fields_table td.wccpf_value select { }