Jump to content

protokop

Members
  • Content count

    19
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Kevin
  1. protokop

    order number

    no idea, it was already installed, how can i find out? i think maybe its an old version... v1.39 or v1.7 mean anything? they are two version numbers at the top of the two paypal files... :blink:
  2. protokop

    order number

    i know for some payment modules they use the function time() as the description or something to track who paid when. I am just wondering if there is a similar function that i can call to get the order number. ie, in the paypal module, i want to change the item name field to the equivilent of... tep_draw_hidden_field('item_name', 'order number: ' get_order_number()) can someone help me out with what i need to write for this line of code... it should be the text "order number: " followed by the actual number in other words i don't know PHP so i need to know how to write a string of writen characters, followed by a variable. Also i need to know what function to call to retreve that variable. thanks
  3. you beauty mibble... solved my problem :)
  4. protokop

    gift vouchers

    bump
  5. I have the same problems as swart above, except that my email link is fine. The only problem i have is the addition of shipping upon checkout. I read somewhere that if only a gift voucher is purchased then it skips the delivery/shipping page. is this true? I saw in the code item and virtual_item so it appears that my cart isn't assigning the gv as a virtual item. i use a flat shipping rate. any help greatly apreciated.
  6. protokop

    gift vouchers

    so are you saying the fact that it adds shipping is normal? i thought i read in another thread that it was supposed to skip the delivery/shipping page can someone verify for me, and help me out with the above problem if it doesn't then it needs like a... if (virtual item != 0 && real item == 0) then skip the whole shipping and delivery address page go straight to payment else do as normal (well in my case cos i use flat rate shipping)
  7. protokop

    gift vouchers

    i have installed the gift vouchers addon, everything works fine except for one thing. I read somewhere that if u purchase a gift voucher it should skip the shipping page, and not add shipping, my cart however treats it as a normal order. i have checked checkout_shipping.php and shopping_cart.php in the base catalogue dir. Both these have the exact code that they should. can someone point me in the direction of where the gift certs are setup as virtual items so i can verify those files. oh and btw... yes i have set them up as GIFT100 and the id, and yes they get added to the queue. only thing i can see is that would cause this is that i accidentally installed version b instead of c, its very hard trying to upgrade it as there is so much with this addon. thats why i just want to know where i should start looking. any help is appreciated :thumbsup:
  8. protokop

    ccgv-510c

    fixed this, there are two repeated lines of code in payment_confirmation.php, i only thought one had to be removed, but it looks like both do
  9. protokop

    ccgv-510c

    hi guys, just wondering if someone could give me a hand... i keep getting a Fatal error: Cannot redeclare class ot_subtotal in /shop/includes/modules/order_total/ot_subtotal.php on line 13 i realise from other similar posts (not the same though) it is something that is trying to run/access it twice, but i'm not sure wat... if i rename the class ot_subtotal.php then i get an error on line 29 of order_total.php now i can't find two lines the same as line 29, so i was wondering if someone could have a quick look and let me know. much appreciated <?php /* $Id: order_total.php,v 1.4 2003/02/11 00:04:53 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class order_total { var $modules; // class constructor function order_total() { global $language; if (defined('MODULE_ORDER_TOTAL_INSTALLED') && tep_not_null(MODULE_ORDER_TOTAL_INSTALLED)) { $this->modules = explode(';', MODULE_ORDER_TOTAL_INSTALLED); reset($this->modules); while (list(, $value) = each($this->modules)) { include(DIR_WS_LANGUAGES . $language . '/modules/order_total/' . $value); include(DIR_WS_MODULES . 'order_total/' . $value); $class = substr($value, 0, strrpos($value, '.')); $GLOBALS[$class] = new $class; } } } function process() { $order_total_array = array(); if (is_array($this->modules)) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled) { $GLOBALS[$class]->process(); for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) { if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) { $order_total_array[] = array('code' => $GLOBALS[$class]->code, 'title' => $GLOBALS[$class]->output[$i]['title'], 'text' => $GLOBALS[$class]->output[$i]['text'], 'value' => $GLOBALS[$class]->output[$i]['value'], 'sort_order' => $GLOBALS[$class]->sort_order); } } } } } return $order_total_array; } function output() { $output_string = ''; if (is_array($this->modules)) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled) { $size = sizeof($GLOBALS[$class]->output); for ($i=0; $i<$size; $i++) { $output_string .= ' <tr>' . "\n" . ' <td align="right" class="main">' . $GLOBALS[$class]->output[$i]['title'] . '</td>' . "\n" . ' <td align="right" class="main">' . $GLOBALS[$class]->output[$i]['text'] . '</td>' . "\n" . ' </tr>'; } } } } return $output_string; } // ICW ORDER TOTAL CREDIT CLASS/GV SYSTEM - START ADDITION // // This function is called in checkout payment after display of payment methods. It actually calls // two credit class functions. // // use_credit_amount() is normally a checkbox used to decide whether the credit amount should be applied to reduce // the order total. Whether this is a Gift Voucher, or discount coupon or reward points etc. // // The second function called is credit_selection(). This in the credit classes already made is usually a redeem box. // for entering a Gift Voucher number. Note credit classes can decide whether this part is displayed depending on // E.g. a setting in the admin section. // function credit_selection() { $selection_string = ''; $close_string = ''; $credit_class_string = ''; if (MODULE_ORDER_TOTAL_INSTALLED) { $header_string = '<tr>' . "\n"; $header_string .= ' <td><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n"; $output1_string .= ' <tr>' . "\n"; $header_string .= ' <td class="main"><b>' . TABLE_HEADING_CREDIT . '</b></td>' . "\n"; $header_string .= ' </tr>' . "\n"; $header_string .= ' </table></td>' . "\n"; $header_string .= ' </tr>' . "\n"; $header_string .= '<tr>' . "\n"; $header_string .= ' <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">' . "\n"; $header_string .= ' <tr class="infoBoxContents"><td><table border="0" width="100%" cellspacing="0" cellpadding="2">' ."\n"; $header_string .= ' <tr><td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>' . "\n"; $header_string .= ' <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n"; $close_string = ' </table></td>'; $close_string .= '<td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>'; $close_string .= '</tr></table></td></tr></table></td>'; $close_string .= '<tr><td width="100%">' . tep_draw_separator('pixel_trans.gif', '100%', '10') . '</td></tr>'; reset($this->modules); $output_string = ''; while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) { $use_credit_string = $GLOBALS[$class]->use_credit_amount(); if ($selection_string =='') $selection_string = $GLOBALS[$class]->credit_selection(); if ( ($use_credit_string !='' ) || ($selection_string != '') ) { $output_string .= '<tr colspan="4"><td colspan="4" width="100%">' . tep_draw_separator('pixel_trans.gif', '100%', '10') . '</td></tr>'; $output_string = ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" >' . "\n" . ' <td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>' . ' <td class="main"><b>' . $GLOBALS[$class]->header . '</b></td>' . $use_credit_string; $output_string .= '<td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>'; $output_string .= ' </tr>' . "\n"; $output_string .= $selection_string; } } } if ($output_string != '') { $output_string = $header_string . $output_string; $output_string .= $close_string; } } return $output_string; } // if ($selection_string !='') { // $output_string .= '</td>' . "\n"; // $output_string .= $selection_string; // } // update_credit_account is called in checkout process on a per product basis. It's purpose // is to decide whether each product in the cart should add something to a credit account. // e.g. for the Gift Voucher it checks whether the product is a Gift voucher and then adds the amount // to the Gift Voucher account. // Another use would be to check if the product would give reward points and add these to the points/reward account. // function update_credit_account($i) { if (MODULE_ORDER_TOTAL_INSTALLED) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) { $GLOBALS[$class]->update_credit_account($i); } } } } // This function is called in checkout confirmation. // It's main use is for credit classes that use the credit_selection() method. This is usually for // entering redeem codes(Gift Vouchers/Discount Coupons). This function is used to validate these codes. // If they are valid then the necessary actions are taken, if not valid we are returned to checkout payment // with an error // function collect_posts() { global $HTTP_POST_VARS,$HTTP_SESSION_VARS; if (MODULE_ORDER_TOTAL_INSTALLED) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) { $post_var = 'c' . $GLOBALS[$class]->code; if ($HTTP_POST_VARS[$post_var]) { if (!tep_session_is_registered($post_var)) tep_session_register($post_var); $post_var = $HTTP_POST_VARS[$post_var]; } $GLOBALS[$class]->collect_posts(); } } } } // pre_confirmation_check is called on checkout confirmation. It's function is to decide whether the // credits available are greater than the order total. If they are then a variable (credit_covers) is set to // true. This is used to bypass the payment method. In other words if the Gift Voucher is more than the order // total, we don't want to go to paypal etc. // function pre_confirmation_check() { global $payment, $order, $credit_covers; if (MODULE_ORDER_TOTAL_INSTALLED) { $total_deductions = 0; reset($this->modules); $order_total = $order->info['total']; while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); $order_total = $this->get_order_total_main($class,$order_total); if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) { $total_deductions = $total_deductions + $GLOBALS[$class]->pre_confirmation_check($order_total); $order_total = $order_total - $GLOBALS[$class]->pre_confirmation_check($order_total); } } if ($order->info['total'] - $total_deductions <= 0 ) { if(!tep_session_is_registered('credit_covers')) tep_session_register('credit_covers'); $credit_covers = true; } else{ // belts and suspenders to get rid of credit_covers variable if it gets set once and they put something else in the cart if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers'); } } } // this function is called in checkout process. it tests whether a decision was made at checkout payment to use // the credit amount be applied aginst the order. If so some action is taken. E.g. for a Gift voucher the account // is reduced the order total amount. // function apply_credit() { if (MODULE_ORDER_TOTAL_INSTALLED) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) { $GLOBALS[$class]->apply_credit(); } } } } // Called in checkout process to clear session variables created by each credit class module. // function clear_posts() { global $HTTP_POST_VARS,$HTTP_SESSION_VARS; if (MODULE_ORDER_TOTAL_INSTALLED) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) { $post_var = 'c' . $GLOBALS[$class]->code; if (tep_session_is_registered($post_var)) tep_session_unregister($post_var); } } } } // Called at various times. This function calulates the total value of the order that the // credit will be appled aginst. This varies depending on whether the credit class applies // to shipping & tax // function get_order_total_main($class, $order_total) { global $credit, $order; // if ($GLOBALS[$class]->include_tax == 'false') $order_total=$order_total-$order->info['tax']; // if ($GLOBALS[$class]->include_shipping == 'false') $order_total=$order_total-$order->info['shipping_cost']; return $order_total; } // ICW ORDER TOTAL CREDIT CLASS/GV SYSTEM - END ADDITION } ?>
  10. ok, my understanding of php is rapidly increasing the code i put in the post earlier appear ok now, so u'll have to download the php file and take a look. its either a problem with adding the check box info to a temporary array or to the database
  11. it was a pre setup shopping cart and as the attributes function was required, it was installed by the people who I got it from
  12. i've been told its all the latest version, if you can tell me how I can check i will and let you know
  13. I got a version of OSC with minor changes. It had the Improve Product Attributes/Item Editor already installed, with a minor mod to the publicly released verions (check boxes instead of a list). Now I really need that for my store, and I also need something to add items to multiple categories. I got the Multiple Categories per product quick entry contribution, and added it to the already modded categories.php They both appear to work (almost). My problem is that now with my attributes, only the selected check boxes before a unchecked box is actually saved. This is a problem as I have two categories of atributes, both with numerous entries. I have noticed that it will save a checked box if there is one unchecked box between the checked boxes, but if there is two or more, then only the first is saved. I need it to be able to cope with a large amount of unchecked boxes between checked ones. I think i have narrowed the problem down to this piece of code.... ? ? ? ? ?// Improve Product Attributes/Item Editor begin if ( isset($pID) && $pID != '' ) { tep_db_query("DELETE FROM products_attributes WHERE products_id = " . $pID); for ($i = 0, $n = sizeof($attributes); $i < $n; $i++) { ? $values = split("_", $attributes[$i]); /* Revision by RE ? ? ?Since all array elements are passed from the hidden fields we need a way to add only the populated ones. ? ?---> IF AFTER THE SPLIT $values[0] (options_id) IS NOT SET THEN DO NOT INSERT THE ARRAY INTO THE products_attributes TABLE */ ? if($values[0] !== ""){ // Added by SP beg ? if($values[2] == "" && $values[3] == "") { // ? ? tep_db_query("INSERT INTO products_attributes (products_id, options_id, options_values_id, options_values_price, price_prefix) VALUES (" . $pID . ", '" . $values[0] . "', '" . $values[1] . "','". $att_price[$x]. "','". $plus[$x]. "')"); ? ? tep_db_query("INSERT INTO products_attributes (products_id, options_id, options_values_id, options_values_price, price_prefix) VALUES (" . $pID . ", '" . $values[0] . "', '" . $values[1] . "','". $att_price[$i]. "','". $plus[$i]. "')"); ? } else { ? ? $values[2] = "\"" . $values[2] . "\""; ? ? $values[3] = "\"" . $values[3] . "\""; ? ? tep_db_query("INSERT INTO products_attributes (products_id, options_id, options_values_id, options_values_price, price_prefix) VALUES (" . $pID . ", '" . $values[0] . "', '" . $values[1] . "','". $att_price[$i]. "','". $plus[$i]. "')"); // ? ? tep_db_query("INSERT INTO products_attributes (products_id, options_id, options_values_id, options_values_price, price_prefix) VALUES (" . $pID . ", '" . $values[0] . "', '" . $values[1] . "','". $att_price[$x]. "','". $plus[$x]. "')"); ? } // Added by SP end // by SP tep_db_query("INSERT INTO products_attributes (products_id, options_id, options_values_id) VALUES (" . $pID . ", " . $values[0] . ", " . $values[1] . ")"); }} // Revision by RE // --> ADD CLOSE BRACKET FOR ABOVE IF STATEMENT THAT FILTERS THE POPULATED ARRAYS ?} // Improve Product Attributes/Item Editor end I would at least apprieciate some help even if it is advice on the variable names and what exactly is happenin here, as this is my first mod, and first time dealing with php . If you are willing to help me then you can get my categories.php from here... categories.php file here Any help in any form will be greatly appreciated. :thumbsup:
×