We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33238
    • 388 Posts
    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 9 years, 5 months ago.]
      --
      ysanmiguel.com
      • 33238
      • 388 Posts
      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
          • 33238
          • 388 Posts
          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
            • 33238
            • 388 Posts
            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
              • 33238
              • 388 Posts
              No look moving the shopkeeper info to the snippet... help please, a small guide.

              Thank you!!!
                --
                ysanmiguel.com