Jump to content

bsmither

Member
  • Posts

    18,013
  • Joined

  • Last visited

  • Days Won

    605

Posts posted by bsmither

  1. "Opening each and every order, just to check if the matrix was populated isn't practical."

    Your personal experiments could not reproduce an item's purchase that had the wrong product code -- provided the options matrix's product code was available at the time the item was put in the basket.

    Therefore, we can assume that, from this point forward, an inventory item will always have such product codes entered before it is allowed to be purchased.

    I did find that in the CubeCart_order_summary table, 'basket' column, the value becomes stale fairly soon. That is, changes a customer makes to an order after a certain point does not change this value, but I'm not sure when this happens. And any admin edits to the order does not change this value. (Admin edits to an order apparently fetches and changes the respective rows in CubeCart_order_inventory.)

     

  2. Looking more closely at the email template for Cart: Order Confirmation and Admin: Order Received, I find that the HTML content does not contain a placeholder (aka, macro) for the Product Code, however, the Plain Text content does.

    When the admin prints an Order Summary (shipping list), there is a Product Code printed.

    So, as you assert, our best guess is that when that item was placed in the basket, the best Product Code available - in this case, for the base product - was used.

    My experiments show that opening the order for editing, Overview tab, check that the target line item has the desired product code. If not, try to simply Save & Reload.

    If the product code did not change, then on the Inventory tab, change the option shown to any other available option. Save & Reload. Change the changed option back to the original option. Save & Reload.

    Back on the Overview tab, verify that the target line item has the desired product code.

    (Then have CubeCart clear its internal cache.)

  3. There is mention of a backward incompatibility with PHP8 vs PHP7: "Attempting to read a property of a non-object." We can assume similar incompatibilities with respect to writing, as well as using the 'property accessor' operator to work with arrays.

    So, the following edits is an experiment that uses array index syntax:

    In the SagePay module, gateway.class.php file:

    Near lines 119 and 120, find:
    $resultArray[$i]->start = $start;
    $resultArray[$i]->token = $Tokens[$i];
    
    Change to:
    $resultArray[$i]['start'] = $start;
    $resultArray[$i]['token'] = $Tokens[$i];
    
    Near line 129, find:
    $valueStart = $resultArray[$i]->start + strlen($resultArray[$i]->token) + 1;
    
    Change to:
    $valueStart = $resultArray[$i]['start'] + strlen($resultArray[$i]['token']) + 1;
    
    Near line 132, find:
    $output[$resultArray[$i]->token] = substr($thisString, $valueStart);
    
    Change to:
    $output[$resultArray[$i]['token']] = substr($thisString, $valueStart);
    
    Near lines 134 and 135, find:
    $valueLength = $resultArray[$i+1]->start - $resultArray[$i]->start - strlen($resultArray[$i]->token) - 2;
    $output[$resultArray[$i]->token] = substr($thisString, $valueStart, $valueLength);
    
    Change to:
    $valueLength = $resultArray[$i+1]['start'] - $resultArray[$i]['start'] - strlen($resultArray[$i]['token']) - 2;
    $output[$resultArray[$i]['token']] = substr($thisString, $valueStart, $valueLength);

     

  4. You can fix the immediate need to have a custom Product Name as part of the order details. In admin, Orders, bring the order up for editing.

    On the Inventory tab, hover the mouse cursor over the product name and click once. There will then display a text entry field.

    Enter whatever you want -- a specific Product Code, a different Product Name, whatever. Save.

    However, as the Product Code is generally available to skin templates and email templates, I think the Product Name along with annotations of the chosen options is what is mostly used.

    Have you made changes to the email templates to show the Product Code?

     

  5. From what I see in the code of the /skin/admin/index.tpl file, the Save button will appear if and only if the PayPal Commerce module is currently, successfully "connected" to PayPal.

    From another conversation by you, it seems getting "connected" is a problem.

    So, I would say that once the PayPal Commerce module gets "connected", then the Save button will appear.

     

  6. If the "Busy" icon (called a 'throbber') appears and won't go away (there is a default timeout for ajax requests), it might be the case where javascript has crashed.

    To see if this has happened, your browser will have a Developer's Tools feature. In these tools is a panel named "Console". The Console will list problems with CSS, page resource requests, coding problems with javascript, etc.

    Is there anything relevant listed in the Console tab of the Developer's Tools feature of your browser? (F12 is usually a keyboard shortcut to get to the tools.)

     

  7. The "Allowed Zones" screen is found when working with an extension (shipping, gateway, plugin, etc). It is the Allowed Zones tab.

    This "Allowed Zones" tab/screen is a standard tab found in almost all extensions.

    When viewing this screen, what is the last part of the web address showing in the browser's Address Bar? It will look like:

    ?_g=plugins&type=shipping&module=Free_Shipping

     

  8. A few conditions must exist: the person viewing (does not need to be logged in as a customer) the storefront must not be logged in as an admin (using the same browser which then shares a session cookie), the "Hide-out-of-stock" general setting must be checked, the product must have the "Use Stock Level" checked and have a stock level of zero, and possibly "Allow out-of-stock purchases" general setting must be unchecked.

    Then have CubeCart clear its internal cache.

    From what version of CubeCart did you upgrade from, where the Hide out-of-stock setting worked last?

  9. Yes.

    Perhaps the data for these products was brought in via a CSV import? (I am still tracing the code to discern where there could be a missing check for proper formatting of an image's filepath when adding images in admin's Images screens.)

    If the database table is shown sorted by 'filename', are there pairs of rows for the same image?

  10. Of the four images, half have a URL of /images/cache/products/ and the other half have a URL of /images/cache//products/. Note the double-slash.

    This list is assigned to the template array variable $GALLERY in the core code.

    I am not yet sure how to fix this. Using an external database utility (phpMyAdmin in the control panel of your hosting account, for example), look in CubeCart_filemanager. You may find rows where the values in the 'path' column have a leading slash. A leading slash is not proper.

    I do not (yet) know if a folder with a leading slash will show in the admin's Add/Edit Product, Images tab file-picker.

  11. For step D, be sure that the updated plugins (that needs the ionCube that works with PHP 7.4) are not enabled. Otherwise, there is still the situation of an ionCube-encoded plugin wanting a later version of ionCube that is not running under PHP 5.6.

    Otherwise, the above is the sequence of steps I would suggest.

     

    • Like 1
  12. So, where is the stale stock level appearing on your site? Could this be a detail provided by a plugin or code snippet?

     

    Could the observed product, where the stock level seems to be stale, have options that are managed in the Options Matrix Table?

    If so, then the code that calls getProductStock() could be passing a parameter that says '$return_max = true'. If this is happening, then the stock level of the specific option combination that has the greatest stock level is what is going to be displayed.

    Please also let us know what the setting is for admin, Store Settings, Stock tab, "Main stock level as matrix stock level summary".

  13. While in admin, CubeCart does not use the cache. So, every detail is 'fresh'.

    Since the inventory stock level is correct (results of a fresh query), we must look at the storefront code to see if the stock level detail is coming from a fresh query or from the cache.

    There is a function in the catalogue.class.php file, getProductStock(). Here, there are two database queries:

    Somewhere in line 1394:
    $GLOBALS['db']->select('CubeCart_option_matrix', $rows, $where, false, 1, false, false)
    Somewhere in line 1405:
    $GLOBALS['db']->select('CubeCart_inventory', array('stock_level'), array('product_id' => (int)$product_id), false, 1, false, false)

    The last false of these statements tells the select() function to not use the cache -- always get results from a fresh database query.

    So, where is the stale stock level appearing on your site? Could this be a detail provided by a plugin or code snippet?

  14. Your site says, "All prices listed on this website exclude GST." So, does that mean that the "+ GST" is somehow manually added to the price? That is to say, is "+ GST" is an edit to the skin template -- to hint that there will be GST eventually added to the price shown at checkout?

    If this is an edit to the template, then examine the template code file element.product.call_to_action.php:

    Near line 17, find:
    
    <span class="sale_price" id="ptp"{if !$CTRL_HIDE_PRICES} data-price="{$PRODUCT.price_to_pay}"{/if}>{$PRODUCT.sale_price} + GST</span>
    
    Change to:
    
    <span class="sale_price" id="ptp"{if !$CTRL_HIDE_PRICES} data-price="{$PRODUCT.price_to_pay}"{/if}>{$PRODUCT.sale_price}</span> + GST
    
    Near line 20, find:
    
    <span id="ptp"{if !$CTRL_HIDE_PRICES} data-price="{$PRODUCT.price_to_pay}"{/if}>{$PRODUCT.price} + GST</span>
    
    Change to:
    
    <span id="ptp"{if !$CTRL_HIDE_PRICES} data-price="{$PRODUCT.price_to_pay}"{/if}>{$PRODUCT.price}</span> + GST

     

  15. Try to get back to PHP 5.6. Hopefully, you can resume store operations.

    If not, please add this statement, as the next-to-last line, to the /includes/global.inc.php file:

    $glob['safe_mode'] = true;

    This will have CubeCart not load any plugins. Doing this is based on the assumption that perhaps there is an installed plugin that requires the ionCube extension to PHP. That extension may still be a PHP 5.6 version.

    Additionally, plugins that use ionCube are coded against a specific version of the ionCube extension. So, even if the installed version of the ionCube extension is for PHP 7.1, the plugin also requires a new 'build' against that specific version of the ionCube extension.

    Please determine if there are any plugins by Noodleman or Havenswift that are installed on your site. If so, request updated versions of those plugins for PHP 7.4 (and switch to PHP 7.4 for your site).

    • Like 1
  16. I will assume that the Basix skin has the feature whereby, when the page gets loaded into the browser, a javascript routine is executed that makes a specific request (via ajax) for the current calculated price of the product. That price is the answer to a calculation that uses the product's base price, sale price, any alternate price based on the customer's "group" membership, quantity chosen (bulk pricing), and price differentials from options selected.

    The data sent back from that ajax request seems to not include any formatting or content other than having added the currency symbol (and any locale-specific characters).

    Research will need to be made.

  17. Resolving the 'deprecation' errors is an ongoing effort. Many issues were resolved in CC647 with many more resolved in the upcoming CC648.

    Please know that even if a statement throws a 'deprecated' error message, the statement still executes its functionality just as it did in PHP7.4.

    To quiet the reporting of these messages, disable CubeCart's Debug mode (admin, Store Settings, Advanced tab).

     

×
×
  • Create New...