Jump to content
Latest News: (loading..)

cinolas

Members
  • Content count

    131
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by cinolas

  1. @Jack_mcs Thank you! That's exactly what I needed. I haven't tried it yet, but it gives me enough of a clue that I should be able to make it work if it doesn't outright. Cheers!
  2. Greetings! I'm using osC 2.3.4 BS with SEO URL's . I would like to make it so that some of my products don't get indexed by search engine. Those products are clearly tagged in a custom field I created in the Products table. The problem is that the <head> section of product pages, where I would need to put the NOINDEX tag, gets generated in template_top.php I don't want to use robot.txt because I would then have to update the list of pages manually... no fun. Is there any way to query the products record from template_top? Or a way to add the NOINDEX in product_info where I can check the database field to see if that product needs to be indexed or not? Or a third method to achieve this that I'm not thinking about right now? THANKS!!
  3. @MrPhil All very good concerns, thanks for bringing them up, but I think we're good. It's not mission critical. The specifics of the situation is a bit of a long story, but essentially we're trying to hide products so they are only accessible from certain places. The reason we want those products not to be accessible from search engines is to prevent the user from being confused once they navigate away from the hidden products and can't find it anymore. We want to narrow down the entry points so that the user remembers how they got to it.
  4. @Jack_mcs That's very close to what I need. Two questions: would this work with the SEO URL contrib? My URLs look like this: /directory/some-product-name-p-1943.html Is there any way to query another field than products_id using the method above? I would need it to read a custom boolean field in the products table, so it would have to look something like: (I don't know how $_GET works... or are you getting the products_id from the URL?) <?php if (basename($PHP_SELF) == 'product_info.php && $_GET['products_custom_field'] == 1) ?> <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"> <?php } ?> Thanks a bunch!
  5. Greetings, I'm working with osC 2.3.4 BS and PayPal Express Checkout 3.1 (the payment module, not the app). 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 a shipping method other than the cheapest (express shipping) 2. Customer selects Paypal Express as payment option 3. Customer is taken to Paypal where they log in and see their order including shipping. The total shown is the correct total, including the express shipping. Customer confirms order on Paypal site. 4. Customer is sent back to checkout_confirmation.php where shipping has reverted to the cheapest shipping option, not what they had chosen. This apparently started happening out of the blue a couple months ago. There were no changes made on our end. So I'm assuming that the problem is in the data sent back to osC after payment is confirmed. I have no idea where to look to solve this, since it seems to be coming from Paypal... Any help would be greatly appreciated thanks!
  6. Any other way to fix this than installing the PayPal App? Where is the latest PayPal Express Checkout payment module? Can I extract it from the App? Thanks!
  7. I'm not really keen on installing the PayPal App. It changes too many other aspects of osCommerce, our staff is well trained for the way things are now. Plus it just includes all up to date payment modules, so I should be able to get the up to date version of PayPal Express Checkout payment module without the App, no? I looked around and it looks like the most recent version is the version I have, 3.1. So I'm not sure the Paypal App would help. Or is there a newer version of PayPal Express Checkout somewhere? Or, does the PayPal App include a newer PayPal Express Checkout? If so, can I get the PayPal Express Checkout payment module from the PayPal App package? Thanks!
  8. Hi, I'm having the same problem but I'm using the old PayPal Express payment module v3.1 Regardless of what shipping method the user chooses at checkout_shipping.php, upon returning from PayPal the shipping method gets changed to the cheapest method. This was all working fine a few months ago, and started acting up out of the blue. A change at PayPal I'm guessing. I checked my configure.php and the paths are all correct and complete. What else could be causing this? How do I ensure that the selected shipping method sticks throughout the PayPal Express checkout process? Any info is greatly appreciated. I'd rather not upgrade to the PayPal app v5 if I don't have to, it's likely to cause more problems. Plus it was working fine just a couple months ago and I haven't changed anything since. Any help is greatly appreciated!
  9. cinolas

    Shipping/CCGV/PayPal

    Hi, I'm having the same problem but without any CCGV. I suspect we actually have the same problem, did you ever figure it out? I use PayPal Express, and regardless of what shipping method the user chooses at checkout_shipping.php, upon returning from PayPal the shipping method gets changed to the cheapest method. I use a conditional shipping module that offers snail mail if the order thickness is small enough, this method is always the cheapest but not always available. Regardless of wether that option was available to the user on checkout_shipping.php it's always the selected option when returning from PayPal. Note that the order total displayed on PayPal is the correct one with the shipping method selected by the user, it's when the user comes back to checkout_confirmation.php that the shipping method, and therefore the total, are changed. This was all working fine a few months ago, and started acting up out of the blue. A change at PayPal I'm guessing. How do I ensure that the selected shipping method sticks throughout the PayPal Express checkout process? Any info is greatly appreciated. Thanks!
  10. Hi, I'm running osCommerce 2.3.4 and the Moneris eSELECTplus Canadian Gateway Version 1.1.0 contribution with my Canadian Moneris account. It works well. I've just received an email advising me of upcoming changes that I should verify compatibility with. The changes that might be pertinent are: DigiCert and Entrust Certificates (Moneris Gateway and IP Gate) Effective March 13, 2018 We will be changing our internet communication security certificates from Verisign to DigiCert and Entrust. This will impact businesses that have not updated their digital certificate or have ‘hard coded’ the existing Verisign certificate. Action Required: Integrated and e-commerce merchants who do not have DigiCert and Entrust certificates stored will need to download the packages to their certificate store or trust store. and Public IP Address Changes (Moneris Gateway) Effective March 28, 2018 We will be updating Moneris Gateway Production IP addresses. This will impact any business that uses static IP addresses or firewall rules/whitelists to connect to the Moneris Gateway. Action Required: Merchants will need to update their IP address whitelists or firewall rules to allow connections to the new IP addresses. I've looked through the payment module files and there doesn't appear to be any hard coded IPs. I'm not even sure where to look to see about the certificates. Are these changes likely to affect the payment module I'm using? If yes, how do I correct that? If maybe, how do I make sure? Thank you all!
  11. Anyone? Even if you don't know about Moneris or the eSelect payment module, perhaps you'd know if it's likely to stop working due to these changes? Thanks!
  12. Hi, Thanks for reading :) I'm trying to add a small JS based calculator to the product_info page so that users can calculate their shoe size from a few input fields directly on the page. I'm not exactly fluent in php, or JS, but I'm usually successful with copy-pasting bits of code and replicating syntax. I duplicated the also_purchased_products.php as a starting point and replaced the code with my JS and form divs. The form grabs a few pieces of data from the user, mixes it with data from the product and sets a result input field without refreshing the page: document.getElementById('result').value = "Error: size mismatch, please contact customer service"; In order to pass some product data to the JS I use this: <?php $size_bias = tep_db_query("select products_size_bias from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); ?> and this inside the JS: var sizebias = <?php echo $size_bias ?>; The resulting product_info page seems to be cut short around these php echo at the beginning of the JS and the rest doesn't even make it on the resulting page. Any idea why? Is this not a good way to pass variables? Anything else I'm doing wrong? Thanks!
  13. @bruyndoncx right! That was it, along with a few hundred JS syntax errors (I never do JS). It's almost working now, I just need to debug the JS some more. THANK YOU SIR!
  14. Thanks for the help! @frankl So I need a semicolon both to close the php line AND one to close the JS line, like so, correct? var sizebias = <?php echo $size_bias; ?>; I found the syntax I used here: Passing PHP Variables to JavaScript and it didn't mention a semicolon inside the php. @bruyndoncx I believe I have the necessary code to fetch the data I need. My includes file looks like this: <?php if (isset($HTTP_GET_VARS['products_id'])) { $is_skates = tep_db_query("select products_is_skates from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $available_in_half_sizes = tep_db_query("select products_available_in_half_sizes from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $size_bias = tep_db_query("select products_size_bias from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $narrow_appropriate = tep_db_query("select products_narrow_feet_appropriate from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $slightly_narrow_appropriate = tep_db_query("select products_medium_narrow_feet_appropriate from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $regular_appropriate = tep_db_query("select products_regular_feet_appropriate from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $slightly_wide_appropriate = tep_db_query("select products_medium_wide_feet_appropriate from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $wide_appropriate = tep_db_query("select products_wide_feet_appropriate from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); if ($is_skates = 1) { ?> <script type="text/javascript"> function sizewizard(){ var availablehalfsizes = "<?php echo $available_in_half_size; ?>"; var sizebias = "<?php echo $size_bias; ?>"; var sizebias = Number(sizebias); var narrowappropriate = "<?php echo $narrow_appropriate; ?>"; var slightlynarrowappropriate = "<?php echo $slightly_narrow_appropriate; ?>"; var regularappropriate = "<?php echo $regular_appropriate; ?>"; var slightlywideappropriate = "<?php echo $slightly_wide_appropriate; ?>"; var wideappropriate = "<?php echo $wide_appropriate; ?>"; var ssize = document.getElementById('ssize').value; ... but when I call the include on my product_info page (right before the product_available) it ends up cutting in the middle of the JS like this: <script type="text/javascript"> function sizewizard(){ var availablehalfsizes = ""; var sizebias = "</script> </div? Weird how the first variable I try to pass fails as blank, then the second one just causes the script to be truncated right there...
  15. cinolas

    QTPro BS

    That was it! I don't know why the line didn't make it in. Thank you so much! This is clearly above and beyond support.
  16. cinolas

    QTPro BS

    Thanks @raiwa! I appreciate. "NIC for QTPro" is my own tag I've added to find modifications I've made vs original code. In some places Ive tried preserving the original code by commenting it out. I'm not sure there's another add-on other than QTPro there. The checkout process works right now, other than products being turned off, so I'm very hesitant to mess with it (rebuild, clean up the checkout_process file as I know I should). In the above code, the lines: if (tep_db_num_rows($stock_query) > 0) { $stock_values = tep_db_fetch_array($stock_query); // do not decrement quantities if products_attributes_filename exists //NIC for QTPro /* if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) { $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; } else { $stock_left = $stock_values['products_quantity']; } tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . (int)$stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); */ $actual_stock_bought = $order->products[$i]['qty']; $download_selected = false; if ((DOWNLOAD_ENABLED == 'true') && isset($stock_values['products_attributes_filename']) && tep_not_null($stock_values['products_attributes_filename'])) { $download_selected = true; $products_stock_attributes='$$DOWNLOAD$$'; } The part I commented out with the NIC for QTPro obviously is the part that checks how much stock is left, and sets the product status to 0 if there's none left. Can this be uncommented without affecting QTPro? I'm not sure why it's commented out, it may have been my mistake. Is this code supposed to be active in a normal QTPro installation? Thanks!
  17. cinolas

    QTPro BS

    In this section specifically I seem to have commented out the code that turns off the product. // Stock Update - Joao Correia //NIC for QTPro /* if (STOCK_LIMITED == 'true') { if (DOWNLOAD_ENABLED == 'true') { */ //++++ QT Pro: Begin Changed code $products_stock_attributes=null; if (STOCK_LIMITED == 'true') { //$products_attributes = $order->products[$i]['attributes']; // if (DOWNLOAD_ENABLED == 'true') { //++++ QT Pro: End Changed Code //NIC for QTPro $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa ON p.products_id=pa.products_id LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad ON pa.products_attributes_id=pad.products_attributes_id WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"; // Will work with only one option for downloadable products // otherwise, we have to build the query dynamically with a loop $products_attributes = (isset($order->products[$i]['attributes'])) ? $order->products[$i]['attributes'] : ''; if (is_array($products_attributes)) { $stock_query_raw .= " AND pa.options_id = '" . (int)$products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . (int)$products_attributes[0]['value_id'] . "'"; } $stock_query = tep_db_query($stock_query_raw); } else { $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } if (tep_db_num_rows($stock_query) > 0) { $stock_values = tep_db_fetch_array($stock_query); // do not decrement quantities if products_attributes_filename exists //NIC for QTPro /* if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) { $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; } else { $stock_left = $stock_values['products_quantity']; } tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . (int)$stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); */ $actual_stock_bought = $order->products[$i]['qty']; $download_selected = false; if ((DOWNLOAD_ENABLED == 'true') && isset($stock_values['products_attributes_filename']) && tep_not_null($stock_values['products_attributes_filename'])) { $download_selected = true; $products_stock_attributes='$$DOWNLOAD$$'; } But it looks like I did this for QTPro. I looked in the latest version install files and there's no instructions to comment out that part, so I'm a bit confused, I may have installed an old version but it's working well enough... Did I comment that out erroneously? Can I solve my problem by simply uncommenting that part without otherwise negatively affecting QTPro? Thanks!
  18. cinolas

    QTPro BS

    for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { // Stock Update - Joao Correia //NIC for QTPro /* if (STOCK_LIMITED == 'true') { if (DOWNLOAD_ENABLED == 'true') { */ //++++ QT Pro: Begin Changed code $products_stock_attributes=null; if (STOCK_LIMITED == 'true') { //$products_attributes = $order->products[$i]['attributes']; // if (DOWNLOAD_ENABLED == 'true') { //++++ QT Pro: End Changed Code //NIC for QTPro $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa ON p.products_id=pa.products_id LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad ON pa.products_attributes_id=pad.products_attributes_id WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"; // Will work with only one option for downloadable products // otherwise, we have to build the query dynamically with a loop $products_attributes = (isset($order->products[$i]['attributes'])) ? $order->products[$i]['attributes'] : ''; if (is_array($products_attributes)) { $stock_query_raw .= " AND pa.options_id = '" . (int)$products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . (int)$products_attributes[0]['value_id'] . "'"; } $stock_query = tep_db_query($stock_query_raw); } else { $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } if (tep_db_num_rows($stock_query) > 0) { $stock_values = tep_db_fetch_array($stock_query); // do not decrement quantities if products_attributes_filename exists //NIC for QTPro /* if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) { $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; } else { $stock_left = $stock_values['products_quantity']; } tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . (int)$stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); */ $actual_stock_bought = $order->products[$i]['qty']; $download_selected = false; if ((DOWNLOAD_ENABLED == 'true') && isset($stock_values['products_attributes_filename']) && tep_not_null($stock_values['products_attributes_filename'])) { $download_selected = true; $products_stock_attributes='$$DOWNLOAD$$'; } // If not downloadable and attributes present, adjust attribute stock if (!$download_selected && is_array($products_attributes)) { $all_nonstocked = true; $products_stock_attributes_array = array(); foreach ($products_attributes as $attribute) { if ($attribute['track_stock'] == 1) { $products_stock_attributes_array[] = $attribute['option_id'] . "-" . $attribute['value_id']; $all_nonstocked = false; } } if ($all_nonstocked) { $actual_stock_bought = $order->products[$i]['qty']; } else { asort($products_stock_attributes_array, SORT_NUMERIC); $products_stock_attributes = implode(",", $products_stock_attributes_array); $attributes_stock_query = tep_db_query("select products_stock_quantity from " . TABLE_PRODUCTS_STOCK . " where products_stock_attributes = '$products_stock_attributes' AND products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); if (tep_db_num_rows($attributes_stock_query) > 0) { $attributes_stock_values = tep_db_fetch_array($attributes_stock_query); $attributes_stock_left = $attributes_stock_values['products_stock_quantity'] - $order->products[$i]['qty']; tep_db_query("update " . TABLE_PRODUCTS_STOCK . " set products_stock_quantity = '" . $attributes_stock_left . "' where products_stock_attributes = '$products_stock_attributes' AND products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); $actual_stock_bought = ($attributes_stock_left < 1) ? $attributes_stock_values['products_stock_quantity'] : $order->products[$i]['qty']; } else { $attributes_stock_left = 0 - $order->products[$i]['qty']; tep_db_query("insert into " . TABLE_PRODUCTS_STOCK . " (products_id, products_stock_attributes, products_stock_quantity) values ('" . tep_get_prid($order->products[$i]['id']) . "', '" . $products_stock_attributes . "', '" . $attributes_stock_left . "')"); $actual_stock_bought = 0; } } } // $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); // } // if (tep_db_num_rows($stock_query) > 0) { // $stock_values = tep_db_fetch_array($stock_query); // do not decrement quantities if products_attributes_filename exists if (!$download_selected) { $stock_left = $stock_values['products_quantity'] - $actual_stock_bought; tep_db_query("UPDATE " . TABLE_PRODUCTS . " SET products_quantity = products_quantity - '" . $actual_stock_bought . "' WHERE products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); //++++ QT Pro: End Changed Code //NIC for QTPro } } //} NIC THIS SEEMS TO HAVE A BEEN AN EXTRA BRACKET.... SO I COMMENTED IT OUT AND IT WORKED, but not 1005sure it's the right bracket // Update products_ordered (for bestsellers list) tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); //NIC for QTPro /* $sql_data_array = array('orders_id' => $insert_id, 'products_id' => tep_get_prid($order->products[$i]['id']), 'products_model' => $order->products[$i]['model'], 'products_name' => $order->products[$i]['name'], 'products_price' => $order->products[$i]['price'], 'final_price' => $order->products[$i]['final_price'], 'products_tax' => $order->products[$i]['tax'], 'products_quantity' => $order->products[$i]['qty']); */ //++++ QT Pro: Begin Changed code if (!isset($products_stock_attributes)) $products_stock_attributes=null; $sql_data_array = array('orders_id' => $insert_id, 'products_id' => tep_get_prid($order->products[$i]['id']), 'products_model' => $order->products[$i]['model'], 'products_name' => $order->products[$i]['name'], 'products_price' => $order->products[$i]['price'], 'final_price' => $order->products[$i]['final_price'], 'products_tax' => $order->products[$i]['tax'], 'products_quantity' => $order->products[$i]['qty'], 'products_stock_attributes' => $products_stock_attributes); //++++ QT Pro: End Changed Code //NIC for QTPro Oy what a mess. I found the code that I believe does the stock adjustment, and so should also set the product status, in checkout_process My checkout_process is a mess of commented out code and added QTPro code. Somewhere along the way I ended up with a stray bracket, which I commented out, but I'm not sure it was the right one... (how does one find stray brackets in php??). You guys might see clear through this, but it's beyond my coding abilities.
  19. cinolas

    QTPro BS

    Hi, I'm having a possibly simple problem. I have osCommerce 2.34 BS Gold installed with QTPro (not exactly sure where to get the version #). Some products have stock quantities by attributes, some not. Everything works well except that products don't get turned off, to "Out of Stock" status, when the stock reaches 0. Specifically products that don't have stock by attribute, I'm not sure about those who do. I thought this was a simple setting on Admin side but if so I can't find it. What could cause my products not to automatically be set to "Out of Stock" when the stock runs out? and how do I change that? I'm not even sure what file contains the code that's responsible for performing that action.. Cheers!
  20. cinolas

    Moneris, eSelect plus

    @@greasemonkey Thank you sir!
  21. cinolas

    Moneris, eSelect plus

    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!
  22. cinolas

    [Contribution] Ship In Cart

    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.
  23. cinolas

    [Contribution] Ship In Cart

    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!
  24. cinolas

    [Contribution] Ship In Cart

    @@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
  25. cinolas

    [Contribution] Ship In Cart

    @@raiwa Thank you so much, these are smart things to try, and exactly the nudge in the right direction I needed.
×