Jump to content

bsmither

Member
  • Posts

    18,014
  • Joined

  • Last visited

  • Days Won

    605

Posts posted by bsmither

  1. Line 188 wants to iterate through a collection of $webhooks. That collection comes from a request being made to PayPal for a list of available webhooks.

    That request should be logged in CubeCart's admin, Request Log.

    Please examine the Request Log, find the appropriate logged Request/Response entries, and determine if the Response indicates what could be wrong.

  2. The basic way to force customers to log in is in admin, Store Settings, Features tab, Misc section, "Hide prices until logged in". That, however, does not force the customer to create an entry in their addressbook.

    But, there is also a setting (same section) "Allow physical orders even if no shipping options are available" that should be un-checked. That should stop CubeCart from offering any method of shipping until CubeCart has been informed of a shipping address to use.

     

     

  3. Unfortunately, a 302 redirect may cause the loss of any POST payload (such as submitting a form).

    CubeCart will issue a 302 redirect to the browser when finishing the 'set_language' command. CubeCart, again, will issue a 302 redirect when finishing the 'set_language' command. As these commands are part of the <iframe> src attribute, I fear that nothing will ever work right (but I haven't tested this theory).

    Then there is the issue of redirects in an iframe. From my initial internet search, modern browsers may have become very strict on how that happens.

    I would think that the browser's Developer Tools, Network screen and Console screen would give some clues as to what may be broken.

     

  4. Try this:

    https://www.mystore.com/index.php?_g=remote&type=gateway&cmd=form&module=Square

    This will have Square's callback be to the Square module, but run the form() function.

    The form() function looks for the presence of the 'nonce' value in Square's callback POST payload, and if found, will pass program execution to the process($nonce) function.

    This is where we want to be when at the next to the last step in making payment.

    The last step, if there are no errors, is to send the customer to CubeCart's 'Payment Complete' page.

  5. In the Square Dev Dashboard, the Redirect URL is referencing the OAUTH section? Is this correct?

    I am also seeing code in the Square javascript that is powering the card entry form that generates a "card_nonce' value. Square sends this value back, but there is no code in CubeCart's core code that will pass it to the Square module's Gateway->process($nonce) function.

    So, even if the following URL is what is needed, without catching that code, Square may still complain about something.

    https://www.mystore.com/index.php?_g=remote&type=gateway&cmd=process&module=Square

     

  6. Not that I have a solution, but the info I read simply asserted that a setting in your merchant settings at Square - the 'redirect URL - needed to match what the payment module was sending.

    I don't know what the payment module is sending, but it should be more than just your basic web address -- which might be all that your merchant settings screen at Square has.

    Can you verify that your "Dashboard"(?) at Square has what might look like a complete URL that includes your Client ID, some other stuff, and a reference to the redirect URL?

     

     

  7. It should, however it hasen't been updated since 2017.

    Which only means that, since it is encoded with ionCube, the encoded files must have been built with a matching version of the encoder for the version of PHP it is running under.

    Even though the current encoded files are built for "PHP 5.6 and above", this does not mean they will work on any version of PHP7 - which your hosting provider has likely configured your hosted account to use.

    The publisher, @Noodleman, will need to build encoded files for PHP 7.

     

    • Like 1
  8. From what I see in the Basix template content.checkout.php:

    There is this:
    	<h2 class="content-title">{$LANG.checkout.your_basket} <a href="{$STORE_URL}/index.php?_a=basket&empty-basket=true" class="pull-right"><i class="fas fa-trash"></i> <span class="hidden-xs">{$LANG.basket.basket_empty}</span></a></h2>
    
    	{foreach from=$ITEMS key=hash item=item}
    
    Change to:
    
    	<h2 class="content-title">{$LANG.checkout.your_basket} <a href="{$STORE_URL}/index.php?_a=basket&empty-basket=true" class="pull-right"><i class="fas fa-trash"></i> <span class="hidden-xs">{$LANG.basket.basket_empty}</span></a></h2>
    	<h3>If you ordered a downloadable product, the link to it will be emailed to you within a few minutes. Check your INBOX and also SPAM/JUNK folder.</h3>
    	{foreach from=$ITEMS key=hash item=item}

    The two {include file} statements are not part of the original Basix template code.

  9. We believe the GitHub issues #2756 and #2772 explains this. Whether it has been fixed? Maybe, maybe not.

    Along with CC642(?) came a feature that tossed up a notice to remind the admin that clearing the cache is necessary. This notice will appear until the admin has logged in (as of the upgrade) three times. This notice gets logged which interferes with certain other database operations.

    As an experiment, log in to admin, then log out. Do this three more times. Then log in and see how management of the search engine friendly paths for categories behaves.

  10. We can use a Code Snippet for this. In admin, Manage Hooks, Code Snippets tab, click Add Snippet.

    At the bottom of the list of existing snippets will be a form:

    Enabled: checked
    Unique ID: recentsold@CC600+
    Execution Order: 99
    Description: Populates a custom template with most recently sold items.
    Trigger: class.gui.display
    Version: 1.0
    Author: https://forums.cubecart.com/topic/57577-last-items-sold/
    PHP Code:
    <?php
    function __displayRecentlySoldProducts($count)
    {
      if (!$GLOBALS['smarty']->templateExists('templates/box.recent.php')) {
        return false;
      }
    
      if (($recentProductsSold = $GLOBALS['db']->select('CubeCart_order_inventory', array('DISTINCT'=>'product_id','product_code','name'), array('product_id' => ">0"), array('id' => "DESC"), $count, false, false)) !== false) {
        $vars = array();
        $GLOBALS['language']->addStrings(array('catalogue' => array('title_recent' => "Recently Sold")));
        // Need to manually assign the newly modified language array to Smarty's LANG variable
        $GLOBALS['language']->assignLang();
        foreach ($recentProductsSold as $recent) {
          $recent['url'] = $GLOBALS['seo']->buildURL('prod', $recent['product_id'], '&', false);
          $vars[] = $recent;
        }
        $GLOBALS['smarty']->assign('RECENT', $vars);
        $content = $GLOBALS['smarty']->fetch('templates/box.popular.php');
        $GLOBALS['smarty']->assign('RECENTLY_SOLD_PRODUCTS', $content);
      }
    }
    __displayRecentlySoldProducts(5); // Show 5 recently sold items.

    Save the snippet.

    Now, there needs to be a template file to show the products. We will basically copy the Best Sellers (Popular Products) template.

    In the Foundation skin template directory,
    create a new file with the name:
    box.recent.php
    
    Have as its contents:
    
    {*
     * CubeCart v6
     * ========================================
     * CubeCart is a registered trade mark of CubeCart Limited
     * Copyright CubeCart Limited 2017. All rights reserved.
     * UK Private Limited Company No. 5323904
     * ========================================
     * Web:   http://www.cubecart.com
     * Email:  [email protected]
     * License:  GPL-3.0 https://www.gnu.org/licenses/quick-guide-gplv3.html
     *}
    {if $RECENT}
    <div class="panel" id="box-recent">
      <h3>{$LANG.catalogue.title_recent}</h3>
      <ol>
        {foreach from=$RECENT item=product}
        <li><a href="{$product.url}" title="{$product.name}">{$product.name}</a></li>
        {/foreach}
      </ol>
    </div>
    {/if}

    Finally, there needs to be an edit that places this box on the main page.

    In the existing template:
    main.php
    
    Find:
    {include file='templates/box.featured.php'}
    {include file='templates/box.popular.php'}
    
    Add after (or before, or in-between)
    {include file='templates/box.recent.php'}

     

  11. In a stock install of CC6, the list of images to play in the slider is part of the HomePage document.

    In admin, Documents, click the Edit icon of the document shown as having the HomePage button selected.

    You may have an easier time of it by using the editor's Source mode.

    The slider is optimized to show 1000x300 pixel images.

     

    • Thanks 1
  12. That would be in the AIOS module's control panel. On the admin Navigation pane, click the Manage Extensions. From the list of extensions shown, click the Edit icon for All in One Shipping.

    On the module's administration control panel, General tab, Debugging, select "Debug Enabled (Verbose)".

     

    • Thanks 1
  13. The wording of the OP suggests that the web page's <meta description> is to contain some sort of the product's review data.

    The image of Google's console, SERP Snippet tab, suggests all data has been manually entered (but, really, I have no knowledge of this console and cannot conclude this 100%).

    We can use the Smarty code found in the template element.product.review_score.php template modified to fit the constraints of statements in the <head> section of the HTML document found in the template element.meta.php.

    <meta name="description" content="{if isset($META_DESCRIPTION)}{$META_DESCRIPTION}{/if} {if $SECTION_NAME eq 'product'}{for $i = 1; $i <= 5; $i++}{if $PRODUCT.review_score gte $i}&starf;{elseif $PRODUCT.review_score gt ($i - 1) && $PRODUCT.review_score lt $i}&#11240;{else}&star;{/if}{/for}{/if}">

    We first make sure that a View Product page is showing. Then we use the logic to show full stars or empty stars, or a half-star for the product's review average rating.

    It would be impractical to specify generic images in the <head> section (even though a product thumbnail image is specified for FBOG). So, we use HTML Entities. See:

    https://www.htmlsymbols.xyz/star-symbols

    There is a means to use a HEX code for the half-star, but having the browser render that character will likely fail as there is no entity name for a half-star. Nor are there any full/open pairs of other common characters with an entity name that also has a half-full variant.

    There might be (or was) an extension to collect testimonials concerning a store, but otherwise, each product can have multiple reviews, each with its own rating.

     Which actual review content is to be shown?

  14. A solution to the Github issue #2606 "Can't Complete Payment of a Pending Order" is being tested.

    It works for me, but I need others to try and break it.

    The scenario is this:

    • The store is set to decrement stock when the order moves to the Pending state.
    • The customer has not already made any attempt at making payment.
    • The customer understands that the order is now fixed - it cannot be changed.
    • The admin understands that the one-of-a-kind item is in the customer's basket - out of stock for all others.

    The problem has been that when CubeCart, at checkout, verifies the contents of a basket, stock levels are checked, and now determining that the item is out of stock, removes it from the basket.

    This solution is to deny CubeCart from verifying the basket, based on certain conditions ('finalizing' a checkout). Nor allowing the basket contents to be changed.

    The process starts at the customer's Order History. Eligible orders have a button "Complete Payment" which takes then straight to checkout.

    Note:  choosing a payment gateway at checkout (such as POF) makes the order ineligible for "Complete Payment".

    Note: This may also provide a means for an administratively-created customized order to allow the customer to Complete Payment", but I have not tried this as yet.

    The attachment is a compressed text file containing the necessary code changes.

     

    PaymentPendingOrder.zip

  15. I would say it is not the POF module contributing to this.

    Rather, the 'verification code' is CubeCart complaining that the reCaptcha gadget is not agreeing with the solution provided. It might not be displaying when it should be, or the customer worked out the puzzle, but the solution is not correct.

    Please verify that, in admin, Store Settings, Features tab, Bot Protection section, the reCaptcha is enabled as desired.

    Then, assure yourself that your browser is not blocking the javascript needed to fetch the reCaptcha gadget from Google.

     

    • Thanks 1
  16. Please try these edits:

    In the POF gateway.class.php, find near line 178:
    
    			if ($this->_module['bank']) {
    				$GLOBALS['smarty']->assign('BANK', true);
    			}
    
    Add after:
    
    $ga_id = $GLOBALS['config']->get('config', 'google_analytics');
    $ga_id = trim($ga_id);
    $GLOBALS['smarty']->assign('ANALYTICS', !empty($ga_id) ? $ga_id : false);
    
    
    Then in POF /skin/print.tpl, find near line 144:
    
      <div id="thanks">{$LANG.common.thanks}</div>
      <div id="footer">
    	{$LANG.gateway.postal_address}: {$STORE.address}, {$STORE.county}, {$STORE.postcode} {$STORE.country}<br />
    	{$STORE.name}, {$STORE.url}
      </div>
    
    </div>
    
    Add after:
    
    {if isset($smarty.cookies.accept_cookies) && $smarty.cookies.accept_cookies=='true' && $ANALYTICS && $SUM}
    <script>
    {literal}(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
      ga('create', '{/literal}{$ANALYTICS}{literal}', 'auto');
      ga('require', 'ecommerce');
      ga('ecommerce:addTransaction', {
        'id': '{/literal}{$SUM.cart_order_id}{literal}',
        'affiliation': '{/literal}{$SUM.store_name}{literal}',
        'revenue': '{/literal}{$SUM.total}{literal}',
        'shipping': '{/literal}{$SUM.shipping}{literal}',
        'tax': '{/literal}{$SUM.total_tax}{literal}'
      });
    {/literal}{foreach from=$ITEMS item=item}{literal}ga('ecommerce:addItem', {
        'id': '{/literal}{$SUM.cart_order_id}{literal}',
        'name': '{/literal}{$item.name}{literal}',
        'sku': '{/literal}{$item.product_code}{literal}',
        'price': '{/literal}{$item.price}{literal}',
        'quantity': '{/literal}{$item.quantity}{literal}'
      });{/literal}{/foreach}{literal}  ga('ecommerce:send');{/literal}
    </script>
    {/if}

    Please understand, there is no means for me to test if this actually works. But the code is present in the page that appears.

    Also note that the customer must have a cookie named 'accept_cookies' with a value of true.

  17. I see it this way, and I could be wrong:

    The GA code is actually javascript that gets executed on the customer's browser. That javascript accompanies most page views, but I think the most important one is Cubecart's "Thank you, your order is complete" page. That is, I do not recall CubeCart, or any of its gateway modules, informing Google directly about transaction status. (If there is a gateway module that does this, I would like to know.)

    Thus, indirectly, when CubeCart moves an order to Processing, the "Thank you" page gets sent and the customer's browser runs the GA code.

    The POF module does not have CubeCart move the order past Pending (as payment has not been made).

    And, when the admin does change the order's status to Processing, there is no corresponding code to inform Google about the change in the order's transaction status.

    I think a separate plugin/snippet would need to be written to send a message to Google should it be the case that the admin is required to move the order beyond pending.

    "it would be an important metric if anything to verify that a customer completed an online checkout."

    That's the thing, a POF transaction is not where a customer can complete an online checkout.

×
×
  • Create New...