Latest News: (loading..)

cinolas

Members
  • Content count

    112
  • Joined

  • Last visited

  • Days Won

    2

cinolas last won the day on January 7

cinolas had the most liked content!

About cinolas

Profile Information

  • Real Name
    Nicolas
  1. Well it didn't take long looking into my first option to tell that Bootstrap is made to be easy to use, and that I can just call the bits I need from anywhere. So it looks much easier than I thought. Anyone having a similar question should look into a Bootstrap tutorial.
  2. To be clear, I don't need any osC specific widgets in my static pages, no shopping cart, no store navigation, etc Thanks!
  3. As per the title I'm running osC 2.34 BS Gold. There's more to our site than a store, so osC is installed in a subdirectory like /store/ I would like to change the rest of our website, currently all static HTML pages, to use the same bootstrap installation used by osC. The idea is to facilitate synchronizing the look and to provide a consistent user experience in and out of the store section. All I really want to replicate on my static pages is the adaptative grid system, some of the header, and the CSS... What's the best way of doing this? btw I'm a store owner, not a coder, but I've been pretending to be a coder ever since I installed osCommerce 10 years ago ;) I've considered: - Deconstructing the header part of my osC pages and shoving that in my static pages, changing the references towards the store subdirectory. - Moving the entire store to the root and adding a bunch of info pages, but that's my last option. Do I really need to switch the static pages to php to use the same header as within my osC store? Thanks for ay and all help :D
  4. I did. My apologies for being dense here. I can see the configuration entries being created in the install function of shipping modules, and I can see that the CanadaPost shipping module doesn't create a row for the SORT_ORDER. So I went and created an entry in the Configuration table manually, but that doesn't change anything. How, or where, does that value get pulled to sort the modules on the checkout_shipping page?
  5. Hi, I'm on 2.34 Bootstrap Gold and I'm using an old Canada Post XML shipping module that doesn't have a sort order field (or configuration entry). Right now the module gets sorted on top and I'd like to change that, but I don't fully understand how the sorting of shipping modules works. The module doesn't create a SORT_ORDER entry on the configuration table during install, so I tried creating one manually but I don't know how to connect that row to the actual module so that the sort order value is summoned with the module. I've looked at the chekckout_shipping page but saw nothing about sorting, so I thought maybe it was being done in the class but I don't see anything about sorting the modules there either. I'm pretty sure this is easy if you know what you're doing, but I do not. I don't need a field on the admin interface, just some way of giving it a sort order. Also, the shipping options show up from most expensive to least expensive on my checkout_shipping page, it selects the right one automatically, but I'd like to show the cheapest on top. How do I do that? (if I could only find where these things are being sorted...) Thanks!
  6. @@greasemonkey Thank you sir!
  7. Greetings, I've installed this contribution into my 2.3.4 BS Gold and I'm having a problem with the way the form displays on the payment page. It looks like this: I'm not finding the usual HTML building bits of PHP that I normally tinker with for this sort of problem... Does anyone know how to remove the 1s and 2s? And where I can further customize the look of the form? (beyond the fields and labels, like adding classes to pretty it up in CSS) Thanks!
  8. Rainer, @@raiwa Thank you SO MUCH. This is precisely the area of php that I know nothing about, that is to say most of php hehe. What I'm saying is I could've dug for a thousand years and not figured that out. Or taken an online course in php anyway... It works beautifully! best regards.
  9. In trying to circumvent the problem I created a different Tax Class for the tax on shipping. If I give it a different description then the tax on shipping shows up on a different line, at least on checkout_confirm. On checkout_payment, the ot_tax order total module only reports the tax on the goods, where it is reporting both on checkout_confirm. So again, this means that the tax on shipping is added after the payment page. I figured another easier workaround would be to add a line after the order_total modules output, that says something like : + $0.58 tax on shipping TOTAL: $184.38 Then there's no need to alter any core functions, or set variables ahead of time, all I need to do is calculate the tax on shipping and a new super-total and display those after the order total module output. I tried a few naive things, mostly copying promising bits of code from other places, but it all failed miserably. My content module now looks like this (I've removed the long part about taxes when not logged in since that just doesn't apply on the payment page): <?php /* $Id: cm_pa_order_total.php $Loc: catalog/includes/modules/content/payment/ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com 2015 Order Totals 3.3 BS by @[member='raiwa'] info@sarplataygemas.com based on: shipping estimator Original version: Edwin Bekaert (edwin@[member='ednique'].com) Copyright (c) 2010 osCommerce Released under the GNU General Public License */ class cm_pa_order_total { var $code; var $group; var $title; var $description; var $sort_order; var $enabled = false; function __construct() { $this->code = get_class($this); $this->group = basename(dirname(__FILE__)); $this->title = MODULE_CONTENT_PA_ORDER_TOTAL_TITLE; $this->description = MODULE_CONTENT_PA_ORDER_TOTAL_DESCRIPTION; $this->description .= '<div class="secWarning">' . MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION . '</div>'; if ( defined('MODULE_CONTENT_PA_ORDER_TOTAL_STATUS') ) { $this->sort_order = MODULE_CONTENT_PA_ORDER_TOTAL_SORT_ORDER; $this->enabled = (MODULE_CONTENT_PA_ORDER_TOTAL_STATUS == 'True'); } } function execute() { global $oscTemplate, $cart, $order, $customer_default_address_id, $billto, $sendto; $content_width = (int)MODULE_CONTENT_PA_ORDER_TOTAL_CONTENT_WIDTH; if (($cart->count_contents() > 0)) { require('includes/classes/order_total.php'); $order_total_modules = new order_total; $order_total_modules->process(); $shiptaxrate = tep_get_tax_rate('1', $customer_country_id, $customer_zone_id); $shiptax = ($shipping['cost'] * $shiptaxrate); if ( MODULE_ORDER_TOTAL_INSTALLED ) { $pa_order_total .= ' <div class="panel-body">'; $pa_order_total .= ' <table class="pull-right">'; $pa_order_total .= $order_total_modules->output(); $pa_order_total .= ' <tr><td align="right" class="main">+ tax (' . $shiptaxrate . ') on shipping</td><td align="right" class="main">' . $shiptax . '</td></tr>'; $pa_order_total .= ' </table>'; $pa_order_total .= ' </div>'; // end body } ob_start(); include('includes/modules/content/' . $this->group . '/templates/order_total.php'); $template = ob_get_clean(); $oscTemplate->addContent($template, $this->group); } // Use only when cart_contents > 0 } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_CONTENT_PA_ORDER_TOTAL_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 Order Total Module', 'MODULE_CONTENT_PA_ORDER_TOTAL_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_PA_ORDER_TOTAL_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_PA_ORDER_TOTAL_SORT_ORDER', '1000', 'Sort order of display. Lowest is displayed first.<br>Recommended to show this module last.', '6', '3', now())"); } function remove() { tep_db_query("delete from configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_CONTENT_PA_ORDER_TOTAL_STATUS', 'MODULE_CONTENT_PA_ORDER_TOTAL_CONTENT_WIDTH', 'MODULE_CONTENT_PA_ORDER_TOTAL_SORT_ORDER'); } } Go ahead, have a laugh :) So tep_get_tax_rate('1', $customer_country_id, $customer_zone_id); returns 0, and so does $shipping['cost'] Any idea how I might be able to summon those 2 variables, that is the tax rates for the customer's country and zone, and the shipping cost, from the context of a checkout_payment content module? Cheers!
  10. @@raiwa Thanks again for the tips. I've changed the code in my payment content module to the call for the order total module that I found in the checkout_confirmation page and it gives exactly the same result. So I did as you suggested and looked at the variables (that tip is going to make my osC debugging so much easier!). It appears that the "tax" variable is simply set to the tax without the tax on shipping when on the checkout_payment page (the "total" variable is also calculated without it) , and by the time you get to checkout_confirmation the "tax" variable has been changed to include the tax on shipping, and the "total" adjusted accordingly. There is no missing or unset variable, or error, the tax on shipping really is supposed to go in the tax variable, it just hasn't, at that point. Some process must do that between the two pages. I have no idea how, when, and through which process. I don't want to modify a central function, that doesn't make sense. Is there any way I can, in my content module code, alter the order "tax" variable to be what it is plus: whatever the current tax rate times "shipping_cost". Then alter "total" by the same difference. THEN call the order total module? I might be able to figure that out, but I can't seem to find a defined variable for the current tax rate, other than within the product array. I'd rather not use that because I'd have to arbitrarily chose a product, and it might be tax exempt for some reason. Again, feel free to tell me I'm on my own here. This has nothing to do with your contrib, other than I'm trying to do something similar. It's beyond what I can accomplish with my current level of understanding of osC php et al so any tips (from anyone) is VERY much appreciated :D
  11. @@raiwa Thank you so much, these are smart things to try, and exactly the nudge in the right direction I needed.
  12. Hi, I've installed v1.2 of this contrib and it looks like wipmania.com is returning "US" as location when in fact I'm in Canada. I went to wipmania.com directly and they detected my location properly as Canada. My store is in Canada, default currency is CAD, we want the currency to switch to USD only for US customers, everything else should be CAD. I've tried @@greasemonkey's version using ip2location but I found that the prices didn't show up at all on Safari/Webkit. I played with the 1.2 code a little to force USD or CAD (hard coded with no DB query), and the problem really appears to be that wipmania is returning "US" as my location (unless I go to their site). As opposed to wipmania returning "XX", or a blank $location. So I'm stumped, why is wipmania giving me mixed results? Or why is ip2location causing the no-price problem on Safari/Webkit, but not Chrome? Any help is greatly appreciated!
  13. In an effort to get a friendly hint I'll sum it down to where my no-knowledge of php stops. My first thought obv was to find where in there the taxes on shipping were calculated, but it doesn't seem to be part of this contribution. So I'm guessing it's pulling this mechanic from an existing file. The only file the contrib seems to rely on is the order class, which doesn't seem to handle shipping taxes either. Regardless, I couldn't adjust the tax calculation in a central file or it would also affect places where the totals are shown correctly. So my guess is that the problem is with the context of the code, makes sense since I copied the code out of its context to do that. So part of the code above fails because it's out of context and so the shipping tax isn't carried over. If my understanding is correct so far, then this contrib takes that same totals and tax mechanic from an existing file and uses it (successfully) out of context on the shopping cart page. So what's the difference in context between the shopping cart and checkout_payment? the shipping has been selected, and not taken from the input fields. Yet the actual amount for the shipping level that was selected does show up, as it does on the checkout_confirm, so it's getting that part of the shipping data. Just not the tax. That's where I'm lost. Any hints as to where or how this contrib gets the shipping amount and passes it to the order class, or any hints at all really, would be greatly appreciated (from any willing soul, as the dev pointed out this FAR beyond expected support).
  14. @@raiwa @@greasemonkey thank you both. It is indeed far beyond the scope of expected support :) I'll figure out something. Here's another question that's even further out of the scope of expected support... but asking never hurt and maybe it's a quick tweak. I copied the order total content module and turned it into a payment content module, so as to display the order total on the payment page. It seemed like a logical place to display the total, after selecting the shipping method, and while the user chooses how to pay for that amount. The totals display as expected but for one thing: the taxes on the shipping amount are not included, while they are on the confirmation page. Here's the code, essentially a direct copy of the shipping content module, do you guys see a reason why the shipping taxes are omitted? Thanks! <?php /* $Id: cm_pa_order_total.php $Loc: catalog/includes/modules/content/payment/ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com 2015 Order Totals 3.3 BS by @[member=raiwa] info@sarplataygemas.com based on: shipping estimator Original version: Edwin Bekaert (edwin@[member=ednique].com) Copyright (c) 2010 osCommerce Released under the GNU General Public License */ class cm_pa_order_total { var $code; var $group; var $title; var $description; var $sort_order; var $enabled = false; function __construct() { $this->code = get_class($this); $this->group = basename(dirname(__FILE__)); $this->title = MODULE_CONTENT_PA_ORDER_TOTAL_TITLE; $this->description = MODULE_CONTENT_PA_ORDER_TOTAL_DESCRIPTION; $this->description .= '<div class="secWarning">' . MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION . '</div>'; if ( defined('MODULE_CONTENT_PA_ORDER_TOTAL_STATUS') ) { $this->sort_order = MODULE_CONTENT_PA_ORDER_TOTAL_SORT_ORDER; $this->enabled = (MODULE_CONTENT_PA_ORDER_TOTAL_STATUS == 'True'); } } function execute() { global $oscTemplate, $cart, $order, $customer_default_address_id, $billto, $sendto; $content_width = (int)MODULE_CONTENT_PA_ORDER_TOTAL_CONTENT_WIDTH; if (($cart->count_contents() > 0)) { // BOF get taxes if not logged in if ( !tep_session_is_registered('customer_id') ) { //guest if ( $cart->get_content_type() == 'virtual') { tep_session_register('billto'); $billto = array('firstname' => null, 'lastname' => null, 'company' => null, 'street_address' => null, 'suburb' => null, 'postcode' => null, 'city' => null, 'zone_id' => STORE_ZONE, 'zone_name' => null, 'country_id' => STORE_COUNTRY, 'country_name' => null, 'country_iso_code_2' => null, 'country_iso_code_3' => null, 'address_format_id' => null, 'zone_name' => null ); if (!class_exists('order')) { require('includes/classes/order.php'); } $order = new order; } elseif (defined('MODULE_CONTENT_SC_SHIPPING_STATUS') && MODULE_CONTENT_SC_SHIPPING_STATUS == 'True') { $products = $cart->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { $products_tax = tep_get_tax_rate($products[$i]['tax_class_id'], $order->delivery['country_id'], $order->delivery['zone_id']); $products_tax_description = tep_get_tax_description($products[$i]['tax_class_id'], $order->delivery['country_id'], $order->delivery['zone_id']); if ( DISPLAY_PRICE_WITH_TAX == 'true' ) { //Modified by Strider 42 to correct the tax calculation when a customer is not logged in $tax_val = (($products[$i]['final_price']/100)*$products_tax)*$products[$i]['quantity']; } else { $tax_val = (($products[$i]['final_price']*$products_tax)/100)*$products[$i]['quantity']; } if ( !empty($order->info['tax']) ) { $order->info['tax'] += $tax_val; } else { $order->info['tax'] = $tax_val; } if ( !empty($order->info['tax_groups']) ) { $order->info['tax_groups']["$products_tax_description"] += $tax_val; } else { $order->info['tax_groups']["$products_tax_description"] = $tax_val; } // Modified by Strider 42 to correct the order total figure when shop displays prices with tax if ( DISPLAY_PRICE_WITH_TAX == 'true' ) { $order->info['total']; } else { $order->info['total']+=$tax_val; } } } else { if (!tep_session_is_registered('sendto')) { tep_session_register('sendto'); $sendto = array('firstname' => null, 'lastname' => null, 'company' => null, 'street_address' => null, 'suburb' => null, 'postcode' => null, 'city' => null, 'zone_id' => STORE_ZONE, 'zone_name' => null, 'country_id' => STORE_COUNTRY, 'country_name' => null, 'country_iso_code_2' => null, 'country_iso_code_3' => null, 'address_format_id' => null, 'zone_name' => null ); if (!class_exists('order')) { require('includes/classes/order.php'); } $order = new order; } } } else { if ( $cart->get_content_type() == 'virtual' && (!defined('MODULE_CONTENT_SC_SHIPPING_STATUS') || (defined('MODULE_CONTENT_SC_SHIPPING_STATUS') && MODULE_CONTENT_SC_SHIPPING_STATUS != 'True')) ) { tep_session_register('billto'); $billto = $customer_default_address_id; } if (!class_exists('order')) { require('includes/classes/order.php'); } $order = new order; } // EOF get taxes if not logged in (seems like less code than in order class) require('includes/classes/order_total.php'); $order_total_modules = new order_total; $order_total_modules->process(); if ( MODULE_ORDER_TOTAL_INSTALLED ) { $pa_order_total .= ' <div class="panel-body">'; $pa_order_total .= ' <table class="pull-right">'; $pa_order_total .= $order_total_modules->output(); $pa_order_total .= ' </table>'; $pa_order_total .= ' </div>'; // end body } ob_start(); include('includes/modules/content/' . $this->group . '/templates/order_total.php'); $template = ob_get_clean(); $oscTemplate->addContent($template, $this->group); } // Use only when cart_contents > 0 } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_CONTENT_PA_ORDER_TOTAL_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 Order Total Module', 'MODULE_CONTENT_PA_ORDER_TOTAL_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_PA_ORDER_TOTAL_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_PA_ORDER_TOTAL_SORT_ORDER', '1000', 'Sort order of display. Lowest is displayed first.<br>Recommended to show this module last.', '6', '3', now())"); } function remove() { tep_db_query("delete from configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_CONTENT_PA_ORDER_TOTAL_STATUS', 'MODULE_CONTENT_PA_ORDER_TOTAL_CONTENT_WIDTH', 'MODULE_CONTENT_PA_ORDER_TOTAL_SORT_ORDER'); } }
  15. @@Tsimi Thanks fro the quick reply! I re-installed from scratch, all the manual modifications were there proper, but after re-uploading all the files the problem went away... I'm guessing there may have been an ftp hiccup with one of the files. So, all good! Thanks for the quick support anyway :) Cheers!