Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function update_price_wpuf_form( $post_id ) {
- $boolChifre = isset( $_POST['pa_chifre'] ) ? $_POST['pa_chifre'] : 0;
- $currentPrice = get_post_meta( $post_id, '_regular_price' );
- $images = get_post_meta( $post_id, '_product_image' );
- $images = count($images);
- if ( $images > 2 ) {
- $currentPrice = 35;
- }
- if( $boolChifre == 62) {
- $regular_price = (int)$currentPrice + 10;
- }
- update_post_meta( $post_id, '_regular_price', $regular_price );
- }
Add Comment
Please, Sign In to add comment