Jump to content
Latest News: (loading..)

1Putts

Members
  • Content count

    216
  • Joined

  • Last visited

1 Follower

Profile Information

  1. 1Putts

    Help merging these two statements

    Thanks again, Jan. Mystery solved...there was in fact another similar query that needed to be modified as well. It's the one that "clones" product attributes...so here's the new one in case anyone is doing something similar: tep_db_query("INSERT INTO " . TABLE_PRODUCTS_ATTRIBUTES . " ( products_id, options_id, options_values_id, options_values_price, price_prefix, attribute_sort, attributes_hide_from_groups) VALUES (".$clone_product_id_to.", ".$attributes_values['options_id'].", ".$attributes_values['options_values_id'].", ".$attributes_values['options_values_price'].", '".$attributes_values['price_prefix']."' , ".$attributes_values['attribute_sort'].", '@')");
  2. 1Putts

    Help merging these two statements

    Thanks again, Jan. Mystery solved...there was in fact another similar query that needed to be modified as well. It's the one that "clones" product attributes...so here's the new one in case anyone is doing something similar: tep_db_query("INSERT INTO " . TABLE_PRODUCTS_ATTRIBUTES . " ( products_id, options_id, options_values_id, options_values_price, price_prefix, attribute_sort, attributes_hide_from_groups) VALUES (".$clone_product_id_to.", ".$attributes_values['options_id'].", ".$attributes_values['options_values_id'].", ".$attributes_values['options_values_price'].", '".$attributes_values['price_prefix']."' , ".$attributes_values['attribute_sort'].", '@')");
  3. 1Putts

    Help merging these two statements

    OK, here's my latest attempt but still no luck: tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values (null, '" . (int)$products_id . "', '" . (int)$options_id . "', '" . (int)$values_id . "', '" . (float)tep_db_input($value_price) . "', '" . tep_db_input($price_prefix) . "', '" . (int)$attributes_sort . "', '@')"); Is it necessary to have the (null, at the beginning of the statement? Maybe that's what is throwing if off...
  4. 1Putts

    Help merging these two statements

    Thanks Jan. I have the the right number of fields all set up and in the correct order. I've tried merging those two statements together and I'm probably just not getting the syntax just right. Everything is right except the last field which ends up being "NULL" instead of "@". So I'm just looking for the correct syntax. For example, this is what I have now and it's apparently not right: tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values (null, '" . (int)$products_id . "', '" . (int)$options_id . "', '" . (int)$values_id . "', '" . (float)tep_db_input($value_price) . "', '" . tep_db_input($price_prefix) . "', '" . (int)$attributes_sort . "' '@')");
  5. This shouldn't be too difficult but for some reason I can't get the syntax quite right. I'm trying to merge these two statements together into one so that it adds both the sort order (attributes_sort) and hide from groups (@) to the database. Here are the two statements: tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values (null, '" . (int)$products_id . "', '" . (int)$options_id . "', '" . (int)$values_id . "', '" . (float)tep_db_input($value_price) . "', '" . tep_db_input($price_prefix) . "', '@')"); tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values (null, '" . (int)$products_id . "', '" . (int)$options_id . "', '" . (int)$values_id . "', '" . (float)tep_db_input($value_price) . "', '" . tep_db_input($price_prefix) . "', '" . (int)$attributes_sort . "')"); I need the "@" to be the last item inserted. My efforts have resulted in it just adding "NULL" instead of the "@" and, as a result, the product attributes don't show up. Thanks in advance for any help.
  6. Fix has been posted on the contribution and support thread with full credit given. Thanks again to you both for your help.
  7. I was getting an error when trying to use the Order Editor Contribution v5.0.6.6 (http://addons.oscommerce.com/info/1435) with the MultiZone MultiTable Shipping Module. When I tried edit an order on a server which was running PHP 5.2.6, I got the following error: Fatal error: Call to a member function show_total() on a non-object in /catalog/includes/modules/shipping/mzmt.php on line 137 Both Jim Keebaugh and Robert Fisher were kind enough to help me solve this problem, so thank you to both. All it involves is editing this file: catalog/includes/modules/shipping/mzmt.php And REPLACING the function determineShipping($table_cost) So REPLACE the entire function to this: function determineShipping($table_cost) { global $shipping_num_boxes; for ($i=0, $n=sizeof($table_cost); $i<$n; $i+=2) { if ($this->order_total >= $table_cost[$i]) { $shipping_factor = $table_cost[$i+1]; } } if (substr_count($shipping_factor, '%') > 0) { $shipping = ((($this->order_total*10)/10)*((str_replace('%', '', $shipping_factor))/100)); } else { $shipping = str_replace('$', '', $shipping_factor); } if ($this->geozone_mode == 'weight') { $shipping = $shipping * $shipping_num_boxes; } return $shipping; } Thank you again for your help. Fix also posted as v1.21 on the contribution page.
  8. I double checked and all the files were there. However, I replaced the function as you instructed above and...IT WORKED! Thank you Jim and also thank you Robert for you assistance. I never would have gotten this on my own...I Googled my brains out all day and couldn't find anything nearly as useful as you two. Thank you so much...I love ending the day with at least one thing accomplished. Now how to add this info to the shipping contribution so that others can benefit from your expertise? This is the shipping contribution: http://addons.oscommerce.com/info/2571 and, of course, the infamous order editor: http://addons.oscommerce.com/info/1435
  9. ADDENDUM for Kymation: Here is what is returned...for some reason I didn't get all this the first time around: Session: Array ( [language] => english [languages_id] => 1 [selected_box] => customers [admin] => Array ( [id] => 1 [username] => admin ) [cart] => manualcart Object ( [contents] => Array ( [2] => Array ( [qty] => 1 ) [1] => Array ( [qty] => 2 ) ) [total] => 199.9 [weight] => 3 ) )
  10. Thank you both for your help. Robert, I tried your suggestion first and it appeared to work. That is, I didn't get the same error when I hit "Edit" on the order. But then when I attempted to change a value in the shipping, I received a bunch of errors (which I'll post below). Kymation, your suggestion returns the following...so what exactly am I looking for here? Session: Array ( [language] => english [languages_id] => 1 [selected_box] => customers [admin] => Array ( [id] => 1 [username] => admin ) ) And Robert, here are the error messages (there's quite a bit): Warning: order_total::include(includes/languages/english/modules/order_total/ot_subtotal.php) [order-total.include]: failed to open stream: No such file or directory in /catalog/admin/order_editor/order_total.php on line 30 Warning: order_total::include(includes/languages/english/modules/order_total/ot_subtotal.php) [order-total.include]: failed to open stream: No such file or directory in /catalog/admin/order_editor/order_total.php on line 30 Warning: order_total::include() [function.include]: Failed opening 'includes/languages/english/modules/order_total/ot_subtotal.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/usr/share/pear/') in /catalog/admin/order_editor/order_total.php on line 30 Warning: order_total::include(includes/modules/order_total/ot_subtotal.php) [order-total.include]: failed to open stream: No such file or directory in /catalog/admin/order_editor/order_total.php on line 31 Warning: order_total::include(includes/modules/order_total/ot_subtotal.php) [order-total.include]: failed to open stream: No such file or directory in /catalog/admin/order_editor/order_total.php on line 31 Warning: order_total::include() [function.include]: Failed opening 'includes/modules/order_total/ot_subtotal.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/usr/share/pear/') in /catalog/admin/order_editor/order_total.php on line 31 Fatal error: Class 'ot_subtotal' not found in /catalog/admin/order_editor/order_total.php on line 34 And here is the relevant function code from the order_total.php file from the order editor: 18 class order_total { 19 var $modules; 20 21 // class constructor 22 function order_total() { 23 global $language; 24 25 if (defined('MODULE_ORDER_TOTAL_INSTALLED') && tep_not_null(MODULE_ORDER_TOTAL_INSTALLED)) { 26 $this->modules = explode(';', MODULE_ORDER_TOTAL_INSTALLED); 27 28 reset($this->modules); 29 while (list(, $value) = each($this->modules)) { 30 include(DIR_WS_LANGUAGES . $language . '/modules/order_total/' . $value); 31 include(DIR_WS_MODULES . 'order_total/' . $value); 32 33 $class = substr($value, 0, strrpos($value, '.')); 34 $GLOBALS[$class] = new $class; 35 } 36 } 37 } Again, thank you both so much for your assistance. I appreciate it very much.
  11. I'm getting the following error when I try to use the order editor contrib and edit an order on a live server which is running PHP 5.2.6: Fatal error: Call to a member function show_total() on a non-object in /osc/includes/modules/shipping/mzmt.php on line 137 mzmt.php is a multi-zone, mult-table shipping rate calculator. Line 137 is part of a function that reads as follows: 131 function determineTableMethod($geozone_mode) { 132 global $total_count, $shipping_weight; 133 134 $this->geozone_mode = $geozone_mode; 135 136 if ($this->geozone_mode == 'price') { 137 $this->order_total = $_SESSION['cart']->show_total(); 138 } elseif ($this->geozone_mode == 'count') { 139 $this->order_total = $total_count; 140 } else { 141 $this->order_total = $shipping_weight; 142 } 143 144 return true; 145 } It all works on my local machine where I'm running PHP 4.3.11 so I'm guessing it's a PHP issue. I've looked high and low and I can't find any solutions that will work. Thanks in advance for any ideas you can offer.
  12. 1Putts

    Seperate Pricing Per Customer v3.5

    Never mind "something like" - that's was it exactly. Thanks again for your wonderful help. Turns out I didn't even need to change the customer group pricing at all since they are linked to the customer group number. So changing the group number, in effect, changes the pricing for that group. And then to set the customer group 0 pricing to 0, all I did was follow your example: update products set products_price = '0'; And it's done. Very nice!
  13. 1Putts

    Seperate Pricing Per Customer v3.5

    Thanks, that certainly has me on the right track. There's also modifying the customers table to assign the customers to their new group number. The big problem I see right now is how to assign all the pricing from customer group 0 to customer group 1 since they are actually contained in different tables. Changing pricing for groups 1 and 2 is easy enough (same idea as you already gave me) but how would I get the pricing from products -> products_price into products_groups -> customers_group_price and assign the customer_group_id to "1"? Then I'll need to set all the products -> products_price to 0. Thanks.
  14. 1Putts

    Seperate Pricing Per Customer v3.5

    I need to add a new customer group into position 0 and essentially shift all the others up one slot. So right now customer group 0 is "retail", group 1 is "wholesale level 1" etc. I want to make group 0 something like "pending", group 1 would be "retail", group 2 "wholesale level 1" etc. What would be the appropriate SQL statement to insert this new group while maintaining all the current pricing on the other groups. Oh yeah, the pricing for all the products for the new default group 0 will also be 0 (so I can not show pricing until they are assigned a group). Thanks in advance.
  15. I want to add a new customer group called "Uncatagorized" which would be the new default (0). All the prices for this group would will be "$0.00". So the way it is now: Retail & Default (customer group 0) Wholesale Level 1 (customer group 1) Wholesale Level 2 (customer group 2) Would end up like this: Uncategorized (customer group 0) Retail (customer group 1) Wholesale Level 1 (customer group 2) Wholesale Level 2 (customer group 3) So what I need to do is shift all the customer groups and associated product pricing up one and insert the new group at the bottom without screwing up the current pricing table or the current customer groups that exist right now. I realize this will take some kind of fancy SQL statement (or a series of them) but right now I can't get my head around the logic. If anyone has any suggestions, I'd appreciate it. Thanks. Edit: I thought I was posting this in the SPPC thread but apparently I wasn't. So this question only pertains to SPPC.
×