Jump to content


  • Content count

  • Joined

  • Last visited

Everything posted by Portman

  1. Ok, so I'm playing around with hiding particular products from particular customers... I have made a variable $hide_product where the value 1 means the product is hidden and 0 means it is visible... I am trying to modify bm_specials.php and bm_whats_new.php so that if $hide_product = 1 that product does not show up in the box and another is selected... Im assuming it is these lines of code I need to modify, but for the life of me I can't figure it out bm_specials.php if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from products p, products_description pd, specials s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) { bm_whats_new.php if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) { any help would be appreciated
  2. Hi, I cant seem to find a working solution for this anywhere. The problem I am having occurs only when the customer is NOT logged into paypal before selecting paypal express as their payment option. Here is the general flow of the order process; 1. - customer finishes their order and selects EXPRESS SHIPPING 2. - Customer selects paypal extress as payment option 3. - customer is taken to paypal where they log in and see their order including EXPRESS SHIPPING (I think they can change this to standard shipping at this point, but we are assuming they do not). Customer confirms order on Paypal site. 4. Customer is sent back to checkout_confirmation.php - where shipping has reverted to STANDARD SHIPPING (with no option to change back to express shipping). Customer confirms order is forced to pay for standard shipping even if they want express. both standard and express Shipping modules are based on the zone based shipping modules and work for other payment modules fine Any help would be greatly appreciated...
  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. Thanks @BrockleyJohn, that prompted me to find an error in the code that was causing the warning
  5. 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.
  6. 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
  7. 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.
  8. 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
  9. Hi, On the customers address book listings I want to change the fields around so that postcode comes after state... is that easily done?
  10. thanks @BrockleyJohn... I never noticed there was an address format option there !
  11. 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
  12. Portman

    Change order totals in Order Confirmation

    Sigh... of course you do, here I was looking everywhere in content modules... Thanks @LeeFoster
  13. 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.
  14. 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.
  15. Thanks @Yepi but I was looking to create a module to work in conjunction with BS Frozen modular shopping cart app
  16. Hi I have recently installed modular shopping cart for bs frozen before that time i was just using the standard shopping cart but I had made a few modifications to make it do what I wanted it to - essentially I had set up a minimum order quantity - that meant in the shopping cart the customer saw how much they still needed to spend and hid the checkout button if they had not reached their minimum... What i am wanting to do is to create my own add-on mod to look after the minimum order message part of things but I have never created a modular add on so not sure what to do. Can anyone give me some pointers on what I need to do to get it working - what bits go in the execute function and what goes into the template file.. below is part of my original (modified) shopping cart file - the bit that I think needs to be added to the new module is the bit inside the two commented sections ... require('includes/languages/' . $language . '/shopping_cart.php'); $breadcrumb->add(NAVBAR_TITLE, tep_href_link('shopping_cart.php')); require('includes/template_top.php'); // Added by Portman to calculate minimum order amount 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; // End Added by Portman ?> <div class="page-header"> <h1 class="h3"><?php echo HEADING_TITLE; ?></h1> </div> <?php // added by Portman to display Minimum order value if ($min_order > 0) { ?> <div class="alert alert-danger"> <?php echo MIN_ORDER_TEXT_SC1 . '<strong> ' . $currencies->format($min_order) . '</strong> ' . MIN_ORDER_TEXT_SC2; } else { ?> <div class="alert alert-success alert-dismissible"> <?php echo MINIMUM_ORDER_REACHED_SC; } ?> </div> <?php // End Added by Portman if ($messageStack->size('product_action') > 0) { echo $messageStack->output('product_action'); } ?>
  17. 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!!
  18. @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'); } }
  19. Thanks for your feedback @raiwa & @BrockleyJohn I will play around with what you have suggested... In my original shopping cart file I had a basic if statement around the part that drew the checkout button... <div class="buttonSet"> <?php // Mod by Portman to hide checkout button in min order not reached if ($min_order <= 0) { ?> <div class="text-right"><?php echo tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'fa fa-angle-right', tep_href_link('checkout_shipping.php', '', 'SSL'), 'primary', NULL, 'btn-success'); ?></div> <?php } //End Mod ?> </div> I assumed I would just have to do a similar thing in one of the other shopping cart mods, but to be honest I have not looked that far ahead yet... if this is not the case could you please give me a few more "beginner" pointers on what I should do next. Thanks
  20. Hi everyone... Am I missing something or is there no way to have a purchase quantity field on the product listing page and/or the product_info page, so that the customer can purchase more than one item without having to do it in their shopping cart?? the closest solution I could fins was in this thread... which as far as i can determine is a solution for the product listing page only and is for Edge which I cant get my head around converting for BS Frozen... Can anyone shed any light on this? Am I going to build it from scratch myself? Ideally I would like to have a qty box like on the shopping cart on both product listing and product_info page... but I definitely need it for product_info.
  21. Hi, Is there a particular modal Addon that I can add to the main body of my website... rather than in the left or right box or shopping cart type sections. I have one or two places on my website (one on checkout_confirmation page, and 'Ill probably want to add one on the payment page as well) .... If there is not one for my particular need then what would be the best addon for me to modify (particularly thinking I will need a couple of them operating at once on different pages) I am using the most up to date BS frozen
  22. Portman

    Help with Modal Addons

    Thanks @JcMagpie, is this the one you are suggesting? https://apps.oscommerce.com/89uS9&modular-checkout-pages-bs
  23. Portman

    adding to specials and whats new boxes

    thanks @multimixer I was trying to plug the variable in there rather than the record from the database...
  24. Portman

    call to new function in addon

    thanks @raiwa... that was what I needed to know! Yes I am modifying one of your addons - or at least trying to - at this stage trying to create the ability to hide products from particular wholesale groups
  25. Hi I am using BS Frozen I have been doing some modifications to an add-on and I have created a new <function> to the code to make the add-on operate in the way I need it to... This has worked fine within the files of the add-on.... Now I want to call that function (located in catalog/includes/module/store/st_addon.php) in catalog/product_info.php... Can I do that? and if so how?