On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hello everyone!!

    I'm working with Shopkeeper and trying to connect it to Paypal using a snippet and a hook to send the info.

    I need to send the total price and other placeholders but I don't know exactly how.

    I have the shop call in the page:
    [[!Shopkeeper@custom? &propertySetName=`custom` &noJQuery= `1` & LinkAllow = `0` &Lang=`english` ]]
    

    Everything works perfect, but if I try to display the total price in any other area in the page I can't.
    I'm trying using the placeholder [[+total_price]] doesn't work, and move the shopkeeper data to the snippet is not working at all.

    can anyone please tell me how to move the info?

    Thank you very much!!! [ed. note: Ysanmiguel last edited this post 4 years, 11 months ago.]
      --
      ysanmiguel.com
    • OK Done!!

      [[+shk.price_total]] - The total price of the order.

      [[+shk.items_total]] - The number of items in the cart.

      [[+shk.items_unique_total]] - The number of items in the cart unikalnyz.

      [[+shk.currency]] - Currency.

      This are the placeholders to show the info in the page...


      Now what is the structure to show this in the snippet to send that info to paypal?
        --
        ysanmiguel.com
      • It all depends on how you are using PayPal. There may be a URL with a query string to hold the data being passed, or it may be passed as form fields. In either case, use the placeholders to generate the required string or field values.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
        • Thank you for your answer smiley

          I'm following the instructions in shopkeeper documentation, they have this example to move the info using php.

          <? Php
          $ Data = array (
              'ID' => '123456'
              'Totalcount' => '200'
              'ReturnUrl' => 'http://mysite.com/return.html'
          );
          
          $modx->sendRedirect("http://payment-operator.com?ID={$data['ID']}&totalcount={$data['totalcount']}&returnUrl={$data['returnUrl']}");


          With paypal should be similar, but I'm not sure how to call this info: [[+shk.price_total]], [[+shk.items_total]], [[+shk.currency]] insithe the snippet, once I know that I can continue doing the paypal connection.
            --
            ysanmiguel.com
          • OK I think I'll try with this:

            https://github.com/phpfour/php-payment

            and this:

                $order_id = $_SESSION [ 'shk_order_id' ]; 
                $fields [ 'payment' ]  = $_SESSION [ 'shk_payment_method' ]; 
                $price = $_SESSION [ 'shk_order_price' ]; 
                $currency = $_SESSION [ 'shk_currency' ]; 
                $userId = $_SESSION [ 'shk_order_user_id' ];


            any advice?

            thank you!!!
              --
              ysanmiguel.com
            • No look moving the shopkeeper info to the snippet... help please, a small guide.

              Thank you!!!
                --
                ysanmiguel.com