Jump to content

bsmither

Member
  • Posts

    18,013
  • Joined

  • Last visited

  • Days Won

    605

Posts posted by bsmither

  1. To review:

    Line 1574 of cubecart.class.php uses sprintf with a 'template' (Language phrase contact['email_content']) requiring no less and no more than four parameters to fill specifier spots in the template.

    The language phrase is found in the definitions.xml file.

    Both files will get overwritten in an upgrade. As such, making edits to either file will disappear.

    The language phrase can be changed in admin, Languages, of which any changes will be databased to survive upgrades.

    Perhaps you made it so that a fifth parameter will fill a new fifth specifier slot in the language phrase.

    Unfortunately, in stock code, the sprintf function that uses that phrase is still only supplying four parameters.

    If you have more specifiers than parameters to match them, sprintf returns NOTHING. Thus, the mailer will have no "body" and will probably not even attempt to send an email.

    Fortunately, there is a hook at line 1575 we can use to add new data. The hook code will find and replace a special sequence in the language string with the new data.

  2. The package of files that has been offered to replace a few existing troublesome files did have a change in the one file (ini.inc.php) that declares the version (now 6.4.9). Replacing these troublesome files does not require that setup be run again.

    This package contains no changes to be made to the database or the database contents.

    Hence, normally, setup makes an entry in the database table CubeCart_history with the version "processed" and the timestamp when it happened. But simply replacing these troublesome files did not also make the appropriate entry in the CubeCart_history table.

    Using an external database utility, view CubeCart_history and change the value "6.4.8" to "6.4.9".

     

    • Thanks 1
  3. This is line 2154 in catalogue.class.php - which is new to CC648:

    $image['image_tags'] = $GLOBALS['catalogue']->image_tags[$image[$type]];

    This, "/images/source/RG_Design.jpg", is a valid array key. But does PHP know about the array image_tags already having an element with the key "/images/source/RG_Design.jpg"?

    No. Hence, "Undefined array key".

    This (large number of) errors getting logged is an annoyance. It does not affect the overall operation of CubeCart.

    I will look for where the public $image_tags array is supposed to be filled in.

  4. That is an "Exception', and if I recall, if not "caught" and dealt with, will cause PHP to quit.

    In these forums, News and Announcements, the conversation at:

    https://forums.cubecart.com/topic/58189-cubecart-649-released/#comment-253015

    offers a set of changed files to fix some late discovered issues - the var_dump() issue being one of them.

    Is this image present, or moved?

    /images/source/RG_Design.jpg

  5. Depends what the demographic of this store is serving. If EU/UK (and maybe California USA), there may be legal requirements regarding GDPR and being able to prove that the visitor agreed to having cookies be used.

    If you feel that this store really is immune to such requirements, then sure, you can occasionally TRUNCATE the table.

    (CubeCart programmers are working on a CRON API. This may be an eligible task for a semi-annual cron-job.)

     

  6. Regarding the sample page mentioned earlier - I don't see that implementation as an iframe. From what I see, it's a javascript-powered enhancement wrapper around a standard HTML 5 <audio> tag.

    See:

    https://www.w3schools.com/html/html5_audio.asp

    CubeCart, being a general-purpose, but (thankfully) not full of bloat, ecommerce solution, thus relies on specific-purpose features to be implemented by the store owner.

    Which, actually, from my point of view, streamable purchased downloads is outside this general-purpose arena. So, maybe it was implemented to fit the paradigm of mobile devices? Just my uninformed opinion.

  7. I am aware of a Karaoke store that uses MediaElement:

    http://www.mediaelementjs.com/

    Sample page (uses Blueprint skin - no longer available in CubeCart's Marketplace):

    https://www.regionalkaraoke.com/semi-vocal/with-male-vocal/abhi-toh-party-shuru-hui-hai-with-male-vocals-mp3.html

    It is my opinion that the main.stream.php template is too substantial to be used to play demo snippets.

  8. The "console issues" doesn't give me any clues. What generated this report?

    This is interesting:

    Uncaught SyntaxError: Unexpected token '<' (at plugins.php?e6f57d9434a586cec092f0f665c214e2:1:1)

    The admin skin javascript file plugins.php is not really javascript, but a PHP script that collects all the javascript files in the /plugins/ sub-folder.

    So, using the Developer Tools, where you see that error message, part of it should be a link to the problem code as seen in the Debugger screen.

    The error message is referencing line 1, column 1, which should be actually nothing more than an 'end-of-line' character (showing a blank line for line 1).

    Using the Debugger screen, you should be able to view the 'javascript' file plugins.php?hash.

  9. I do not find anything specific to viewing the list of orders or add/edit a specific order that might cause the browser to show a "busy" indicator.

    Near the browser's address bar, where there is usually a circular arrow (reload), when receiving content from the server, that icon will probably be an 'X'. While the "busy" indicator is showing, press the 'X'. Does the busy indicator go away?

    Your browser's Developer Tools, Network tab will show what was taking so long to arrive.

  10. Please try this:

    In the admin file /sources/filemanager.index.inc.php:

    Near line 32, find:
    
    $select_button = false;
    if (isset($_GET['mode'])) {
        switch (strtolower($_GET['mode'])) {
    
    Add after:
    
    case 'fckfile':
    $GLOBALS['main']->hideNavigation(true);
    $select_button = true;

    In the admin skin template file filemanager.index.php:

    Near line 43, find:
    
          {if isset($FILES)}
          {foreach from=$FILES item=file}
          <div {if $FILMANAGER_MODE == '1'}class="fm-item {$FM_SIZE}{if $file.file_name_hash==$HILIGHTED_FILE} hilighted{/if}"{/if} id="{$file.file_name_hash}">
          {if $FILMANAGER_MODE == '1'}<a href="{$file.master_filepath}?{$file.random}" class="{$file.class} thumbnail" title="{$file.description}" target="_self"><img class="lazyload" data-src="{$file.filepath}" src="data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs="></a>{/if}
          <span class="actions">
             {if $FILMANAGER_MODE == '1'}<input type="checkbox" value="{$file.value}" class="multi_delete right" name="multi_delete[]"> {/if}{$file.filesize}
             {if $file.select_button}
             <a href="{$file.master_filepath}" class="select"><i class="fa fa-plus-circle" title="{$LANG.common.add}"></i></a>
             {else}
             <a href="{$file.delete}" class="delete right" title="{$LANG.notification.confirm_delete_file|replace:'%s':$file.filename}"><i class="fa fa-trash" title="{$LANG.common.delete}"></i></a>
             <a href="{$file.edit}" class="edit right" title="{$LANG.common.edit}"><i class="fa fa-pencil-square-o" title="{$LANG.common.edit}"></i></a>
             {/if}
          </span>
          {if $FILMANAGER_MODE == '2'}<input type="checkbox" value="{$file.value}" class="multi_delete" name="multi_delete[]"> <i class="fa fa-{$file.icon}" aria-hidden="true" alt="{$file.mimetype}"></i>{/if}
          <a href="{if $file.class}{$file.filepath}?{$file.random}{else}?_g=filemanager&download_file={$file.filepath|base64_encode}{/if}" class="{$file.class}" title="{$file.description}" target="_self">{$file.filename}</a>
          </div>
          {/foreach}
          {else}
          <p class="center clear">{$LANG.filemanager.file_none}</p>
          {/if}
    
    Change to:
    
    {if isset($FILES)}
      {foreach from=$FILES item=file}
          <div {if $FILMANAGER_MODE == '1'}class="fm-item {$FM_SIZE}{if $file.file_name_hash==$HILIGHTED_FILE} hilighted{/if}"{/if} id="{$file.file_name_hash}">
        {if $FILMANAGER_MODE == '1'}
             <a href="{$file.master_filepath}?{$file.random}" class="{$file.class} thumbnail" title="{$file.description}" target="_self">
                <img class="lazyload" data-src="{$file.filepath}" src="data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs=">
             </a>
             <span class="actions">
                <input type="checkbox" value="{$file.value}" class="multi_delete right" name="multi_delete[]">
                {$file.filesize}
          {if $file.select_button}
                <a href="{$file.master_filepath}" class="select"><i class="fa fa-plus-circle" title="{$LANG.common.add}"></i></a>
          {else}
                <a href="{$file.delete}" class="delete right" title="{$LANG.notification.confirm_delete_file|replace:'%s':$file.filename}"><i class="fa fa-trash" title="{$LANG.common.delete}"></i></a>
                <a href="{$file.edit}" class="edit right" title="{$LANG.common.edit}"><i class="fa fa-pencil-square-o" title="{$LANG.common.edit}"></i></a>
          {/if}
             </span>
        {/if}
        {if $FILMANAGER_MODE == '2'}
             <input type="checkbox" value="{$file.value}" class="multi_delete" name="multi_delete[]"> <i class="fa fa-{$file.icon}" aria-hidden="true" alt="{$file.mimetype}"></i>
          {if $file.select_button}
             <span class="actions">
             <a href="{$file.master_filepath}" class="select"><i class="fa fa-plus-circle" title="{$LANG.common.add}"></i></a>
             </span>
          {/if}
        {/if}
             <a href="{if $file.class}{$file.filepath}?{$file.random}{else}?_g=filemanager&download_file={$file.filepath|base64_encode}{/if}" class="{$file.class}" title="{$file.description}" target="_self">{$file.filename}</a>
          </div>
      {/foreach}
    {else}
          <p class="center clear">{$LANG.filemanager.file_none}</p>
    {/if}

    In the file /includes/ckeditor/config.js:

    Find:
    
    config.filebrowserBrowseUrl = document.location.pathname+'?_g=filemanager&mode=fck';
    
    Change to:
    
    config.filebrowserImageBrowseUrl = document.location.pathname+'?_g=filemanager&mode=fck';
    config.filebrowserLinkBrowseUrl = document.location.pathname+'?_g=filemanager&mode=fckfile';

    This will bring up a list of files in CubeCart's /files/ folder, the same folder that CubeCart uses to store all the files that are tied to digital-type products -- the downloadable digital products. This folder and all sub-folders (save one) are restricted against direct access by way of a directive in the .htaccess file in /files/. (This restriction provided by .htaccess is only effective if the web server finds and respects .htaccess files. For example, Apache does, but Nginx does not.)

    Within /files/, there is another folder /public/ that has its own .htaccess directive giving unrestricted access.

    So, be sure to link only to files found in this /public/ folder. Otherwise, the links to PDFs you put in Product Descriptiion won't get anything for visitors to your site.

    A Feature Request has been posted to the Github.

  11. An issue has been posted in the Github:

    https://github.com/cubecart/v6/issues/3096
    In /admin/sources/products.index.inc.php, near line 1030, find:
    
    $possible = false;
    
    Change to:
    
    $possible = array();
    
    Near line 1051, find:
    
    if (is_array($possible)) {
    
    Change to:
    
    if (!empty($possible) && is_array($possible)) {

    Or, if you have CubeCart's "debug mode" enabled, but do not really need it, turning off debug mode should stop the Deprecated notices getting logged.

  12. CubeCart, when the admin clicks the trash bin link to delete (most) anything, a javascript-powered alert is displayed asking for confirmation for the delete action. The alert phrase is the same for all such delete action.

    Regarding this custom capability to undo database changes, should a module's author take advantage of it, because there would be the requirement for specific data to be included in the module's config.xml file, it would fall on the module's author to make mention in the module's documentation that deleting this module will undo the database changes.

    As this custom capability stands, there is no method to have a choice in the matter, other than to to edit the config.xml file and delete the specific data related to undoing the customizations made to the database.

  13. An enhancement regarding Gift Cards allows:

    • the admin to assign a collection of images to the Gift Card system. One image is the default (master).
    • the admin to have a text editor to add more content to the Gift Card purchase page.
    • the customer to choose an image when purchasing a Gift Card.
    • for the additional content to appear on the Gift Card purchase page.

    At checkout, a small-sized image of the chosen image appears in the list of basket items.

    For a physical Gift Card, the card can be (pre)printed with the chosen image. For an emailed notice, the HTML content can now include a link to the image the customer chose.

    For example, the collection of images may include birthday, Mother's day, Winter holiday, Valentine's day, Thank You, and other themes.

    This enhancement is not a plugin. It involves hard code edits.

    • Like 1
  14. I see in the image that there is (I guess that's what this is) a browser tab named "henrytest (9).pdf" which has a "Network error" flag. (Might these tabs be instances of a PDF reader app???)

    If a browser tab, then when working with the browser hoping to get the next Network error, have the browser's Developer Tools open to the Network tab. There will be more info as to what the error message is that the web server is sending back.

    The "Deprecated" errors will be fixed in the next version of CubeCart. They are caused by PHP 8 being more strict in the treatment of variables.

  15. The term "Network Error" is too generic to pin-point what is (or is not) happening.

    What do you actually have in your browser window that purports to be a Network Error"? A 4XX or 5XX error response code from the web server? Any part of a page that looks like a CubeCart page?

    Try to find any and all error logs. If you are hosted by someone, that someone may be needed to assist you in examining error logs.

     

  16. If the Order: Confirmation email has already been sent - according to the response from a question made to the Gateway module - it won't be sent again. Also, emailing must be enabled for this order if and when the admin moves it to Processing.

    Otherwise, when the order goes to Processing - via a command from the Payment Gateway module when the module determines that the payment was successful - the Order Confirmation email will get sent.

  17. CubeCart does not send an email to the customer when an order gets set to Pending. (The admin can choose to be notified, however.) I understand that there are one or two Payment Gateways that will send a courtesy email.)

    Applicable to all-digital orders, iIn admin, Store Settings, Features tab, Misc section, "Force Order Completed Emails" can be unchecked and "Allow order "Processing" status to be skipped?" setting can be checked.

    Orders that have digital items to download will (should) continue to have the download link emails be sent when the order moves out of Pending (but not Gift Certificate notifications).

    In the admin skin file orders.index.php:

    Near line 139, find:
    <span><input type="hidden" name="skip_email" id="skip_email" class="toggle" value="0"></span>
    Change to:
    <span><input type="hidden" name="skip_email" id="skip_email" class="toggle" value="1" checked="checked"></span>

    Moving an order to Failed or Cancelled will still honor the "Do not send email" setting. That setting will now need to be unchecked to send those emails.

    The "Do not send email" setting also affects emails sent to the admin when changing the status.

    All other features and functions that send emails (Contact Us, Reviews to be approved, Password Recovery, whatever) will still be sent.

  18. This is what I have come up with.

    There is a Feature Request in the Github:

    https://github.com/cubecart/v6/issues/701

    The code to put in effect is:

    In the plugin's config.xml file, find:
    
    </installer>
    
    Just above that, add:
    
    	<database>
    		<!-- For deleting tables added by this plugin. -->
    		<!-- Put the name of the table in CDATA. -->
    <!--<table><![CDATA[Table Name]]></table>-->
    		<!-- For deleting columns added to tables not belonging to this plugin. -->
    		<!-- Specify the name of the table. Put the name of the column in CDATA. -->
    <!--<column table="Table Name"><![CDATA[Column Name]]></column>-->
    		<!-- For deleting indexes added to columns in tables not belonging to this plugin. -->
    		<!-- If type is PRIMARY, use PRIMARY as the name of the index. -->
    		<!-- Specify the name of the table. Put the name of the index in CDATA. -->
    <!--<index table="Table Name"><![CDATA[id]]></index>-->
    	</database>

    Repeat the <table>, <column>, and <index> nodes for each to be removed.

    Then,

    In /admin/sources/plugins.index.inc.php, find:
    
    if (isset($_GET['delete']) && $_GET['delete']==1 && !empty($_GET['type']) && !empty($_GET['module'])) {
        $dir = CC_ROOT_DIR.'/modules/'.$_GET['type'].'/'.$_GET['module'];
        if (file_exists($dir)) {
    
    Add after:
    
            // Read in module's config.xml file, if it exists.
            $module_xml = $dir."/config.xml";
            if (file_exists($module_xml)) {
                try {
                    $xml   = new SimpleXMLElement(file_get_contents($module_xml));
                } catch (Exception $e) {
                    trigger_error($e, E_USER_WARNING);
                }
                if (is_object($xml) && is_object($xml->database)) {
                    // Delete indexes from the database.
                    if (is_object($xml->database->index)) {
                      foreach ($xml->database->index as $delete_index) {
                        $delete_record = array(
                            'name' => (string)$delete_index,
                            'table' => (string)$delete_index->attributes()->table,
                        );
                        $GLOBALS['db']->misc("ALTER TABLE `".$GLOBALS['config']->get('config', 'dbprefix').$delete_record['table']."` DROP KEY IF EXISTS `".$delete_record['name']."`", false, true);
                        unset($delete_record);
                      }
                    }
                    // Delete columns from the database.
                    if (is_object($xml->database->column)) {
                      foreach ($xml->database->column as $delete_column) {
                        $delete_record = array(
                            'name' => (string)$delete_column,
                            'table' => (string)$delete_column->attributes()->table,
                        );
                        $GLOBALS['db']->misc("ALTER TABLE `".$GLOBALS['config']->get('config', 'dbprefix').$delete_record['table']."` DROP COLUMN IF EXISTS `".$delete_record['name']."`", false, true);
                        unset($delete_record);
                      }
                    }
                    // Delete tables from the database.
                    if (is_object($xml->database->table)) {
                      foreach ($xml->database->table as $delete_table) {
                        $delete_record = array(
                            'name' => (string)$delete_table,
                        );
                        $GLOBALS['db']->misc("DROP TABLE `".$GLOBALS['config']->get('config', 'dbprefix').$delete_record['name']."`", false, true);
                        unset($delete_record);
                      }
                    }
                }
            }

    Deleting a PRIMARY index is tricky. However, odds are low that a plugin will want to be adding a PRIMARY index to someone else's table.

    Deleting a plugin's table and columns in other tables will probably be all that is necessary.

×
×
  • Create New...