Posted By

haftim on 11/04/10


Tagged

wordpress Ecommerce wp-ecommerce


Versions (?)

WP-Ecommerce - processing.functions.php


 / Published in: PHP
 

Sale Price/Variation custom this code just work if all variation price is a same as product price

  1. find
  2.  
  3. $price = $wpdb->get_var("SELECT `price` FROM `".WPSC_TABLE_VARIATION_PROPERTIES."` WHERE `id` = '{$priceandstock_id}' LIMIT 1");
  4.  
  5. change to this
  6.  
  7. $variation_data = $wpdb->get_var("SELECT `price` FROM `".WPSC_TABLE_VARIATION_PROPERTIES."` WHERE `id` = '{$priceandstock_id}' LIMIT 1");
  8. $product_data = $wpdb->get_row("SELECT `price`,`special`,`special_price` FROM `".WPSC_TABLE_PRODUCT_LIST."` WHERE `id`='".$product_id."' LIMIT 1",ARRAY_A);
  9.  
  10. if(($product_data['special_price'] > 0) && (($product_data['price'] == $variation_data) >= 0) && (($variation_data - $product_data['special_price']) >= 0) && ($no_special == false)) {
  11. $price = $product_data['special_price'];
  12. } else {
  13. $price = $variation_data;
  14.  
  15. }

Report this snippet  

You need to login to post a comment.