Jump to content

ChrisColeman

Member
  • Posts

    110
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by ChrisColeman

  1. Hi,

          A confession ..

    Even though there is an error as reported - That was not the cause of my problem.

    The skin I'm using does not use JQUERY, I'm not a fan.

    It has worked without issue for 5+ years.

    Anyway it turns out that paypal_commerce has a dependency on a jquery file being present in the currently active skin (??).

    So thats it I replaced a JQUERY file into my skin and it now works.

    Chris.

    ps. I have posted on GITHUB.

  2. Hi, 

        I just tried this again with with PayPal Commerce 1.6.2 and still no joy, therefore I downloaded the 1.6.2 code to get a better look ..

    And this  is what I found -

    /**
     * CubeCart v6
     * ========================================
     * CubeCart is a registered trade mark of CubeCart Limited
     * Copyright CubeCart Limited 2019. All rights reserved.
     * UK Private Limited Company No. 5323904
     * ========================================
     * Web:   http://www.cubecart.com
     * Email:  [email protected]
     * License:  GPL-3.0 http://opensource.org/licenses/GPL-3.0
     */
    function ppcp_body_js($tpl_output, Smarty_Internal_Template $template)
    {
        $skins = $GLOBALS['gui']->getSkinData()['info'];
       //  $skin = $GLOBALS['gui']->getSkinData();
      
        if (($pp_config = $GLOBALS['cache']->read('pp_config.'.$skins['name'])) === false) {
            if(file_exists('modules/plugins/paypal_commerce/config.custom.json')) {
                $pp_config = file_get_contents('modules/plugins/paypal_commerce/config.custom.json');
            } else if(file_exists('modules/plugins/paypal_commerce/config.'.$skins['name'].'.json')) {
                $pp_config = file_get_contents('modules/plugins/paypal_commerce/config.'.$skins['name'].'.json');
            } else {
                $pp_config = file_get_contents('modules/plugins/paypal_commerce/config.foundation.json');
            }
            $GLOBALS['cache']->write($pp_config, 'pp_config.'.$skins['name']);
        }
        if(isset($GLOBALS['cart']->basket['total']) && $GLOBALS['cart']->basket['total'] > 0) {
            $pp_amount = $GLOBALS['cart']->basket['total'];
        } else {
            $pp_amount = "null";
        }
    
        return preg_replace('/\<\/body\>/i','<script id="pp_config" type="application/json">'.$pp_config.'</script><script>
            var pp_config = JSON.parse(document.getElementById(\'pp_config\').textContent)
            var pp_amount = '.$pp_amount.';</script></body>', $tpl_output);
    
        return $tpl_output;
    }
    $GLOBALS['smarty']->registerFilter("output","ppcp_body_js");

    On about the third line of code you can see I have replaced a line. Now the thing is that this was never going to work the variable '$skin' is never referenced in the code so its clearly in error.

    The question is why did nobody else experience the same ?

    Its probably because, and this is just a guess, many other skins are strongly based upon the foundation skin, but as I say that's only a guess ..

    Anyway it seems to be working now but no production test yet..

    Chris.

     

     

    • Like 1
  3. Hi, I have regressed the sites in question to PayPal standard which works as it did and will do a bit of digging. 
     

    So must be using a different jquery - or non at all which would be better🍺
     

    On the subject, I don’t not if the send/receive loop is good - should it not anticipate an error or at least wait a while before resending the request. 
         I have some history with Stripe which is not entirely different and it is usual to await an acknowledgement before resending the request?

  4. I have several sites running the replacement PayPal Gateway ..

    However a few day ago I attempted to activated on a couple of additional sites and this morning received complaints that customers can no longer complete the checkout  process on those sites.

           In the browser log I see (see below), which repeats  (ad infinitum) -

    Any ideas ..

    Just noticed this error  -

    Quote

    Uncaught ReferenceError: $ is not defined
        <anonymous> https://www.countrycontrast.co.uk/index.php?_a=gateway:21

     

    Many Thanks.

    Chris.

     

     

    Quote

    Request Sent - https://api.paypal.com/v2/checkout/orders/
    {"intent":"CAPTURE","purchase_units":[{"reference_id":"623315d3e27dc","items":[{"name":"Bottomleys Mint Rock advert","unit_amount":{"value":"2","currency_code":"GBP"},"quantity":1,"sku":"SAS9","category":"PHYSICAL_GOODS"}],"amount":{"currency_code":"GBP","value":"6.00","breakdown":{"item_total":{"value":"2","currency_code":"GBP"},"shipping":{"value":"4","currency_code":"GBP"},"tax_total":{"value":"0","currency_code":"GBP"},"discount":{"value":"0","currency_code":"GBP"}}},"shipping":{"name":{"full_name":"Chris Coleman"},"email_address":"[email protected]","phone":"01432-354286","address":{"address_line_1":"12 Ran Street","admin_area_1":"","admin_area_2":"HEREFORD","postal_code":"HR40DT","country_code":"GB"}},"invoice_id":"220317-110348-8852","description":"Payment for order 220317-110348-8852"}],"application_context":{"shipping_preference":"SET_PROVIDED_ADDRESS","brand_name":"Small Wonders Miniatures","locale":"en-GB","user_action":"PAY_NOW"},"payer":{"name":{"given_name":"Chris","surname":"Coleman"},"address":{"address_line_1":"12 Ran Street","address_line_2":"","admin_area_1":"","admin_area_2":"HEREFORD","postal_code":"HR40DT","country_code":"GB"}}}
    Response received
    {"id":"7M9*********8961C","intent":"CAPTURE","status":"CREATED","purchase_units":[{"reference_id":"623315d3e27dc","amount":{"currency_code":"GBP","value":"6.00","breakdown":{"item_total":{"currency_code":"GBP","value":"2.00"},"shipping":{"currency_code":"GBP","value":"4.00"},"tax_total":{"currency_code":"GBP","value":"0.00"},"discount":{"currency_code":"GBP","value":"0.00"}}},"payee":{"email_address":"[email protected]","merchant_id":"YEJVG9VG87BGE"},"description":"Payment for order 220317-110348-8852","invoice_id":"220317-110348-8852","items":[{"name":"Bottomleys Mint Rock advert","unit_amount":{"currency_code":"GBP","value":"2.00"},"quantity":"1","sku":"SAS9","category":"PHYSICAL_GOODS"}],"shipping":{"name":{"full_name":"Chris Coleman"},"address":{"address_line_1":"12 Ran Street","admin_area_2":"HEREFORD","postal_code":"HR40DT","country_code":"GB"}}}],"payer":{"name":{"given_name":"Chris","surname":"Coleman"},"address":{"address_line_1":"12 Ran Street","admin_area_2":"HEREFORD","postal_code":"HR40DT","country_code":"GB"}},"create_time":"2022-03-17T11:35:24Z","links":[{"href":"https://api.paypal.com/v2/checkout/orders/7M9*********8961C","rel":"self","method":"GET"},{"href":"https://www.paypal.com/checkoutnow?token=7M9*********8961C","rel":"approve","method":"GET"},{"href":"https://api.paypal.com/v2/checkout/orders/7M9*********8961C","rel":"update","method":"PATCH"},{"href":"https://api.paypal.com/v2/checkout/orders/7M9*********8961C/capture","rel":"capture","method":"POST"}]}
    Today, 11:35    
    Request Sent - https://api.paypal.com/v1/identity/generate-token
    Response received
    {"client_token":"eyJicmFpbnRyZWUiOnsiYXV0aG9yaXphdGlvbkZpbmdlcnByaW50IjoiYzRiNjJiMGFiYTg4ODZmYzJlZjIzNmQwZTBlMGU2YTljNTkwNGJlNDhmMmQzNDMyNDk4MDg5MDFlZDE1ODM3ZnxtZXJjaGFudF9pZD1yd3dua3FnMnhnNTZobTJuJnB1YmxpY19rZXk9ajJmYzJqcHhkZzZ2cDg0ZiZjcmVhdGVkX2F0PTIwMjItMDMtMTdUMTE6MzU6MjQuNTE2WiIsInZlcnNpb24iOiIzLXBheXBhbCJ9LCJwYXlwYWwiOnsiaWRUb2tlbiI6bnVsbCwiYWNjZXNzVG9rZW4iOiJBMjFBQU9FV1YzVnVQQlRUcU95OGJvYmh5blQ5ZjhGOXNDa2tjVVl6M3JmWjFrcjRMSDVPNEpGWGRwRzM5LUtaTXZ5eVV1THJFZzl6TmtkSXZfWEVUQmx1Yl9DaXlnNWVBIn19","expires_in":3600}
    Today, 11:32    
    Request Sent - https://api.paypal.com/v2/checkout/orders/
    {"intent":"CAPTURE","purchase_units":[{"reference_id":"623315d3e27dc","items":[{"name":"Bottomleys Mint Rock advert","unit_amount":{"value":"2","currency_code":"GBP"},"quantity":1,"sku":"SAS9","category":"PHYSICAL_GOODS"}],"amount":{"currency_code":"GBP","value":"6.00","breakdown":{"item_total":{"value":"2","currency_code":"GBP"},"shipping":{"value":"4","currency_code":"GBP"},"tax_total":{"value":"0","currency_code":"GBP"},"discount":{"value":"0","currency_code":"GBP"}}},"shipping":{"name":{"full_name":"Chris Coleman"},"email_address":"[email protected]","phone":"01432-354286","address":{"address_line_1":"12 Ran Street","admin_area_1":"","admin_area_2":"HEREFORD","postal_code":"HR40DT","country_code":"GB"}},"invoice_id":"220317-110348-8852","description":"Payment for order 220317-110348-8852"}],"application_context":{"shipping_preference":"SET_PROVIDED_ADDRESS","brand_name":"Small Wonders Miniatures","locale":"en-GB","user_action":"PAY_NOW"},"payer":{"name":{"given_name":"Chris","surname":"Coleman"},"address":{"address_line_1":"12 Ran Street","address_line_2":"","admin_area_1":"","admin_area_2":"HEREFORD","postal_code":"HR40DT","country_code":"GB"}}}
    Response received
    {"id":"4PP664404V1521223","intent":"CAPTURE","status":"CREATED","purchase_units":[{"reference_id":"623315d3e27dc","amount":{"currency_code":"GBP","value":"6.00","breakdown":{"item_total":{"currency_code":"GBP","value":"2.00"},"shipping":{"currency_code":"GBP","value":"4.00"},"tax_total":{"currency_code":"GBP","value":"0.00"},"discount":{"currency_code":"GBP","value":"0.00"}}},"payee":{"email_address":"[email protected]","merchant_id":"YEJVG9VG87BGE"},"description":"Payment for order 220317-110348-8852","invoice_id":"220317-110348-8852","items":[{"name":"Bottomleys Mint Rock advert","unit_amount":{"currency_code":"GBP","value":"2.00"},"quantity":"1","sku":"SAS9","category":"PHYSICAL_GOODS"}],"shipping":{"name":{"full_name":"Chris Coleman"},"address":{"address_line_1":"12 Ran Street","admin_area_2":"HEREFORD","postal_code":"HR40DT","country_code":"GB"}}}],"payer":{"name":{"given_name":"Chris","surname":"Coleman"},"address":{"address_line_1":"12 Ran Street","admin_area_2":"HEREFORD","postal_code":"HR40DT","country_code":"GB"}},"create_time":"2022-03-17T11:32:18Z","links":[{"href":"https://api.paypal.com/v2/checkout/orders/4PP664404V1521223","rel":"self","method":"GET"},{"href":"https://www.paypal.com/checkoutnow?token=4PP664404V1521223","rel":"approve","method":"GET"},{"href":"https://api.paypal.com/v2/checkout/orders/4PP664404V1521223","rel":"update","method":"PATCH"},{"href":"https://api.paypal.com/v2/checkout/orders/4PP664404V1521223/capture","rel":"capture","method":"POST"}]}
    Today, 11:32    
    Request Sent - https://api.paypal.com/v1/identity/generate-token
    Response received
    {"client_token":"eyJicmFpbnRyZWUiOnsiYXV0aG9yaXphdGlvbkZpbmdlcnByaW50IjoiZWUxYmE1ZmZjMGE5NGU2ZGMzYzllNDE2YjI2YzJmN2NkY2NjOTkwY2NlMmE3ODMzYzZlZGFiMTgxYzIwYzgwZHxtZXJjaGFudF9pZD1yd3dua3FnMnhnNTZobTJuJnB1YmxpY19rZXk9ajJmYzJqcHhkZzZ2cDg0ZiZjcmVhdGVkX2F0PTIwMjItMDMtMTdUMTE6MzI6MTguNTUxWiIsInZlcnNpb24iOiIzLXBheXBhbCJ9LCJwYXlwYWwiOnsiaWRUb2tlbiI6bnVsbCwiYWNjZXNzVG9rZW4iOiJBMjFBQU9UdUdyRHVHaG9IcUZ5VU5idlhxSjVORzNGekdfb0RqVzFRbGI5eXppZDktWTVSZkZlQU41NFRRY2M2QlFBUWRncmstUUdGaFl5RjNRdXE3dUswUXhUTjVxQm9RIn19","expires_in":3600}
    om/v1/notifications/webhooks

     

  5. One of my clients (well 2 actually ) wish to stop shipping to the EU altogether.

    At the moment the following zones are present -

    image.png.32de927e39f75845183d42517c60d886.png

     

    How can I remove the shipping zone for the EU without it becoming part of @Rest of [email protected]

     

    Or to put it another way if I delete the EU zone will it become part of the 'rest of world' zone, and if it does how do I prevent shipping to the EU ? 

     

    Many Thanks, Chris.

  6. CubeCart  6.4.4, recently upgraded.

     

    When we change/add a product the changes do not show unless we go to the maintenance section and manually 'Clear Cache', is this an issue or is it supposed to be like that ? 

     

    Also since the upgrade the Clear Cache at right hand top of window has disappeared, but I guess that was planned?

     

    Chris.

  7. Hi CubeCart People,

                                       hopefully simple question ..

    I'm changing the contact form on a site so user has to be logged-in to use it - this because a lobotomized BOT has gotten hold of the form and is sending just a few unsavory messages every day to site-admin. 

    Well we don't see it as a big deal to force users to login before using the contact form, but how do I determine if a user is logged in (or not), or to put it another way if a login session is active ?

    For your info I will use hook: class.cubecart.contact to send different content when the user is not logged in.

    Thanks and Regards, ChrisColeman.

    😎

  8. Ok a simple follow up ..

           Maybe I have a set of variables for a mobile platform, which I need to send to each HTML page. I would like to be able to pass the $_SESSION data between pages (server side) and normally (?) I would use $_SESSION to do that.

    Maybe I'll use SMARTY to extract the data and send to the page -  infact definately I would use SMARTY so I need to be able to get/set the $_SESSION variable within the plugins/hooks system with which I am familiar.

      How would I hande the $_SESSION array  in CubeCart, I'm guessing that its not so complicated but rather than diving into the CubeCart code and then maybe coming up with the wrong answer would appretiate some 'inside info'.

    Thank You - No Rush - I'm taking a breather until the New Year.

    Chris.

     

  9. Ok thats great.

    I guess i'll leave it until I have more time, then I'll take another look at fixing the missing keys - Not a big deal at the moment as everything is running fine and a lot of spare capacity on the server ..

    Thank You, Chris.

     

  10. Hi,

        I recently upgraded a  store (6.1.11 to 6.1.13) which is now using PHP Version 7.0.26, it is running well, taking orders and nothing bad showing in the logs.

    But I recently looked in the 'database maintenance' section and see the following for many of the tables, any ideas -

    image.png.f2dd345e84178a5cab72186d09290fa8.png

     

    Thanks in Advance - Chris.

     

  11. On 13/12/2017 at 11:20 PM, Al Brookbanks said:

    That's exactly what media queries are for. The CSS logic can be along the lines of "if screen size is less than X pixels make font size y pixels".

    Maybe I misunderstood you.

     

    Ok well perhaps that was not a good example, what if I wanted to display a different navigation on handheld devices, nothing to do with the width of the platform just a different 'look & feel' ?

    Chris.

  12. Yes I guess, but media queries can give the size but not the platform.

    There is a 'handheld' media type but thats rarely usefull because the mobile user-agents rarely use it.

    If for example I wished to change text size on parts of the page but only on handhelds it is difficult using media queries..

    Chris.   

     

     

     

  13. Yes - I did a bit of digging araound, I hope this is not too far off topic but figured it might be useful to someone  ..

    By the way thanks to IAN for pointing me in the right direction on this, I  have my own server and considerable experience in the computer industry but only a litte with Linux or Apache, anything I know about Linux has been self taught over the last 6 years or so, it never occurred to me that PHP handlers could be changed ..

    Only one version of PHP can be configured with the DSO handler, and unlimited versions can run with SU, but I need to run multiple versions in order to support some old websites (CubeCart and Others)..

    The old websites require the DSO handler, or cannot easily use the SU handler .

    CubeCart installed on a server running DSO will not transfer to a server running SU (again not easilly), maybe if I ran an upgrade on a CubeCart 6 version after moving it to SU that would solve the problem - I dont know ?

    Anyway CubeCart installed  on a server already running SU seems to install correctly.

    So my best option is to,

    1. Backup the databases of my 3 cubecart 6 sites.
    2. Delete the CubeCart 6 folders from the server
    3. Switch those sites to SU (PHP 7)
    4. Reinstall CubeCart on those sites, any associated mods and DB
    5. Delete the setup directory

    Actually about an hours work/site so if I do site by site not a big deal.

    By the way I noticed something else - If you try to recover a PHP DSO site to a PHP SU site - you'll get lots of permission errors :detective2:.

    Chris.

  14. Hi,

       thanks to Ian - I can now see the problem ..

    The handler for php 7 changed to PHPSU, before it was DSO.

    One question, can I just change the handler, or would it be better  to go with PHPSU and solve any problems as they present ..

    Of course another option would be to reinstall all of my CubeCart sites using a database backup and PHPSU, I guess that would fix it?

    Thanks, Chris.

     

     

  15. Hi,

    after upgrading my server to PHP 7 I cannot print orders ..

     I receive a server 500 error ..

    In the php error log I can see -

     

    Quote

    file_put_contents(/home/janda/public_html/files/print.f01d5aa282dceded2260c3eb038e4c14.php) [<a href='http://docs.php.net/manual/en/function.file-put-contents.php'>function.file-put-contents.php</a>]: failed to open stream: Permission denied in /home/janda/public_html/admin/sources/orders.index.inc.php on line 601, referer: https://www.jandasupplies.co.uk/admin.php?_g=orders&node=index&sort[order_date]=DESC&action=edit&order_id=170719-190018-2268

     

    Which is a bit strange because the printfile is alive and well in exactly the same location, ie. it just will not print.

     

    I can luckily switch back to PHP (5.6) fairly easily.

     

    But still I cannot print the file (funny it used to work), so I delete the print file which was left behind by PHP 7, and try to print again - This time success.

     

    Any ideas - I would like to upgrade PHP  on all 6or7 cubecart sites I am running.

     

    Many Thanks.

     

    Chris Coleman.

     

     

    Capture.PNG

  16. No problem, I can wait I have implemented my own solution using SMARTY but would like something better because have multiple stores to support, and because I have to present an ambiguous message to users.

    Just to reiterate ..

    As mentioned above maybe a new Hook is possible.

    The problem occurs because when the PHP code returns 'no address available' it does so even is there are addresses in the address book, if none of those is designated as a billing address.

    If I had a HOOK I could return some thing different like 'There are address(s) in the address book but none are designated as the billing address' or just ''There are no addresses in the address book", appropriately.

    Currently in both sets of circumstances the user is redirected to 'add a new address'.

    Chris.

  17. When I define an administrator I see 'Link to Customer Account', why would I wish to link to a customer's account , or should it be Administrator's account, and even then what would be the reason to do that ?

    Thanks and Regards, ChrisColeman.

     

  18. Well I did consider changing the code - but I dont want to have to change it again each time CubeCart makes a new release (£$!?), also I have about 8 or 10 CubeCart stores to maintain, some quite old so I may have to multiply the above several times therefore need a satisfactory solution 

    Well yes that is the crux of the problem - The return from the core code is ambiguous - There's a whole bunch of code in the foundation skin which is just unecessary but I think it was put there to get around the return from the core code; However there is possibly a different reason so I should not speculate on that.

    Happy Days ..

    Chris.

×
×
  • Create New...