Jump to content

ecartz

♥Ambassador
  • Content count

    3,732
  • Joined

  • Last visited

  • Days Won

    62

Posts posted by ecartz


  1. 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


  2. If you do not have a shipping module installed, you can't get past the checkout_shipping page unless you have only virtual products in your cart.  There needs to be at least one shipping method that is valid for your current address.  That has nothing to do with this App.  You'd get the exact same behavior if you registered an account. 

    1 hour ago, dculley said:

    Email is activated. under admin>configuration  Unless there is another one.

    He means under admin > Modules > Customer Data > Email Address -- you need, at minimum, the email module enabled for the create_account_pwa page.  You will have to click the Edit button and check the box next to create_account_pwa


  3. 8 hours ago, rupruprup said:

    a stand alone of the module is not compatible with standard Phoenix ?

    Given the problems that you were reporting with  the guest module triggering on the create_account and admin/customers pages, one solution would be to make it possible to shut off modules on those pages.  Currently every module displays on those pages, as they traditionally showed every input. 

    Presumably Rainer's solution shuts off the module on other pages in some other way. 

    If it is easier to make the module work with the modified version, then I can put those changes in core.  Then the version that I posted would essentially become standard Phoenix. 


  4. @raiwa @rupruprup

    If you want, you could try the alternative version of Phoenix at https://github.com/ecartz/CE-Phoenix/tree/guest

    On a live store, you might want to run

    UPDATE configuration SET configuration_value = CONCAT(configuration_value, ';create_account;customers') WHERE configuration_key LIKE 'MODULE_CUSTOMER_DATA%PAGES'

    Although you could get the same effect by uninstalling and reinstalling or simply editing the configuration of those modules. 

    Note that after running that SQL, you might have to edit the guest module to remove those two pages. 

    I have done no testing of that version at the moment.  Use at your own risk, only on test stores. 


  5. I can see your previous threads: 

    But please note that none of these do what Jack suggested.  Which is to find the existing thread for the particular App that you are using and post in that existing thread.  You keep posting new threads.  I can't even tell just by reading what App you have tried.  You posted a name but I'd have to search to see if I could find it. 

    You seem to be confusing a forum with a thread.  This is the Order Total module forum.  It is where developers go to post support threads for Apps.  It's not really intended for users to post question threads.  And in general, your threads aren't asking the kind of questions that people can help you.  I've read them.  I don't know the answer to the questions you are asking.  The only person who might know is the developer who made the App.  If the developer has not responded to you so far, then it is quite likely that that person is not reading the forum actively.  Posting in the actual support thread might notify that person. 

    It's also possible that the App is not actively supported.  It might need a new developer to take it over or to code a new one.  To interest such a developer, you would have to pay that person.  Because there aren't roving developers just waiting around to do free work. 

    Alternately, if you are actively trying to code something yourself, you could show us what you tried, what you thought/hoped would happen, and what actually did happen.  Then ask for help making it work the way that you wanted.  But as is, your question basically comes down to you wanting to do something and asking us to figure out how to do it for you.  And frankly, I'm far too lazy to do that.  In general, if your question requires us to find and download an App (or two) just to figure out what you're actually asking, it's unlikely that anyone will try to answer it. 


  6. It looks like you are doing something custom to differentiate your products.  The osC way would be for you to create attributes for the sizes.  Then there would be multiple product IDs.  E.g. product_info1.php?products_id=666{1} and product_info1.php?products_id=666{2}

    They would have the same base product ID, but the cart would show different extended ones.  The tep_get_prid function takes the long form and trims off the attributes to get the base ID.  The tep_get_uprid function adds the attributes to the base product ID to produce the long form. 

    Your shop is customized enough that I can't say concretely how you would have to do things differently.  But that's how things are intended to work in this situation.  Hopefully that at least gives you an idea of where to look in your modifications. 


  7. You could reduce (but not eliminate) the danger by removing the r from rm -rf

    find change_to_your_own_directory/ -type f -name '*.mx' -exec rm -f {} \; 

    The r stands for recursive and is what allows rm to delete directories.  Without it, rm will only delete files. Better might be to do something like

    find change_to_your_own_directory/ -type f -name '*.mx' -print
    find change_to_your_own_directory/ -type f -name '*.mx' -delete

    Where you check the files printed by the first line before running the second line. 

    Two possibilities that come to mind: 

    1.  This is caused by some IDE.  E.g. Dreamweaver MX.

    2.  This is a hack attempt of some sort. 

    Similar problem reported at https://stackoverflow.com/questions/61875526/mx-files-found-in-wordpress-core-files-with-the-same-core-code -- perhaps that will get a relevant answer. 


  8. In Phoenix, this would be based on MAX_DISPLAY_SEARCH_RESULTS which affects catalog and admin.  That's under admin > Configuration > Maximum Values

    To change to not use MAX_DISPLAY_SEARCH_RESULTS, you would edit admin/orders.php

                $orders_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_query_raw, $orders_query_numrows);

    I don't know if your version is the same or not.  But it might be worth checking. 


  9. 1 minute ago, plutomon said:

    By the way, I would like to keep on using the old store (osCommerce Online Merchant v2.3.3.4 ) while I'm configuring te new one. Will it work with PHP 7?

    No.  It's often better to start a new site for that migration.  So your 2.3.3.4 stays on 5.3 while you work on Phoenix on 7.  Some hosts can do that in subdirectories but most will prefer separate domains.  You might be able to use a subdomain like shop.mysite.com rather than www.mysite.com


  10. 18 minutes ago, plutomon said:

    Is this error related with the PHP version?

    Yes.  Phoenix requires PHP 7.  That particular line requires PHP 5.4 or newer. 

    If you go directly to www.mysite.com/myshop/install/index.php, you'll get a page that tells you that you need PHP 7. 


  11. You should not use Frozen if you are starting today. 

    Version 2.3.4.1 will not work with newer versions of PHP.  So if you use it, you should make sure that you stay on PHP 5 and not 7.  Your host may not like to continue running PHP 5. 

    Phoenix is current, responsive, and under active development.  It is the successor to Frozen.  I would recommend this over 2.3.4.1. 


  12. 29 minutes ago, LuckyPiedro said:

    What I don't understand is that because of this change, an extra check on "is_string ($ payment)", there is no PHP message anymore.

    The message says, "invalid offset".  A string is (by definition) a valid offset.  So what the message is telling you is that $payment is not a string (nor a  number).  With the check, it no longer gets to the point where it tries to use $payment as an array offset.  Because if it's not a string, PHP doesn't bother checking the rest of the expression.  This is called short circuit evaluation. 


  13. 5 minutes ago, dculley said:

    I did a fresh install to Phx 1.0.6.0.  I want to add this app back to the site.  Is it compatible with this version or do I need to wait?

    Wait.  He hasn't released his 1.0.6.0 compatible version yet. 

    This particular App is more impacted by the 1.0.5.1 changes than most and will require more than just a few tweaks at the edges. 


  14. SELECT o.*, op.*
     FROM orders o INNER JOIN orders_products op ON o.orders_id = op.orders_id
     WHERE op.products_id = 1

    Replace 1 with the correct product ID.  The product ID will be visible on the product page, e.g. product_info?products_id=1

    You'd put that query into phpMyAdmin (SQL tab) or similar.  Note that you might be better off taking the generated list and viewing the orders individually in your admin. 

    This is probably more work than Burt's solution, but it is also more likely to work.  So try his first and then if it doesn't do what you want, you can try this. 


  15. $check_query = tep_db_query("SELECT configuration_value FROM configuration WHERE configuration_key = 'MODULE_ORDER_TOTAL_TAXRATES_STATUS'"); 

    It needs to be lower cased and should be inside the quotes, not outside. 

×