Latest News: (loading..)

zwak

Members
  • Content count

    7
  • Joined

  • Last visited

1 Follower

About zwak

Profile Information

  • Real Name
    Lauri Raittila
  1. This does not allow emptying the value (aka set it to null). Thus explicit null is needed.
  2. In there: $sql_data_array['products_gtin'] = str_pad(tep_db_prepare_input($HTTP_POST_VARS['products_gtin']), 14, '0', STR_PAD_LEFT); This adds 000000000000 gtin for empty value. I made it like this: if (isset($HTTP_POST_VARS['products_gtin']) && $HTTP_POST_VARS['products_gtin']) { $sql_data_array['products_gtin'] = str_pad(tep_db_prepare_input((int)$HTTP_POST_VARS['products_gtin']), 14, '0', STR_PAD_LEFT); } else { $sql_data_array['products_gtin'] = 'null'; } Allows to have product without gtin. (custom products, oem etc. )
  3. Found one solution: In checkout_confirmation.php Replaced: ​$payment_modules->update_status(); With: /* CAPM Check available payment modules allows use of tep_count_payment_modules() to get number of payment modules in order confirmation */ // $payment_modules->update_status(); foreach($payment_modules->modules as $value) { $class = substr($value, 0, strrpos($value, '.')); $$class->update_status(); } //END CAPM*/ And later replaced <tr> <td><?php echo '<strong>' . HEADING_PAYMENT_METHOD . '</strong> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td> </tr> <tr> <td><?php echo $order->info['payment_method']; ?></td> </tr> with <?php if (tep_count_payment_modules() > 1) { //CAPM Check available payment modules allows use of tep_count_payment_modules() to get number of payment modules in order confirmation ?> <tr> <td><?php echo '<strong>' . HEADING_PAYMENT_METHOD . '</strong> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td> </tr> <tr> <td><?php echo $order->info['payment_method']; ?></td> </tr> <? } // CAPM Check available payment modules allows use of tep_count_payment_modules() to get number of payment modules in order confirmation ?> And in includes/classes/payment.php replaced this if ( (tep_not_null($module)) && (in_array($module . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $this->modules)) ) { $this->selected_module = $module; $include_modules[] = array('class' => $module, 'file' => $module . '.php'); } else { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); $include_modules[] = array('class' => $class, 'file' => $value); } } With this /* CAPM Check available payment modules allows use of tep_count_payment_modules() to get number of payment modules in order confirmation */ /* by Lauri 2015-11-21*/ if ( (tep_not_null($module)) && (in_array($module . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $this->modules)) ) { $this->selected_module = $module; /* $include_modules[] = array('class' => $module, 'file' => $module . '.php'); //CAPM */ } /* else { //CAPM */ reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); $include_modules[] = array('class' => $class, 'file' => $value); } /* } //END CAPM*/
  4. Hi In our shop we sometimes have multiple payment methods available for a customer, but quite often there is just one. The problem is that I don't find way to hide the change payment method link when there is just one available. This will cause redirect back to same page, as payment page was skipped using this code: With this // skip if only 1 payment method available if (tep_count_payment_modules() < 2 ) { $payment_select = $payment_modules->selection(); $payment = $payment_select[0]['id']; if (!tep_session_is_registered('payment')) tep_session_register('payment'); tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL')); } tep_count_payment_modules always returns 1 if payment is already selected.
  5. Tip for cheapest rate: after require(DIR_WS_CLASSES . 'shipping.php'); $shipping_modules = new shipping; $quotes = $shipping_modules->quote(); $erreur_shipping = get_erreur_shipping($quotes); add $cheapest = $shipping_modules->cheapest(); Then replace next DEFAULT_MODE_DELIVRY_SC with $cheapest['id'] Or something like that I just installed this, unfortunately didn't read this before, as I modified it too much to be able to paste more code.
  6. I made min quantity check by changing tep_check_stock() function (in general.php) and changed shopping cart to show better message for it. a.forevers way should work, but doesn't give any feedback to customer.