Jump to content

eduardj

Member
  • Posts

    10
  • Joined

  • Last visited

Posts posted by eduardj

  1. 21 minutes ago, bsmither said:

    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 'array 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);

     

    Thanks a lot, I've just run those changes and it works as a charm !

  2. Hi,

    Problem is that cubecart is using gtag to send info for ecommerce data and only info are sent from order complete page :

    {if isset($smarty.cookies.accept_cookies) && $smarty.cookies.accept_cookies=='true' && $ANALYTICS && $GA_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}{$GA_SUM.cart_order_id}{literal}',
        'affiliation': '{/literal}{$GA_SUM.store_name}{literal}',
        'revenue': '{/literal}{$GA_SUM.total}{literal}',
        'shipping': '{/literal}{$GA_SUM.shipping}{literal}',
        'tax': '{/literal}{$GA_SUM.total_tax}{literal}'
      });
    {/literal}{foreach from=$GA_ITEMS item=item}{literal}ga('ecommerce:addItem', {
        'id': '{/literal}{$GA_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}',
        'category': '{/literal}{$ITEM_CATS.{$item.product_id}}{literal}'
      });{/literal}{/foreach}{literal}  ga('ecommerce:send');{/literal}
    </script>

    , universal analytics will be discontinued by end of the year and new GA4 will take place, now in order to capture any data for it, is to set up datalayers which need to be coded to website by dev and set up via GTM. I have asked if anyone had done this already. 

    For user flow etc. : item view, add to cart, checkout started, purchased. 

    it would be great if someone has already implemented this or if cubecart devs are planning to add this into code in a future.

     

    On 7/14/2021 at 1:55 AM, [email protected] said:

    Hi,

    I am trying to configure Google Analytics for my site.  I've put in the Analytics ID number in the Store administrator settings some time ago, but it has never worked - nothing appears on the google console.   I haven't however put in any tracking code as I wasn't sure where to put it.  I see that it is supposed to go in the head section of every page.  I've searched the forum and others have said put it in main.php - however which one?   I have tried putting it in as the first entry under my templates/foundation main.php and all it does is prevent from the page from loading.

    Is someone able to assist as to correctly setup analytics for ALL of the pages on the website please?

    thanks in advance.  This is the code I need to put in:

    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-11031594-1"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'UA-11031594-1');
    </script>
     

    add red highlighted to your code, replace all within the file in templates/element.google_analytics.php

    {if isset($smarty.cookies.accept_cookies) && $smarty.cookies.accept_cookies=='true'}
    <!-- Global site tag (gtag.js) - Google Analytics -->

    {literal}
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-11031594-1"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'UA-11031594-1');
    </script>
    {/literal}
    {/if}

  3. On 15/08/2017 at 5:29 AM, bsmither said:

    I see three edits for the Foundation skin:
    1. content.checkout.confirm.php
    2. 3.cubecart.validate.js
    3. /classes/cubecart.class.php

    
    content.checkout.confirm.php
    
    Find:
    <div class="small-12 large-8 columns"><label for="user_phone" class="show-for-medium-up">{$LANG.address.phone}</label><input type="text" name="user[phone]" id="user_phone" required value="{$USER.phone}" placeholder="{$LANG.address.phone}  {$LANG.form.required}" autocomplete="tel"></div>
    
    Change to:
    <div class="small-12 large-8 columns"><label for="user_phone" class="show-for-medium-up">{$LANG.address.phone}</label><input type="text" name="user[phone]" id="user_phone" value="{$USER.phone}" placeholder="{$LANG.address.phone}" autocomplete="tel"></div>
    
    Find:
          <div class="row">
             <div class="small-12 large-8 columns"><label for="state-list" class="show-for-medium-up">{$LANG.address.state}</label><input type="text" name="billing[state]" id="state-list"  required value="{$BILLING.state}" autocomplete="address-line1"></div>
          </div>
    
    Change to:
    {*
          <div class="row">
             <div class="small-12 large-8 columns"><label for="state-list" class="show-for-medium-up">{$LANG.address.state}</label><input type="text" name="billing[state]" id="state-list"  required value="{$BILLING.state}" autocomplete="address-line1"></div>
          </div>
    *}
    
    Find:
          <div class="row">
             <div class="small-12 large-8 columns"><label for="delivery_state" class="show-for-medium-up">{$LANG.address.state}</label><input type="text" name="delivery[state]" id="delivery_state"  required value="{$DELIVERY.state}" placeholder="{$LANG.address.state} {$LANG.form.required}" autocomplete="address-level1"></div>
          </div>
       </address>
    </div>
    {/if}
    <script type="text/javascript">
       var county_list = {$STATE_JSON};
    </script>
    
    Change to:
    {*
          <div class="row">
             <div class="small-12 large-8 columns"><label for="delivery_state" class="show-for-medium-up">{$LANG.address.state}</label><input type="text" name="delivery[state]" id="delivery_state"  required value="{$DELIVERY.state}" placeholder="{$LANG.address.state} {$LANG.form.required}" autocomplete="address-level1"></div>
          </div>
    *}
       </address>
    </div>
    {/if}
    {*
    <script type="text/javascript">
       var county_list = {$STATE_JSON};
    </script>
    *}
    
    3.cubecart.validate.js
    
    Find:
                'billing[state]': {
                    required: true
                },
    
    Change to:
    /*
                'billing[state]': {
                    required: true
                },
    */
    
    Find:
                'delivery[state]': {
                    required: true
                },
    
    Change to:
    /*
                'delivery[state]': {
                    required: true
                },
    */
    
    cubecart.class.php, near line 947:
    
    From:
    $required_address_fields = array('first_name','last_name','line1','town','country','state','postcode');
    
    To:
    $required_address_fields = array('first_name','last_name','line1','town','country',/*'state',*/'postcode');

    This is for that case where the customer has not logged in, and is checking out. CubeCart may use the store's address as a temporary billing and delivery address until the customer provides their own. Thus, after entering this info in the "Profile" (Customer Details) section of the checkout screens, the customer may be given this screen again with a note that details have been updated and shipping charges may have changed - if appropriate.

    These changes may also cover the case where the customer is logged in. I haven't tried that.

    And there is the situation where the Addressbook may also demand a State/County. We can work on that if you get stuck.

     

    Hi,

    I've updated to 6.1.12, have made all changes to the files above to disable county. it was working fine with 6.1.10 with those changes. I'm using paypal express checkout and I'm based in UK there are many customers having account set without county now ( this issue has been raised many times here on forums), before I start, called up paypal to make sure that the billing address is set on my paypal account as advised in braintree mod and it is. Tested the express checkout ( via braintree or paypal pro) and I'm always getting an error message asking for a state when transfered back to website from paypal confirmation page.

  4. On 17/11/2017 at 11:02 PM, bsmither said:

    You say there is a log entry for Order Confirmation #2017-(whatever) sent to the customer's email address.

    But the customer has not received it.

    Any chance this email is in the customer's spam folder?

    In your hosting account's control panel (Cpanel?), do you have the tool (Track Delivery) that will allow you to test sending an email to the customer's address?

    Yes, in log entry for emails sent I have that confirmed, I have cleared cashe and made some changes now I need to wait if I get any more complains from customers not receiving email confirmations.

    Thanks for trying to help out.

  5. 18 minutes ago, bsmither said:

    Please know that the customer does not get an mail when the order goes to Pending. The only exception is when your store is using the Printed Order Form (POF) and that the POF is set to send a courtesy reminder email.

     

    i as admin get an email that there is pending order set in "CC settings", also paymet confirmation, as customer I didn't get email your order is processing + when changed status in admin site as "complete" no email sent as confirmation.

  6. Hi,

    I had exactly same issue upgrading from older versions with error log same as in 1st post, so I've done following :

    Changed admin_XXX folder and admin_XXX.php in root to admin and admin.php, than changed includes/inc.global.php file to match both. Basically removed the seciruty on both file and admin folder. Upgrade via admin page went through smouthly without any issue and have new admin folder and admin file secured after upgrade.

    Hope this might help.

×
×
  • Create New...