Guest User

Untitled

a guest
Jan 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. <div class="select-price">
  2. <?php
  3. $order_id = $_SESSION['orderid'];
  4. $addonID = get_the_id();
  5. if($_SESSION['currenttrip']>1){
  6. $order_item_amount = 0;
  7. }else{
  8. $qty = $wpdb->get_row("SELECT order_item_total, order_item_name, order_item_amount FROM fcb_order_item WHERE order_id=$order_id AND order_item_addon_id=$addonID");
  9. $order_item_amount = ($qty->order_item_amount) ? $qty->order_item_amount : 0;
  10. }
  11.  
  12. if(get_post_meta(get_the_ID(), 'fcb_addon_pricing_type', true) == 'fixed'){
  13.  
  14. $max = get_post_meta(get_the_ID(), 'fcb_addon_max_amount', true);
  15. $options = array_fill(1, $max, 'option');
  16.  
  17. echo '<input data-addon-id="'.get_the_id().'" data-price="'.$price.'" type="button" value="-" class="qtyminus new-add-item add-service-item plus left '.$addonID.'" data-type="minus" field="quantity" />';
  18. echo '<input class="airport-value qty qty-'.get_the_id().'" type="number" name="quantity" value="'.$order_item_amount.'" />';
  19. echo '<input data-addon-id="'.get_the_id().'" data-price="'.$price.'" type="button" value="+" class="qtyplus new-add-item add-service-item minus right '.$addonID.'" data-type="plus" field="quantity" />';
  20.  
  21. } elseif (get_post_meta(get_the_ID(), 'fcb_addon_pricing_type', true) == 'variable') {
  22.  
  23. $options = get_post_meta(get_the_ID(), 'fcb_variable', true);
  24.  
  25. echo '<input data-addon-id="'.get_the_id().'" data-price="'.$options[0]['price'].'" type="button" value="-" class="qtyminus new-add-item add-service-item plus left '.$addonID.'" data-type="minus" field="quantity" />';
  26. echo '<input class="airport-value qty qty-'.get_the_id().'" type="number" name="quantity" value="'.$order_item_amount.'" />';
  27. echo '<input data-addon-id="'.get_the_id().'" data-price="'.$options[0]['price'].'" type="button" value="+" class="qtyplus new-add-item add-service-item minus right '.$addonID.'" data-type="plus" field="quantity" />';
  28.  
  29. }
  30. ?>
  31. </div>
  32.  
  33. foreach ($_GET as $key => $value) { }
Add Comment
Please, Sign In to add comment