Jump to content

ecartz

♥Ambassador
  • Content count

    3,864
  • Joined

  • Last visited

  • Days Won

    69

Posts posted by ecartz


  1. 1 hour ago, nedragdnuos said:

    Warning: Use of undefined constant TABLE_TAX_CLASS

    In general, when you see errors of this form TABLE_SOMETHING in regards to SQL, the fix is to go through and replace

    " . TABLE_TAX_CLASS . "

    with

    tax_class

    And yes, it is deliberate to remove the quotation marks and periods when doing that.  Before the code was concatenating the constant into the string.  Now the constant is gone and you just put the table name directly into the string. 

    "select tax_class_id, tax_class_title from tax_class order by tax_class_title"

    Note that this means that the App was last updated prior to the 1.0.5.9 release.  So we're two .0 versions past the change being made that broke this.  And we're even further past the start of the change, which actually predates Phoenix.  I mention this because unless you have budget to get this updated professionally, you might find that there are other issues that are not current in the code.  This just being a particularly visible instance. 


  2. 3 minutes ago, dculley said:

    Problem is  that when I go to add a regular customer or a guest  and click on continue it will not go any further. 

    The only add ones I have install is: reCapthcha, CK editor, Kissit catalog and admin, Stripe payment, USPS and Guest Checkout. 

    This is the KISS IT support thread.  It seems far more likely that the problem that you are experiencing is in one of Guest Checkout (Rainer supports Purchase without Account), reCaptcha, or conceivably CK Editor.  As those actually change the customer registration or form fields.  I would be rather surprised if any of KISS IT, Stripe, or USPS broke account creation on their own.  It's vaguely possible that KISS IT and reCaptcha are interacting in a problematic way. 

    As a process, there's nothing special about troubleshooting.  The initial process is the same for developers and non-developers.  Install a store with no Apps.  Test if it works.  If it does, pick an App.  Install just that App.  See if the thing that was broken works.  Do this for each App on a fresh store.  If you find that one of the Apps is breaking the page, then ask for help in the support thread for that App.  If not, now you have three to six store installations.  Back them up.  Install a second App on each and repeat the process. 

    Things I find most likely to break registration: 

    1.  Guest Checkout alone.

    2.  ReCaptcha alone. 

    3.  CK Editor alone.

    4.  Guest Checkout and ReCaptcha together.

    5.  ReCaptcha and KISS IT together. 

    6.  Guest Checkout and CK Editor together.

    7.  Guest Checkout, ReCaptcha, and KISS IT together.

    8.  Guest Checkout, ReCaptcha, KISS IT, and CK Editor together. 

    You can test this by installing three stores in subdirectories. 

    1.  Guest Checkout then ReCaptcha then KISS IT then CK Editor.

    2.  ReCaptcha then KISS IT.

    3.  CK Editor then Guest Checkout.

    Remember to test after each install.  When you find the broken combination, post in the support thread for one of the installed Apps on the broken install.  That could include here.  Or not, as it may turn out that KISS IT has nothing to do with it.  But don't be surprised if whichever developer tells you that they simply don't support that App combination.  But to really have any hope of a developer even considering this, you need to first figure out what Apps are actually causing the problem.  Guest Checkout and ReCaptcha seem the most likely, as they affect registration form processing.  CK Editor and KISS IT certainly work on their own, but it is conceivable that they cause some kind of interaction.  If you can show that adding just that to an existing set of working Apps breaks something, then an App maintainer might be willing to investigate.  But as is, you're essentially asking for someone to guess what might have gone wrong. 

    You currently have no reason to think that KISS IT is the one of those six Apps that is causing the problem.  It's more likely to be Guest Checkout or ReCaptcha.  If you want more help, you need to do some of the investigative work so that you can figure out who actually would be able to help you.  It may be that one of those Apps is breaking registration alone.  It may be that two (or more) are combining in a weird way.  It's conceivable that KISS IT is involved, but I can tell you that there are a number of people with KISS IT installed who are able to register on their websites.  And of course, KISS IT changes image handling not form handling nor registration.  So unless you combine it with something like ReCaptcha (which shows an image as part of form processing), I don't see how it could do anything.  And really, it's more likely that there is a problem with either Guest Checkout or ReCaptcha or both. 


  3. 2 minutes ago, LeeFoster said:

    The upgrade to 1.0.7.5 has caused issues with this add on, is any one interested in working together to get this fixed?

    1.0.7.5?  Or 1.0.7.4?  You should be able to just change the hook to run just before the shopping cart actions.  I did this recently, so I should probably be able to look up the new hook name/location later. 


  4. 1 hour ago, glamocanilaktasi said:

    My host told me that I am on shered hosting and thay can't remove TLS 1.0 and 1.1  becouse other users use this options.

    But TLS is configurable per VirtualHost.  So it can have multiple values on the same shared server.  I.e. they can have one setting for most everyone and then put just those sites that need the historical settings on a different VirtualHost. 

    If your host can't do that for you, then switching to one that can is highly advised.  I mean, the very fact that they didn't just fix it is an argument in favor of switching hosts. 


  5. 2 hours ago, anya2001 said:

    Is there any update on this?  Is osCommerce developing a new module?

    As far as I know, no one associated with osCommerce or Phoenix is working on a new module. 

    Note that there is no requirement that a payment module be provided by osCommerce or Phoenix.  Authorize.net or a third party could make a payment module.  Like all modules (including the old Authorize.net modules), it should be a drop-in install without any need to modify core. 


  6. 1 minute ago, discxpress said:

    Where do I place ---> }

    I keep getting an error on line 78 when I remove it.

    Leave it where you had it in your previously posted code.  The only change from your previously posted code should be to switch the order of the two lines that I posted. 

    You could also switch two of the } but since they are identical, there doesn't seem to be any point.  The positions where they are are correct enough (if I were doing the change, I'd indent them to match everything else; but that won't affect functionality). 


  7. @discxpress

    You have two lines in your code: 

    if ($GLOBALS['PHP_SELF'] == 'index.php') {
        function execute() {

    replace those two lines with

        function execute() {
            if ($GLOBALS['PHP_SELF'] == 'index.php') {

    I.e. swap the order of those two lines.

    The rest of the code can stay the same as in your previous post. 


  8. 20 minutes ago, kgtee said:

    When you make wishlist into a hook, I am curious how you ensure the wishlist action is executed before the shopping cart action. This order of execution is important as you do not want shopping cart to act first leaving nothing for the wishlist.

    Put it in the hook before the shopping cart action is processed? 

    This will be a little more complicated in 1.0.7.4, as the shopping cart actions are also processed by a hook.  But in 1.0.7.3, there is a hook call immediately prior to the processing of the shopping cart actions. 

    22 hours ago, LeeFoster said:

    The wishlist addon has its class file that contains its own count_contents function.

    Then it seems to be saying that the $wishlist object is not set.  I would probably replace it with $_SESSION['wishlist'] and it's possible that it is not triggering the wishlist creation for some reason.  Or perhaps it needs to be gated by

    if (isset($_SESSION['wishlist'])) {

    somewhere. 


  9. class hook_shop_system_wishlistApp {
    
      public function listen_preActionApp() {
    // wishlist data
        if (!isset($_SESSION['wishList']) || !($_SESSION['wishList'] instanceof wishlist)) {
          $_SESSION['wishList'] = new wishlist();
        }
    
    //Wishlist actions (must be before shopping cart actions)
        if (isset($_POST['wishlist'])) {
          if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) {
            $qty = $_SESSION['wishList']->get_quantity(tep_get_uprid($_POST['products_id'], $attributes)) + (int)($_POST['qty'] ?? 1);
    
            $_SESSION['wishList']->add_wishlist($_POST['products_id'], $qty, ($_POST['id'] ?? ''));
          }
    
          if (WISHLIST_REDIRECT ==  'No') tep_redirect(tep_href_link('product_info.php', 'products_id=' . $_POST['products_id']));
          tep_redirect(tep_href_link('wishlist.php'));
        }
      }
      
    }

    Alternately, adding global $wishlist at the beginning of the function might work. 


  10. How do you generate the PDF?  Do you click a link on an osCommerce page?  Or do you go somewhere else?  If an osC page, which one and what actions do you do?  Press a button?  Does it link somewhere?  Where? 

    I don't want to grill you, but those are the kinds of things we would need to help you find what you need.  All this assumes that it is not in the EPOS, as we wouldn't offer much help then. 


  11. I made a mistake in the second line. 

    public function listen_injectRedirects() {
      $products_ship_free = false;
      if (!GLOBALS['free_shipping']) {
        define('TEXT_CHOOSE_SHIPPING_METHOD', TEXT_CHOOSE_SHIPPING_METHOD_NO_PFS);
        define('TEXT_ENTER_SHIPPING_INFORMATION', TEXT_ENTER_SHIPPING_INFORMATION_NO_PFS);
        return;
      }
    
      foreach ($_SESSION['cart']->get_products() as $product) {
        if (1 == $product['ship_free']) {
          $ship_free_count += $product['quantity'];
        }
      }
    
      if (($GLOBALS['total_weight'] == 0) && ($GLOBALS['total_count'] == 0)) {
        $products_ship_free = true;
        $GLOBALS['free_shipping'] = true;
        if (!defined('FREE_SHIPPING_TITLE')) {
          include 'includes/languages/' . $_SESSION['language'] . '/modules/order_total/ot_shipping.php';
        }
      }
    
      define('TEXT_CHOOSE_SHIPPING_METHOD', ($products_ship_free ? sprintf(PRODUCTS_SHIP_FREE_COUNT, $ship_free_count); : TEXT_CHOOSE_SHIPPING_METHOD_NO_PFS));
      define('TEXT_ENTER_SHIPPING_INFORMATION', ((!$products_ship_free && ($ship_free_count > 0)) ? sprintf(PRODUCTS_SHIP_FREE_COUNT_ONLY, $ship_free_count) : TEXT_ENTER_SHIPPING_INFORMATION_NO_PFS));
    }

    Note that this assumes that you've modified the shoppingCart->get_products method to return the 'ship_free' column. 


  12. jQuery has a selector, which looks like

    $('SELECT#css_id')

    The part inside the quotes can be pretty much anything that could appear in a CSS definition.  But remember that you probably only want it to apply to one menu, so try for something unique, like ID (rather than class or HTML element).  Remember that it is possible to say something like #css_id SELECT to get the select menu inside the #css_id element.  Then you attach an onchange handler like

    $('SELECT#css_id').change(function () {/* JS here */});

    That would be close to the equivalent of the onchange in

    <SELECT id="css_id" onchange="/* JS here */">

    assuming that you have

    <SELECT id="css_id">

    somewhere in the HTML. 

    Relevant reference:  https://stackoverflow.com/q/11179406

    If you post the HTML for the select menu and the recommended jQuery, someone could probably give more help. 


  13. 4 hours ago, cdetdi said:

    Whenever I do testing my orders seem to use the payments_standard file and skip the ipn file, but, maybe 20-25% of orders seem to be doing the opposite.

    Just to highlight something that others have noted in passing but may not have stated explicitly enough.  If you want to test the IPN path, then don't go back to your site after making the payment.  Because if you just click quickly through everything, chances are that you get back to the site before PayPal sends the IPN.  So act like a customer.  When you get to the screen that says something like "Click here to return to the merchant", close the browser window.  Then your test will work like their order.  Because some customers do exactly that. 

    Note that both the IPN and the click through flow use the paypal_standard file.  The IPN file also has some logic of its own.  This contrasts to the logic triggered from the checkout_process file. 


  14. You might want to change lines 67-71 to

          $tpl_data = ['group' => $this->group, 'file' => __FILE__];
          include 'includes/modules/block_template.php';

    Which happens to be robust in the face of name changes as well as forwardly compatible with switchable templates.  See https://github.com/gburton/CE-Phoenix/commit/e8280d9fdf6364c01484fb5f292adf2511bcefbb#diff-da2a69f7f229fdc1ad483c93b286d7f2 for examples. 


  15. Create a checkout_shipping, injectRedirects hook. 

    public function listen_injectRedirects() {
      $GLOBALS['products_ship_free'] = false;
      if (!GLOBALS['free_shipping']) {
        define('TEXT_CHOOSE_SHIPPING_METHOD', TEXT_CHOOSE_SHIPPING_METHOD_NO_PFS);
        define('TEXT_ENTER_SHIPPING_INFORMATION', TEXT_ENTER_SHIPPING_INFORMATION_NO_PFS);
        return;
      }
    
      foreach ($_SESSION['cart']->get_products() as $product) {
        if (1 == $product['ship_free']) {
          $ship_free_count += $product['quantity'];
        }
      }
    
      if (($GLOBALS['total_weight'] == 0) && ($GLOBALS['total_count'] == 0)) {
        $products_ship_free = true;
        $GLOBALS['free_shipping'] = true;
        if (!defined('FREE_SHIPPING_TITLE')) {
          include 'includes/languages/' . $_SESSION['language'] . '/modules/order_total/ot_shipping.php';
        }
      }
    
      define('TEXT_CHOOSE_SHIPPING_METHOD', ($products_ship_free ? sprintf(PRODUCTS_SHIP_FREE_COUNT, $ship_free_count); : TEXT_CHOOSE_SHIPPING_METHOD_NO_PFS));
      define('TEXT_ENTER_SHIPPING_INFORMATION', ((!$products_ship_free && ($ship_free_count > 0)) ? sprintf(PRODUCTS_SHIP_FREE_COUNT_ONLY, $ship_free_count) : TEXT_ENTER_SHIPPING_INFORMATION_NO_PFS));
    }

    or similar.  In the language files for that page, for each language, change TEXT_CHOOSE_SHIPPING_METHOD to TEXT_CHOOSE_SHIPPING_METHOD_NO_PFS and TEXT_ENTER_SHIPPING_INFORMATION to TEXT_ENTER_SHIPPING_INFORMATION_NO_PFS. 

    In your overridden shopping_cart class, also change

        function count_contents() {
          $total_items = 0;
          if (is_array($this->contents)) {
            foreach (array_keys($this->contents) as $products_id) {
              $total_items += $this->get_quantity($products_id);
            }
          }
    
          return $total_items;
        }

    to

        function count_contents() {
          $total_items = 0;
          if (is_array($this->contents)) {
            foreach ($this->contents as $products_id => $product) {
              if (1 != $product['ship_free']) {
                $total_items += $this->get_quantity($products_id);
              }
            }
          }
    
          return $total_items;
        }

    and change in the calculate function

              $this->weight += ($qty * $products_weight);

    to

              if (1 != $this->contents[$products_id]['ship_free']) {
                $this->weight += ($qty * $products_weight);
              }

    That should cover the checkout_shipping instructions Lambros posted.  There may be other changes necessary to other files that are not included here.  For example, there are other changes to the shopping_cart class posted in the instructions.  And the catalog/shopping_cart.php change would now be made in includes/modules/content/shopping_cart/templates/tpl_cm_sc_product_listing.php

    Replace

        echo   '<th><a href="' . tep_href_link('product_info.php', 'products_id=' . $product['id']) . '">' . $product['name'] . '</a>';
        foreach (($product['attributes'] ?? []) as $option => $value) {

    with

        echo   '<th><a href="' . tep_href_link('product_info.php', 'products_id=' . $product['id']) . '">' . $product['name'] . '</a>';
        if (1 == $product['ship_free']) {
          echo '<br /><span class="smallText">(' . TEXT_PRODUCT_SHIPS_FREE . ')</span>';
        }
        foreach (($product['attributes'] ?? []) as $option => $value) {

    That's three lines added between two existing lines. 

    Hopefully that will be enough to get you going.  @Omar_one

×