Guest User

Untitled

a guest
Aug 18th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. <?php
  2. function update_price_wpuf_form( $post_id ) {
  3. $boolChifre = isset( $_POST['pa_chifre'] ) ? $_POST['pa_chifre'] : 0;
  4. $currentPrice = get_post_meta( $post_id, '_regular_price' );
  5. $images = get_post_meta( $post_id, '_product_image' );
  6. $images = count($images);
  7.  
  8. if ( $images > 2 ) {
  9. $currentPrice = 35;
  10. }
  11.  
  12. if( $boolChifre == 62) {
  13. $regular_price = (int)$currentPrice + 10;
  14. }
  15.  
  16. update_post_meta( $post_id, '_regular_price', $regular_price );
  17. }
Add Comment
Please, Sign In to add comment