Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


Everything posted by ArtcoInc

  1. ArtcoInc

    Email problems

    @oscomglas Are you trying to send plain text, or HTML? M
  2. There are several things I like to conditionally hide ... for example, if an item is out of stock, I want to hide the 'Buy' button. If a customer puts an item in their shopping cart, and then increases the quantity to more than is available, I want to hide the 'Checkout' button. Historically, I just hacked the code (yes, I hack the core code <hanging head in shame>) with an IF statement. Is there a better way? I know that @burt has done something like this in one of his 28 days bundles, but he used JavaScript, and I know *nothing* about JavaScript. I also have no idea how hooks work ( @burt , any chance someone could write up a tutorial on how hooks work, and how to use them? Or, a link to a resource that explains them?). I'm just a 'copy and paste' kind of guy. TIA Malcolm
  3. 'Allow Checkout' is set to false. The 'Checkout' button still shows, and if you click on it, it takes you to the 'checkout_shipping' page. Clicking on the 'Continue' button takes you back to the shopping cart. My point is, if there's not enough stock, don't even have a 'Checkout' button. Or a 'Buy' button. Oh, and I also installed an add-on that displays the available stock quantity in the shopping cart, so the customer doesn't have to guess how many are available (yes, another core code hack <sigh>). But, this doesn't answer my initial question ... What's the best way to hide these buttons? Hooks, hacks, or JavaScript? M
  4. ArtcoInc

    USPS Rate V4, Intl Rate V2 (official support thread)

    (Phoenix A couple of questions ... 1) I have downloaded two different versions of this module. What is the difference between the V2_r1.8 and V2_r3.6 ? It looks like @kymation updated the V2_r1.8 version in 2017 to address the First Class mail changes, but these changes are not in the V2_r3.6 version. 2) Does anyone have this working with the Ship in Cart 5.0 CE Phoenix add-on? I have both it and V2_r3.6 installed (I don't use First Class mail). Country drop-down= true, State drop-down = true, and ZIP Code input field = true. It does work, but ... for some countries, I get the multiple instances of the following error: Warning: Invalid argument supplied for foreach() in C:\wamp64\www\m10\includes\modules\shipping\usps.php on line 132 The line in question is: foreach ($Package['ExtraServices']['ExtraService'] as $key => $val) { There are several other foreach statements throughout the module with the same syntax, so I don't see anything obviously wrong ... TIA Malcolm
  5. ArtcoInc

    USPS Rate V4, Intl Rate V2 (official support thread)

    @Chadduck 1) As you have identified, there is no shipping_usps.gif file in the add-on bundle. Fortunately, you already had one from a prior live store. For anyone else trying to get this to work with Phoenix, here's the file: 2) In the stock installation of Phoenix, there is no /images/icons folder. With that, there is also no DIR_WS_ICONS definition in the configuration file(s). To correctly use the shipping_usps.gif file, you need to: a) Create a /images/icons folder b) Copy the shipping_usps.gif file into this folder c) In includes/modules/shipping/usps.php , find $this->icon = DIR_WS_ICONS . 'shipping_usps.gif'; and change it to: $this->icon = 'images/icons/shipping_usps.gif'; Obviously, you could use any other folder you want to store the .gif file. Just update the path to point to the file's location. If you did not have a copy of the shipping_usps.gif file, you could try to use the font awesome icon. The link Zahid gave above is wrong. His is a link to the UPS icon, not the USPS icon. The correct link is: https://fontawesome.com/icons/usps?style=brands However, the USPS module stores everything in an array (including the location of the icon), and I could not just substitute the Font Awesome link for the location of the .gif file. HTH M
  6. @lynne How did you create the empty database? Did you use a tool such as PhpMyAdmin? Or, did you use your host's cPanel tools? Did you make sure that you wrote down the database server name (often 'localhost'), database name, user's name, and user's password correctly? M
  7. Is there some way to verify that the Postal Code entered matches with the State entered? I'm playing around with the 'Ship In Cart' add-on that allows customers to estimate their shipping costs before moving into the checkout process. The customer has to enter their country, state, and postal code. Shipping with the US Post Office, the postal code is used to calculate the shipping cost, and the state is only used to determine if sales tax is applied. It is possible for the customer to enter a state and postal code that to not match, and thus display an incorrect estimate. I know that there is a Google Address Complete module available, but don't know if it would work in this application. As an aside, when a customer enters their address, osC / Phoenix uses the default order sequence of: name - address - city - postal code - state - country. I have seen some sites will start with the country, then the postal code, and then auto-fill in the city and state based on the postal code. TIA Malcolm
  8. @lynne 1) Do NOT use the last 'official' version of osC. It is very much out of date. Instead, use the Community Edition 'Phoenix' (see @burt's signature above). 2) I'm *assuming* you are using your host's server, and not an in-house development server. Although this is a little out of date, here are instructions for installing osC on your host's server ... HTH Malcolm
  9. ArtcoInc

    Email Pop-up App

    @Jeffrmarks Which version of osC? What exactly do you want this pop-up to do? M
  10. Phoenix 1.0.1.x As I stated in my past post (Where to load jQuery), I'm trying to track down a problem. In doing so, I've found a couple of errors and warning. This one says: This comes from a modal login module that @auzStar wrote. Here is the code segment in question: The specific character causing the error is the '<' here: var login = "<?php echo ... The script works, but I would like to fix any errors and warnings. Any ideas? TIA Malcolm
  11. @JcMagpie Back in 2015, I started a thread about using a Modal to log in faster ... In this thread, I came up with a simple modal popup to make logging in faster, without having to load another page. There was a lot of discussion on how the login was handled in a mixed SSL site. @auzStar added the scripts to "set a snapshot". It is in these scripts that this error is happening. Later, @ndiggity added the Ajax functionality. I have not used this. I am using @auzStar's version. @BrockleyJohn here is the full script. Initially, this was all in a navbar module template file. I had to pull the scripts out and move them to a header tag module in order to load the code at the bottom of the page. <?php /* $Id: ht_modal_login.php, v1.0 27th Aug. 2019 M.Spann$ Modal Login script Header Tag Module osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2016 osCommerce Released under the GNU General Public License */ class ht_modal_login { var $code; var $group; var $title; var $description; var $sort_order; var $enabled = false; function __construct() { $this->code = get_class($this); $this->group = 'footer_scripts'; $this->title = MODULE_HEADER_TAGS_MODAL_LOGIN_TITLE; $this->description = MODULE_HEADER_TAGS_MODAL_LOGIN_DESCRIPTION; if ( defined('MODULE_HEADER_TAGS_MODAL_LOGIN_STATUS') ) { $this->sort_order = MODULE_HEADER_TAGS_MODAL_LOGIN_SORT_ORDER; $this->enabled = (MODULE_HEADER_TAGS_MODAL_LOGIN_STATUS == 'True'); } } function execute() { global $PHP_SELF, $oscTemplate; $output = <<<EOD <script> $(function() { // login (login is also in footer, index page and create account page) var login = "<?php echo tep_href_link('login.php', '', 'SSL') ?>"; if ($.contains(document, $("a[href='"+login+"']")[0]) && "<?php echo basename($PHP_SELF) != 'login.php' ?>") { $("a[href='"+login+"']").click(function(e) { e.preventDefault(); set_snapshot("<?php echo (basename($PHP_SELF) == 'logoff.php' || basename($PHP_SELF) == 'create_account.php' || basename($PHP_SELF) == 'account_pwa.php' ? 'index.php' : basename($PHP_SELF)) ?>"); show_login_modal(); }); } // if login modal is closed then we clear the snapshot // (if continues to login, then snapshot is cleared as normal via login.php after successful login) $('#ModalLogin').on('hidden.bs.modal', function() { $.ajax({ url: "ext/modules/content/header/login_modal/clear_snapshot.php" }); }) }); function set_snapshot(redirect_page, redirect_vars, redirect_ssl) { var redirect_vars = redirect_vars || {}; redirect_vars = $.extend(<?php echo json_encode($_GET) ?>, redirect_vars); var redirect_ssl = redirect_ssl || ''; $.ajax({ type: "GET", dataType: "json", url: "ext/modules/content/header/login_modal/set_snapshot.php", data: {'redirect_ssl': redirect_ssl, 'redirect_page': redirect_page, 'redirect_vars': redirect_vars} }); } function show_login_modal() { $('#ModalLogin').modal('show'); } </script> EOD; $oscTemplate->addBlock($output, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_HEADER_TAGS_MODAL_LOGIN_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 New Equal Heights Module', 'MODULE_HEADER_TAGS_MODAL_LOGIN_STATUS', 'True', 'Do you want to enable the New Equal Heights module?', '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, date_added) values ('Sort Order', 'MODULE_HEADER_TAGS_MODAL_LOGIN_SORT_ORDER', '0', '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_HEADER_TAGS_MODAL_LOGIN_STATUS', 'MODULE_HEADER_TAGS_MODAL_LOGIN_SORT_ORDER'); } } TIA Malcolm
  12. ArtcoInc

    Recaptcha v3 announcement

    @SupTech v2.3.1 dates to 2010. I am surprised that you have it running on PHP v7.1 M
  13. @kgtee Like I said, I know nothing about javascript. The syntax error is complaining about the first < M
  14. ArtcoInc

    Recaptcha v3 announcement

    @SupTech Which version of osC are you using? M
  15. @BrockleyJohn I know nothing about javascript, but I suspect you are right. It didn't look right to me, mixing PHP in there like that. But, the script works. Unless someone comes up with a solution, I may just have to live with it. Thank you! M
  16. Phoenix 1.0.1.x While trying to troubleshoot a problem, I noticed that several of my menu modules were throwing these errors: The code in question is the first line here: A quick Google search said that these scripts were trying to load before the jQuery library was loaded. I looked, and jQuery was being loaded at the end of the page. When I moved the call to load the jQuery library into the <head> area, these errors went away. So, my question is: Should loading the jQuery library be in the <head>, or at the end of the <body>? M
  17. @raiwa Thank you very much! After I had posted yesterday, I took a deep breath and attacked the issue. I pulled the scripts out of the menu modules, and wrote (copy, cut and paste) new Header Tag modules, similar to what you posted above.. This pushed all of the scripts down to the end of the page. This seems to have resolved the errors (well, there is one left, but I'll address that one separately). Thank you, though, for your time and consideration. I'm sure the information you posted above will be of value to others too. Sincerely, Malcolm
  18. @burt While I did read that the script was supposed to wait until the library was loaded, I still saw these errors. Hence, the question. @BrockleyJohn These scripts are part of the Horizontal Menu modules by @Tsimi and @GLWalker . One is in the Header, and I have adapted one to work in the NavBar for the XS view. So yes, it is putting the same script in two places on the page. I'm sure that these could be rewritten to put just one script at the end of the <body>, but that may be beyond my abilities. Thank you both. M
  19. @De Dokta I have just installed this in a 234bs cart, and things work very well. Thank you! One thing I would like to see is: Since the customer is buying as a guest, once they move to checking_shipping, is there really a need to offer them the choice of changing addresses in their address book, which they don't have? If we could have a check in checkout_shipping to see if the customer is a guest, we can eliminate that, and make the guest checkout smoother ... Here's where it needs to be addressed in checkout_shipping.php <div class="page-header"> <h1><?php echo HEADING_TITLE; ?></h1> </div> <?php echo tep_draw_form('checkout_address', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'post', 'class="form-horizontal"', true) . tep_draw_hidden_field('action', 'process'); ?> <div class="contentContainer"> <h2><?php echo TABLE_HEADING_SHIPPING_ADDRESS; ?></h2> <div class="contentText row"> <div class="col-sm-8"> <!-- If this could be applied *only* if the customer is NOT a guest ... <div class="alert alert-warning"> <?php echo TEXT_CHOOSE_SHIPPING_DESTINATION; ?> <div class="clearfix"></div> <div class="pull-right"> <?php echo tep_draw_button(IMAGE_BUTTON_CHANGE_ADDRESS, 'glyphicon-home', tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL')); ?> </div> <div class="clearfix"></div> </div> </div> <div class="col-sm-4"> --> <div class="panel panel-primary"> <div class="panel-heading"><?php echo TITLE_SHIPPING_ADDRESS; ?></div> <div class="panel-body"> <?php echo tep_address_label($customer_id, $sendto, true, ' ', '<br />'); ?> </div> </div> </div> </div> <div class="clearfix"></div> <?php if (tep_count_shipping_modules() > 0) { ?> Thoughts? Malcolm
  20. ArtcoInc

    Store Search Bar (BS)

    @tgely Ok, I tried something different ... 1) I logged into my host's server, created a new, blank subdirectory, and blank database. The subdirectory is under my primary domain. 2) I uploaded a copy of Phoenix (patched up to v1.0.1.4), which included my Store Search NavBar code. 3) I did an in-place installation, and let the installation create the configuration files. 4) I logged into admin, and installed the Store Search NavBar module. 5) I edited a few products and files to include the appropriate search terms. So, I now launch a browser, and log into the new store. Using all three browsers here (IE, Chrome, and Firefox), the search function seems to work for me. It also worked fine for one tester, but two other testers are reporting problems. Any ideas? Malcolm PS: I can pm you the URL and search terms if you want. I can also send you the module code.
  21. ArtcoInc

    Store Search Bar (BS)

    @tgely @milerwan May I ask you two to test this? I am having different people getting different results ... Malcolm
  22. ArtcoInc

    Store Search Bar (BS)

    Ok, @burt tested it for me, and for him, it works fine under IE, but not under Chrome. Can I get a couple more testers, please? Malcolm
  23. ArtcoInc

    Store Search Bar (BS)

    I started over adapting this to both the NavBar and to Phoenix. I don't know what I did, but whatever problems I was initially having have been resolved. I've been doing my development on an in-house WAMP server. I wanted to share my progress with others, so I moved the shop to my host's server. Here, I've discovered a slight browser related problem ... If I access my shop (on my host's server) using Chrome, and I use the search function, everything works fine from any page. Internet Explorer 11 also works fine. If I access my shop using Firefox (68.0.2), and I use the search function ON THE HOME PAGE, nothing works. If I use it on ANY OTHER PAGE, it works fine. If I return to the home page, it no longer works. If anyone can test this for me, I can pm you with the URL and some search terms. TIA Malcolm
  24. Unless I'm missing something, which is quite possible ... There is no provision to display the Category Image on a Categories page. I did a quick hack to add code to display the image in the /includes/modules/content/index_nested/templates/tpl_cm_in_title.php file, although in retrospect I should (and probably will) make a new module just to display the image. M