Jump to content

Portman

Members
  • Content count

    84
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Pete

Recent Profile Visitors

3,532 profile views
  1. Thanks @BrockleyJohn, that prompted me to find an error in the code that was causing the warning
  2. Thanks @BrockleyJohn, I will apply your suggestion - I'm a bit bummed though because I was hoping it was the cause to a problem I was having with this module... sigh, time to keep searching for a solution.
  3. Hi, Im hoping this is a quick question with an easy answer... I have just updated my server from 5.6 to 7.3 and am just experiencing an error I can't work out how to fix... the error is; PHP Warning: sizeof(): Parameter must be an array or an object that implements Countable in..... and the line of code in question is; for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { Any help would be appreciated.
  4. Hi, I have installed the Payway shopping cart plugin - which was supplied by my bank but not actually supported by them for technical help. The Payway "trusted frame" set up is server to server - like paypal, where the customer is redirected to the Payway site to make payment then redirected back to the oscommerce site once payment is made. Successful transactions seem to work fine. However there is a 'return to website' button on their site - if you decide not to use this payment method it is supposed to return you to the shopping cart. however when you use this option it returns you to an empty shopping cart and OScommerce has treated it like a successful order (ie it shows up in order history as pending in both front of house and admin ) I am hoping someone has come across this issue with payway or similar add on and can give me some tips on how to fix it
  5. Portman

    Creating an extra Order_Total Field

    thanks for the reply @burt I see what you are saying but I don't think that option will work given how my store is structured... Can I ask for you to humor me a little bit more as I try to sort this out? I have created another order total module which I have ALMOST got working... my Converted order total module looks like this .... <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class ot_conv_total { var $title, $output; function __construct() { $this->code = 'ot_conv_total'; $this->title = MODULE_ORDER_CONV_TOTAL_TOTAL_TITLE; $this->description = MODULE_ORDER_CONV_TOTAL_TOTAL_DESCRIPTION; if ( defined('MODULE_ORDER_CONV_TOTAL_TOTAL_STATUS') ) { $this->enabled = ((MODULE_ORDER_CONV_TOTAL_TOTAL_STATUS == 'true') ? true : false); $this->sort_order = MODULE_ORDER_CONV_TOTAL_TOTAL_SORT_ORDER; } $this->output = array(); } function process() { global $order, $currencies; $this->output[] = array('title' => $this->title . ':', 'text' => '<strong>' . DEFAULT_CURRENCY . number_format($order->info['conv_total'], 2) . '</strong>', 'value' => $order->info['conv_total']); } function check() { if (!isset($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_CONV_TOTAL_TOTAL_STATUS'"); $this->_check = tep_db_num_rows($check_query); } return $this->_check; } function keys() { return array('MODULE_ORDER_CONV_TOTAL_TOTAL_STATUS', 'MODULE_ORDER_CONV_TOTAL_TOTAL_SORT_ORDER'); } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Total', 'MODULE_ORDER_CONV_TOTAL_TOTAL_STATUS', 'true', 'Do you want to display the converted total order value?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_CONV_TOTAL_TOTAL_SORT_ORDER', '4', 'Sort order of display.', '6', '2', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } } ?> at this stage I have an if statement that runs at the bottom of includes/classes/order.php that looks like this ... if (DISPLAY_PRICE_WITH_TAX == 'true') { $this->info['total'] = $this->info['subtotal'] + $this->info['shipping_cost']; } else { $this->info['total'] = $this->info['subtotal'] + $this->info['tax'] + $this->info['shipping_cost']; } // This section added by peter - creating converted to AUD price $group_currency = constant('MODULE_STORE_WHOLESALE_OPT_PRICE_' . $wholesale_group . '_' . strtoupper($language)); if ($group_currency != DEFAULT_CURRENCY) { $value_query = tep_db_query("select value from " . TABLE_CURRENCIES . " where code = '" . $group_currency . "'"); $ex_value = tep_db_fetch_array($value_query); $this->info['ex_rate'] = $ex_value['value']; $this->info['conv_total'] = ($this->info['total'] * $ex_value['value']); } else { $this->info['ex_rate'] = 1; $this->info['conv_total'] = $this->info['total']; } the first if/else statement is original code... my if/else statement is trying to piggyback off that to put a value into $conv_total - which works except when you are dealing with taxes where it seems to not include tax on shipping... this is what it looks like on order confirmation... Sub-Total: $120.00 Flat Rate (): $2.00 GST: $12.20 Total: $134.20 Converted Total: AUD134.00 I am confused as to why this is happening .... this section in order.php seems to be the only place that the $total variable is applied and the else part of my statement just says $conv_total = $total so why is there a disparity in the prices... also, so that I am not messing with the original code - is there some way that I can put my If/else statement into my ot_conv_total module? IE, How do I call the $total value to do the manipulation. Note: I am not sure if I am going to use ex_rate in a similar module or not
  6. thanks @BrockleyJohn... I never noticed there was an address format option there !
  7. Hi, On the customers address book listings I want to change the fields around so that postcode comes after state... is that easily done?
  8. Portman

    Change order totals in Order Confirmation

    Sigh... of course you do, here I was looking everywhere in content modules... Thanks @LeeFoster
  9. Hi, Just a quick question, Is there some way to change the order totals in the products mod for modular order confirmation (BS Frozen). it works fine at the moment but Im not happy with the order it looks like this... items ordered 10% $100.00 GST : $10.00 Sub Total: $100.00 Shipping: $5.00 Total: $115.50 I want it to look like this; items ordered 10% $100.00 Sub Total: $100.00 Shipping: $5.00 GST : $10.50 Total: $115.50 If there is an easy way to do this (ie change in the settings somewhere that I just cant find) can someone let me know ... if not there is one coding questions I would need to get my head around.... First - I know I can set up "GST on shipping" as a value on the site - but if I want to add all GST together as I have done above (10% or order + 10% of shipping) how would I do this? is there a pre existing shipping tax field in the database? any help would be appreciated
  10. Portman

    Creating an extra Order_Total Field

    I have created something on the order conformation page - under the order total that gives the converted total which I could then pass to the payment module, but I also want to save the total onto the database.
  11. Portman

    Creating an extra Order_Total Field

    I have a wholesale site with different groups with different prices for different regions/currencies at the end of transaction the idea is to convert the total into AUD before being charged ... so i need the already existing order total plus an extra 'converted order total' which will be passed on to the payment modules instead of the standard order total - it will also help me have more accurate reporting of sales - I was also thinking I may need a currency/group row as well (though this may be redundant) just so i can separate purchase by group in the back of house.
  12. Can anyone explain to me where the final total for an order is created and uploaded onto the database? I understand it is stored in the orders_total table but I cannot work out where the fields for this table are populated.... basically I want to add a couple of extra records to order_total per order, but cannot workout where to do it. Thanks for any help.
  13. Thanks @Yepi but I was looking to create a module to work in conjunction with BS Frozen modular shopping cart app
  14. Thanks @raiwa got it all working now and have learnt a thing or two about modular design.... though I think there is a lot more to learn still!!
  15. @raiwa, I have done what you have suggested ... and it seems to work except for the variable $wholesale_group is empty... in catalog/shopping_cart.php it has a value but not here - any idea what I have missed? <?php /* $Id$ Version 2.0 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2016 osCommerce Released under the GNU General Public License */ class cm_sc_min_order { public $code; public $group; public $title; public $description; public $sort_order; public $enabled = false; function __construct() { $this->code = get_class($this); $this->group = basename(dirname(__FILE__)); $this->title = MODULE_CONTENT_SC_MIN_ORDER_TITLE; $this->description = MODULE_CONTENT_SC_MIN_ORDER_DESCRIPTION; if ( defined('MODULE_CONTENT_SC_MIN_ORDER_STATUS') ) { $this->sort_order = MODULE_CONTENT_SC_MIN_ORDER_SORT_ORDER; $this->enabled = (MODULE_CONTENT_SC_MIN_ORDER_STATUS == 'True'); } } function execute() { global $oscTemplate, $cart; $content_width = (int)MODULE_CONTENT_SC_MIN_ORDER_CONTENT_WIDTH; if ($cart->count_contents() > 0) { $order_val = $cart->show_total(); } else { $order_val = 0; } $min_order_val = constant('MODULE_STORE_WHOLESALE_MIN_ORDER_' . $wholesale_group . '_ENGLISH'); $min_order = $min_order_val - $order_val; ob_start(); include('includes/modules/content/' . $this->group . '/templates/tpl_' . basename(__FILE__)); $template = ob_get_clean(); $oscTemplate->addContent($template, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_CONTENT_SC_MIN_ORDER_STATUS'); } function install() { tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Shopping Cart Minimum Order Message', 'MODULE_CONTENT_SC_MIN_ORDER_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_SC_MIN_ORDER_CONTENT_WIDTH', '12', 'What width container should the content be shown in?', '6', '2', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_SC_MIN_ORDER_SORT_ORDER', '1', 'Sort order of display. Lowest is displayed first.', '6', '3', now())"); } function remove() { tep_db_query("delete from configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_CONTENT_SC_MIN_ORDER_STATUS', 'MODULE_CONTENT_SC_MIN_ORDER_CONTENT_WIDTH', 'MODULE_CONTENT_SC_MIN_ORDER_SORT_ORDER'); } }
×